From: Ori Date: Thu, 15 Jul 2021 16:57:38 +0000 (+0200) Subject: ; * lisp/help-fns.el: Speed up `describe-mode' X-Git-Tag: emacs-28.0.90~1850 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=eaefa44acd32f4f7d5e6357546ad22058495ee3f;p=emacs.git ; * lisp/help-fns.el: Speed up `describe-mode' * lisp/help-fns.el (help-fns--list-local-commands): Speed up (bug#49579). A predicate checks if there are no key bindings for a given function. A full list of bindings is not needed, even a single binding is sufficient to say the function is bound. Set FIRSTONLY arg in where-is-internal so this predicate runs faster, with functional equivalence. For some configurations this has a noticeable improvement on the speed of describe-mode. Copyright-paperwork-exempt: yes --- diff --git a/lisp/help-fns.el b/lisp/help-fns.el index d3fdb47a348..cb248b1d009 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -1901,7 +1901,7 @@ documentation for the major and minor modes of that buffer." ;; Ignore aliases. (not (symbolp (symbol-function sym))) ;; Ignore everything bound. - (not (where-is-internal sym)) + (not (where-is-internal sym nil t)) (apply #'derived-mode-p (command-modes sym))) (push sym functions)))) (with-temp-buffer