diff --git a/etc/NEWS b/etc/NEWS index f5e151750161..80e997d420fd 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -30,6 +30,11 @@ applies, and please also update docstrings as needed. * 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 diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 1966193d1a76..c4e09e48bea4 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -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)))))