; Improve documentation of function-type display
authorEli Zaretskii <eliz@gnu.org>
Tue, 7 Jan 2025 15:20:22 +0000 (17:20 +0200)
committerEli Zaretskii <eliz@gnu.org>
Tue, 7 Jan 2025 15:20:22 +0000 (17:20 +0200)
* etc/NEWS: Document 'help-display-function-type'.

* doc/lispref/functions.texi (Declare Form):
* doc/lispref/objects.texi (Type Specifiers):
* doc/emacs/help.texi (Name Help): Better indexing of function
types.  (Bug#65288)

doc/emacs/help.texi
doc/lispref/functions.texi
doc/lispref/objects.texi
etc/NEWS

index 2e0eb0d6459ef105f025b9929f7e1a498d2fa4d1..5c2eabb02d681ea0e891e9485ae03c19c6d71734 100644 (file)
@@ -323,7 +323,8 @@ yet further information is often reachable by clicking or typing
 @key{RET} on emphasized parts of the text.
 
 @cindex function type specifier
-
+@cindex declared type of a function
+@cindex inferred type of a function
 The function type, if known, is expressed with a @dfn{function type
 specifier} (@pxref{Type Specifiers,,,elisp, The Emacs Lisp Reference
 Manual}), it will be specified if the type was manually declared by a
index dc9443b69bca6c0d164054c8924d0ab0a2ef428a..6f65ff95c44131f7305a0c086f84cb3a886e307a 100644 (file)
@@ -2726,6 +2726,7 @@ function.  This allows function-level control of the safety level used
 for the code emitted for the function (@pxref{Native-Compilation
 Variables}).
 
+@cindex function type declaration
 @item (ftype @var{type} &optional @var{function})
 Declare @var{type} to be the type of this function.  This is used for
 documentation by @code{describe-function}.  Also it can be used by the
index 3bd5a4528b0b4cc5f53949e496c3421af1ee46ac..630765213a2889f56aed64aea021763aec496320 100644 (file)
@@ -1545,6 +1545,7 @@ The @code{not} type specifier defines any type except the specified one.
 The @code{member} type specifier allows to specify a type that includes
 only the explicitly listed values.
 
+@cindex declared type of a function
 @item (function (@var{arg-1-type} @dots{} @var{arg-n-type}) @var{return-type})
 The @code{function} type specifier is used to describe the argument
 types and the return type of a function.  Argument types can be interleaved
index 6b2831e380962e8cfa881e0eb55c0e84e300a9f7..31a0c4938ad59e6fa31558eed7c2cff4bba66a22 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -481,9 +481,13 @@ This user option controls outline visibility in the output buffer of
 'describe-bindings' when 'describe-bindings-outline' is non-nil.
 
 ---
-*** 'describe-function' shows the function inferred type when available.
+*** 'describe-function' shows the function's inferred type when available.
 For native compiled Lisp functions, 'describe-function' prints (after
-the signature) the automatically inferred function type as well.
+the signature) the automatically inferred function type as well.  If the
+function's type was explicitly declared (via the 'declare' form's
+'ftype' property), 'describe-function' shows the declared type.  This is
+controlled by the new user option 'help-display-function-type', which is
+by default t; customize to nil to disable function type display.
 
 ---
 *** 'describe-function' now shows the type of the function object.