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

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

[elpa] externals/which-key fb2bc8f 06/51: Add which-key-persistent-popup


From: Stefan Monnier
Subject: [elpa] externals/which-key fb2bc8f 06/51: Add which-key-persistent-popup-p variable (#213)
Date: Tue, 8 Sep 2020 10:26:15 -0400 (EDT)

branch: externals/which-key
commit fb2bc8fd08fc39dd5527b13a65717399c5d6821b
Author: Uros Perisic <uros.m.perisic@gmail.com>
Commit: Uros Perisic <uros.m.perisic@gmail.com>

    Add which-key-persistent-popup-p variable (#213)
    
    I did not remove the `pre-command-hook', because that would require me
    to add the hook back every time `which-key--hide-popup' is called,
    which seems excessive. Hercules.el already handles this more
    conservatively. But if you want me to, I can add it.
---
 which-key.el | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/which-key.el b/which-key.el
index 99318d5..9b147bd 100644
--- a/which-key.el
+++ b/which-key.el
@@ -453,6 +453,9 @@ prefixes in `which-key-paging-prefixes'"
                                       which-key-undo-key
                                       which-key-undo))
 
+(defvar which-key-persistent-popup-p nil
+  "Whether or not to disable `which-key--hide-popup'.")
+
 (defcustom which-key-hide-alt-key-translations t
   "Hide key translations using Alt key if non nil.
 These translations are not relevant most of the times since a lot
@@ -1080,13 +1083,13 @@ total height."
 
 (defun which-key--hide-popup ()
   "This function is called to hide the which-key buffer."
-  (unless (member real-this-command which-key--paging-functions)
+  (unless (or which-key-persistent-popup-p
+              (member real-this-command which-key--paging-functions))
     (setq which-key--last-try-2-loc nil)
     (setq which-key--pages-obj nil)
     (setq which-key--automatic-display nil)
     (setq which-key--prior-show-keymap-args nil)
-    (when (and which-key-idle-secondary-delay
-               which-key--secondary-timer-active)
+    (when (and which-key-idle-secondary-delay 
which-key--secondary-timer-active)
       (which-key--start-timer))
     (which-key--lighter-restore)
     (cl-case which-key-popup-type



reply via email to

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