[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 4370658 29/39: Factor out which-key--this-command-keys fun
From: |
Justin Burkett |
Subject: |
[elpa] master 4370658 29/39: Factor out which-key--this-command-keys function |
Date: |
Thu, 21 Jun 2018 15:48:17 -0400 (EDT) |
branch: master
commit 437065886d8ac256c5539d040852c971b922a9b4
Author: Justin Burkett <address@hidden>
Commit: Justin Burkett <address@hidden>
Factor out which-key--this-command-keys function
---
which-key.el | 25 +++++++++++++++----------
1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/which-key.el b/which-key.el
index 580cab5..e38571f 100644
--- a/which-key.el
+++ b/which-key.el
@@ -2026,7 +2026,7 @@ including prefix arguments."
(defun which-key--get-popup-map ()
"Generate transient-map for use in the top level binding display."
- (unless (which-key--current-prefix)
+ (unless which-key--automatic-display
(let ((map (make-sparse-keymap)))
(define-key map (kbd which-key-paging-key) #'which-key-C-h-dispatch)
(when which-key-use-C-h-commands
@@ -2485,14 +2485,12 @@ Finally, show the buffer."
(message "On prefix \"%s\" which-key took %.0f ms." prefix-desc
(* 1000 (float-time (time-since start-time)))))))
-(defun which-key--update ()
- "Function run by timer to possibly trigger
-`which-key--create-buffer-and-show'."
- (let ((prefix-keys (this-single-command-keys))
- delay-time)
- (when (and (equal prefix-keys [key-chord])
+(defun which-key--this-command-keys ()
+ "Version of `this-single-command-keys' corrected for key-chords and
god-mode."
+ (let ((this-command-keys (this-single-command-keys)))
+ (when (and (equal this-command-keys [key-chord])
(bound-and-true-p key-chord-mode))
- (setq prefix-keys
+ (setq this-command-keys
(condition-case nil
(let ((rkeys (recent-keys)))
(vector 'key-chord
@@ -2509,8 +2507,15 @@ Finally, show the buffer."
(when (and which-key--god-mode-support-enabled
(bound-and-true-p god-local-mode)
(eq this-command 'god-mode-self-insert))
- (setq prefix-keys (when which-key--god-mode-key-string
+ (setq this-command-keys (when which-key--god-mode-key-string
(kbd which-key--god-mode-key-string))))
+ this-command-keys))
+
+(defun which-key--update ()
+ "Function run by timer to possibly trigger
+`which-key--create-buffer-and-show'."
+ (let ((prefix-keys (which-key--this-command-keys))
+ delay-time)
(cond ((and (> (length prefix-keys) 0)
(or (keymapp (key-binding prefix-keys))
;; Some keymaps are stored here like iso-transl-ctl-x-8-map
@@ -2590,7 +2595,7 @@ Finally, show the buffer."
which-key--paging-functions))
(and (< 0 (length (this-single-command-keys)))
(not (equal (which-key--current-prefix)
- (this-single-command-keys)))))
+ (which-key--this-command-keys)))))
(cancel-timer which-key--paging-timer)
(which-key--start-timer))))))
- [elpa] master 206be7a 33/39: Fix behavior of f and t in evil operator map, (continued)
- [elpa] master 206be7a 33/39: Fix behavior of f and t in evil operator map, Justin Burkett, 2018/06/21
- [elpa] master e97253b 24/39: Add prefix arg to which-key--get-current-bindings and .., Justin Burkett, 2018/06/21
- [elpa] master ded908e 25/39: Remove which-key--current-prefix, Justin Burkett, 2018/06/21
- [elpa] master 013681a 28/39: Fixes related to removal of which-key--current-prefix, Justin Burkett, 2018/06/21
- [elpa] master ff79dff 38/39: Version 3.3.0, Justin Burkett, 2018/06/21
- [elpa] master 4042f06 34/39: Fix prefix bindings in which-key-show-major-mode, Justin Burkett, 2018/06/21
- [elpa] master 0dc4e84 36/39: Use window-size-change-functions for detecting size changes, Justin Burkett, 2018/06/21
- [elpa] master ab60391 21/39: Use cl-struct to hold which-key pages, Justin Burkett, 2018/06/21
- [elpa] master 0b2739a 27/39: Fix display of meta bindings in which-key-show-keymap, Justin Burkett, 2018/06/21
- [elpa] master f77d421 19/39: Consolidate key binding collection into which-key--get-bindings, Justin Burkett, 2018/06/21
- [elpa] master 4370658 29/39: Factor out which-key--this-command-keys function,
Justin Burkett <=
- [elpa] master a4095e8 37/39: Fix handling of duplicate (evil) bindings in show keymap, Justin Burkett, 2018/06/21
- [elpa] master f251541 18/39: Refactor show keymap functions, Justin Burkett, 2018/06/21
- [elpa] master 8a878de 32/39: Version 3.2.0, Justin Burkett, 2018/06/21
- [elpa] master 2c91540 35/39: Add support for evil's auxiliary maps in show-keymap functions, Justin Burkett, 2018/06/21
- [elpa] master bc97659 31/39: Fix and improve defcustoms, Justin Burkett, 2018/06/21
- [elpa] master ed7aa66 23/39: Remove a bunch of global variables, Justin Burkett, 2018/06/21
- [elpa] master fb09d75 39/39: Merge commit 'ff79dfff66f880885c5893dd6fd05dc51173a476', Justin Burkett, 2018/06/21