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

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

[elpa] externals/which-key b83c0de 27/32: Clean up which-key--maybe-repl


From: ELPA Syncer
Subject: [elpa] externals/which-key b83c0de 27/32: Clean up which-key--maybe-replace
Date: Wed, 30 Jun 2021 18:57:31 -0400 (EDT)

branch: externals/which-key
commit b83c0deca652ee3d42c1501dd09416b2505304b7
Author: Justin Burkett <justin@burkett.cc>
Commit: Justin Burkett <justin@burkett.cc>

    Clean up which-key--maybe-replace
---
 which-key.el | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/which-key.el b/which-key.el
index 2bfbb39..9a2883d 100644
--- a/which-key.el
+++ b/which-key.el
@@ -1506,7 +1506,7 @@ local bindings coming first. Within these categories 
order using
         (setq key-binding (which-key--replace-in-binding key-binding repl))))
     (when found `(replaced . ,key-binding))))
 
-(defun which-key--maybe-replace (key-binding &optional prefix)
+(defun which-key--maybe-replace (key-binding)
   "Use `which-key--replacement-alist' to maybe replace KEY-BINDING.
 KEY-BINDING is a cons cell of the form \(KEY . BINDING\) each of
 which are strings. KEY is of the form produced by `key-binding'."
@@ -1721,17 +1721,13 @@ alists. Returns a list (key separator description)."
         (local-map (current-local-map))
         new-list)
     (dolist (key-binding unformatted)
-      (let* ((key (car key-binding))
+      (let* ((keys (car key-binding))
              (orig-desc (cdr key-binding))
              (group (which-key--group-p orig-desc))
-             ;; At top-level prefix is nil
-             (keys (if prefix
-                       (concat (key-description prefix) " " key)
-                     key))
              (local (eq (which-key--safe-lookup-key local-map (kbd keys))
                         (intern orig-desc)))
              (hl-face (which-key--highlight-face orig-desc))
-             (key-binding (which-key--maybe-replace (cons keys orig-desc) 
prefix))
+             (key-binding (which-key--maybe-replace key-binding))
              (final-desc (which-key--propertize-description
                           (cdr key-binding) group local hl-face orig-desc)))
         (when final-desc



reply via email to

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