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

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

[elpa] externals/which-key 43e3e3d 4/8: Fix use of describe-prefix-bindi


From: Stefan Monnier
Subject: [elpa] externals/which-key 43e3e3d 4/8: Fix use of describe-prefix-bindings in which-key-show-standard-help
Date: Mon, 7 Sep 2020 16:26:58 -0400 (EDT)

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

    Fix use of describe-prefix-bindings in which-key-show-standard-help
    
    Use describe-prefix-bindings directly if we do not enter through
    which-key-C-h-dispatch.
    
    Fixes #198
---
 which-key.el | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/which-key.el b/which-key.el
index c62924d..d901a31 100644
--- a/which-key.el
+++ b/which-key.el
@@ -2193,13 +2193,18 @@ used are reapplied to the new key sequence."
   "Call the command in `which-key--prefix-help-cmd-backup'.
 Usually this is `describe-prefix-bindings'."
   (interactive)
-  (let ((which-key-inhibit t))
+  (let ((which-key-inhibit t)
+        (popup-showing (which-key--popup-showing-p)))
     (which-key--hide-popup-ignore-command)
-    (cond ((eq which-key--prefix-help-cmd-backup
-               'describe-prefix-bindings)
-           ;; This is essentially what `describe-prefix-bindings' does
-           (describe-bindings
-            (kbd (which-key--current-key-string))))
+    (cond ((and (eq which-key--prefix-help-cmd-backup
+                    'describe-prefix-bindings)
+                ;; If the popup is not showing, we call
+                ;; `describe-prefix-bindings' directly.
+                popup-showing)
+           ;; This is essentially what `describe-prefix-bindings' does. We 
can't
+           ;; use this function directly, because the prefix will not be 
correct
+           ;; when we enter using `which-key-C-h-dispatch'.
+           (describe-bindings (kbd (which-key--current-key-string))))
           ((functionp which-key--prefix-help-cmd-backup)
            (funcall which-key--prefix-help-cmd-backup)))))
 



reply via email to

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