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

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

[elpa] externals/which-key 5cbfccd 09/51: Add which-key-manual-update


From: Stefan Monnier
Subject: [elpa] externals/which-key 5cbfccd 09/51: Add which-key-manual-update
Date: Tue, 8 Sep 2020 10:26:15 -0400 (EDT)

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

    Add which-key-manual-update
    
    Intended to be used for prefix-help-command
    
    Ref #66
---
 which-key.el | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/which-key.el b/which-key.el
index c47c576..703d9f5 100644
--- a/which-key.el
+++ b/which-key.el
@@ -2583,6 +2583,23 @@ Finally, show the buffer."
                           (kbd which-key--god-mode-key-string))))
     this-command-keys))
 
+;;;###autoload
+(defun which-key-manual-update ()
+  "Force which-key update.
+
+This command is intended to be used for `prefix-help-command', as
+follows
+
+\(setq prefix-help-command 'which-key-manual-update).
+
+This should be set after activating `which-key-mode'."
+  (interactive)
+  (let* ((current-prefix
+          (butlast
+           (listify-key-sequence (which-key--this-command-keys)))))
+    (which-key-reload-key-sequence current-prefix)
+    (which-key--start-timer 0 t)))
+
 (defun which-key--update ()
   "Function run by timer to possibly trigger
 `which-key--create-buffer-and-show'."



reply via email to

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