[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/which-key a256c4b 13/51: Use which-key-idle-secondary-d
From: |
Stefan Monnier |
Subject: |
[elpa] externals/which-key a256c4b 13/51: Use which-key-idle-secondary-delay value in manual updates |
Date: |
Tue, 8 Sep 2020 10:26:16 -0400 (EDT) |
branch: externals/which-key
commit a256c4bce66d3805af07cc9f3dec5baeae1808de
Author: Justin Burkett <justin@burkett.cc>
Commit: Justin Burkett <justin@burkett.cc>
Use which-key-idle-secondary-delay value in manual updates
---
README.org | 11 +++++++----
which-key.el | 21 ++++++++++++++-------
2 files changed, 21 insertions(+), 11 deletions(-)
diff --git a/README.org b/README.org
index a413344..ee57388 100644
--- a/README.org
+++ b/README.org
@@ -142,10 +142,13 @@
along the following lines
#+BEGIN_SRC emacs-lisp
- ;; make sure which-key doesn't show normally
- (setq which-key-idle-delay 1000)
- (which-key-mode)
- (setq prefix-help-command 'which-key-manual-update)
+ ;; make sure which-key doesn't show normally
+ (setq which-key-idle-delay 1000)
+ ;; which-key-manual-update uses this variable to control refreshing the
+ ;; which-key buffer after new keypresses
+ (setq which-key-idle-secondary-delay 0.05)
+ (which-key-mode)
+ (setq prefix-help-command 'which-key-manual-update)
#+END_SRC
This will prevent which-key from showing automatically, and allow you to use
diff --git a/which-key.el b/which-key.el
index b6ae912..8937436 100644
--- a/which-key.el
+++ b/which-key.el
@@ -2588,12 +2588,13 @@ Finally, show the buffer."
(defun which-key-manual-update ()
"Force which-key update.
-This command is intended to be used for `prefix-help-command', as
-follows
+This command is intended to be used for `prefix-help-command'. An
+example configuration for using this command is the following.
-\(setq prefix-help-command 'which-key-manual-update).
-
-This should be set after activating `which-key-mode'."
+\(setq which-key-idle-delay 1000)
+\(setq which-key-idle-secondary-delay 0.05)
+\(which-key-mode)
+\(setq prefix-help-command 'which-key-manual-update)"
(interactive)
(if (which-key--popup-showing-p)
(which-key-C-h-dispatch)
@@ -2601,7 +2602,9 @@ This should be set after activating `which-key-mode'."
(butlast
(listify-key-sequence (which-key--this-command-keys)))))
(which-key-reload-key-sequence current-prefix)
- (which-key--start-timer 0.05 t))))
+ (if which-key-idle-secondary-delay
+ (which-key--start-timer which-key-idle-secondary-delay t)
+ (which-key--start-timer 0.05 t)))))
(defun which-key--update ()
"Function run by timer to possibly trigger
@@ -2689,7 +2692,11 @@ This should be set after activating `which-key-mode'."
(not (equal (which-key--current-prefix)
(which-key--this-command-keys)))))
(cancel-timer which-key--paging-timer)
- (which-key--start-timer))))))
+ (if which-key-idle-secondary-delay
+ ;; we haven't executed a command yet so the secandary
+ ;; timer is more relevant here
+ (which-key--start-timer which-key-idle-secondary-delay
t)
+ (which-key--start-timer)))))))
(provide 'which-key)
;;; which-key.el ends here
- [elpa] externals/which-key updated (9c5922e -> d794c4a), Stefan Monnier, 2020/09/08
- [elpa] externals/which-key 187ac0e 03/51: Add note to docstring for which-key-idle-delay, Stefan Monnier, 2020/09/08
- [elpa] externals/which-key c87b0ce 02/51: Add debugging messages for buffer sizing, Stefan Monnier, 2020/09/08
- [elpa] externals/which-key da2e093 08/51: Add no-paging optional arg to which-key-show-keymap, Stefan Monnier, 2020/09/08
- [elpa] externals/which-key 51c485f 01/51: Don't ignore case when making replacements, Stefan Monnier, 2020/09/08
- [elpa] externals/which-key 77586e6 04/51: Add which-key-dump-bindings, Stefan Monnier, 2020/09/08
- [elpa] externals/which-key 5cbfccd 09/51: Add which-key-manual-update, Stefan Monnier, 2020/09/08
- [elpa] externals/which-key fb2bc8f 06/51: Add which-key-persistent-popup-p variable (#213), Stefan Monnier, 2020/09/08
- [elpa] externals/which-key ba03e7e 05/51: Add translation keymap support (#210), Stefan Monnier, 2020/09/08
- [elpa] externals/which-key 2cb5ceb 12/51: Fix paging in which-key-manual-update, Stefan Monnier, 2020/09/08
- [elpa] externals/which-key a256c4b 13/51: Use which-key-idle-secondary-delay value in manual updates,
Stefan Monnier <=
- [elpa] externals/which-key a916c9a 15/51: Fix typos (#222), Stefan Monnier, 2020/09/08
- [elpa] externals/which-key 45bfcd3 22/51: Make which-key-show prefix mode-line work like top and bottom, Stefan Monnier, 2020/09/08
- [elpa] externals/which-key 1231016 29/51: More workflow fixes, Stefan Monnier, 2020/09/08
- [elpa] externals/which-key 7bc87e0 41/51: Test once a month, Stefan Monnier, 2020/09/08
- [elpa] externals/which-key ebb4e92 47/51: Add which-key-add-keymap-based-replacements, Stefan Monnier, 2020/09/08
- [elpa] externals/which-key e048b2a 48/51: Stop testing against v24.5, Stefan Monnier, 2020/09/08
- [elpa] externals/which-key d794c4a 51/51: Improve keymap-based-replacement description in README, Stefan Monnier, 2020/09/08
- [elpa] externals/which-key cf8572a 07/51: which-key-persistent-popup-p -> which-key-persistent-popup, Stefan Monnier, 2020/09/08
- [elpa] externals/which-key 8554a9f 17/51: Generalize C-h commands to use help-char, Stefan Monnier, 2020/09/08
- [elpa] externals/which-key 5cec113 10/51: Announce which-key-manual-update, Stefan Monnier, 2020/09/08