emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/marginalia 57b1176 051/241: marginalia-annotate-command


From: Stefan Monnier
Subject: [elpa] externals/marginalia 57b1176 051/241: marginalia-annotate-command-binding: only store the binding in the hash table
Date: Fri, 28 May 2021 20:48:55 -0400 (EDT)

branch: externals/marginalia
commit 57b117681e65194afb9b0dc0594e40e281a81326
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    marginalia-annotate-command-binding: only store the binding in the hash 
table
    
    No need to cache anything else, the slowness is purely due to 
where-is-internal.
---
 marginalia.el | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index 78f4007..c0f4b37 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -226,11 +226,9 @@ determine it."
       (cl-do-all-symbols (sym)
         (when (commandp sym)
           (when-let (key (where-is-internal sym nil t))
-            (puthash sym
-                     (propertize (format " (%s)" (key-description key))
-                                 'face 'marginalia-key)
-                     marginalia-annotate-command-binding--hash)))))
-    (gethash (intern cand) marginalia-annotate-command-binding--hash)))
+            (puthash sym key marginalia-annotate-command-binding--hash)))))
+    (when-let (binding (gethash (intern cand) 
marginalia-annotate-command-binding--hash))
+      (propertize (format " (%s)" (key-description binding)) 'face 
'marginalia-key))))
 
 (defun marginalia-annotate-command-full (cand)
   "Annotate command CAND with the keybinding and its documentation string."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]