Subject: bug#49579: 28.0.50; [PATCH] Faster describe-mode

From: Ori Barbut <[email-masked]>
Date: Thu, 15 Jul 2021 12:47:36 -0400

Hi team,

This is a small improvement to a predicate that is called often when
one calls describe-mode. For a large configuration gives a noticable speed
boost; in my simple test it went from 7s to 0.4s to run describe-mode.

Thanks,

Ori

>From d5531a6a1d68a0710c866cadfb75bb0a0ba00f98 Mon Sep 17 00:00:00 2001
From: Ori <[email-masked]>
Date: Thu, 15 Jul 2021 12:25:10 -0400
Subject: [PATCH] ; * lisp/help-fns.el: Faster describe-mode

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
---
 lisp/help-fns.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index afdb0d17b2..835d20f5f2 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -1901,7 +1901,7 @@ help-fns--list-local-commands
                   ;; 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
-- 
2.25.1