Try and avoid hardcoding lists of function types

* lisp/bind-key.el (bind-key--get-binding-description):
Show docstrings for compiled functions also.  Don't hardcode knowledge
about various particular kinds of functions.

* lisp/emacs-lisp/bytecomp.el (display-call-tree): Remove special
support for functions with a `byte-code` body since we never generate
that nowadays.  Don't hardcode knowledge
about various particular kinds of functions.
This commit is contained in:
Stefan Monnier 2024-03-12 16:09:23 -04:00
parent 8df6739077
commit 4afafa0370
2 changed files with 22 additions and 35 deletions

View file

@ -5536,23 +5536,14 @@ invoked interactively."
(if (null f)
" <top level>";; shouldn't insert nil then, actually -sk
" <not defined>"))
((subrp (setq f (symbol-function f)))
" <subr>")
((symbolp f)
((symbolp (setq f (symbol-function f))) ;; An alias.
(format " ==> %s" f))
((byte-code-function-p f)
"<compiled function>")
((not (consp f))
"<malformed function>")
(format " <%s>" (type-of f)))
((eq 'macro (car f))
(if (or (compiled-function-p (cdr f))
;; FIXME: Can this still happen?
(assq 'byte-code (cdr (cdr (cdr f)))))
(if (compiled-function-p (cdr f))
" <compiled macro>"
" <macro>"))
((assq 'byte-code (cdr (cdr f)))
;; FIXME: Can this still happen?
"<compiled lambda>")
((eq 'lambda (car f))
"<function>")
(t "???"))