]> git.eshelyaron.com Git - emacs.git/commitdiff
'describe-function' shows function inferred type when available
authorAndrea Corallo <akrl@sdf.org>
Fri, 19 May 2023 08:46:41 +0000 (10:46 +0200)
committerAndrea Corallo <akrl@sdf.org>
Tue, 30 May 2023 16:28:25 +0000 (18:28 +0200)
* lisp/help-fns.el (help-fns--signature): Print function type for
native compiled code.
* etc/NEWS: Add entry.

etc/NEWS
lisp/help-fns.el

index f5e151750161cab71dc64f6631d3db6f8e988710..80e997d420fdb4b1457bba581e15129969d71769 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -30,6 +30,11 @@ applies, and please also update docstrings as needed.
 \f
 * Changes in Emacs 30.1
 
+** Help
+** 'describe-function' shows function inferred type when available.
+For native compiled Lisp functions 'describe-function' prints (after
+the signature) the automatically inferred function type as well.
+
 ---
 ** New user option 'describe-bindings-outline-rules'.
 This user option controls outline visibility in the output buffer of
index 1966193d1a76fd042deb34a5289bf4aa38686554..c4e09e48bea46c34ad5433a2649b124fcb37aaba 100644 (file)
@@ -710,7 +710,11 @@ the C sources, too."
               (high-doc (cdr high)))
           (unless (and (symbolp function)
                        (get function 'reader-construct))
-            (insert high-usage "\n"))
+            (insert high-usage "\n")
+            (when (and (featurep 'native-compile)
+                       (subr-native-elisp-p (symbol-function function))
+                       (subr-type (symbol-function function)))
+              (insert (format "\nInferred type: %s\n" (subr-type (symbol-function function))))))
           (fill-region fill-begin (point))
           high-doc)))))