[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 013681a 28/39: Fixes related to removal of which-key--curr
From: |
Justin Burkett |
Subject: |
[elpa] master 013681a 28/39: Fixes related to removal of which-key--current-prefix |
Date: |
Thu, 21 Jun 2018 15:48:17 -0400 (EDT) |
branch: master
commit 013681a1e3174071b26eedff57e2f09f6e6e7ad0
Author: Justin Burkett <address@hidden>
Commit: Justin Burkett <address@hidden>
Fixes related to removal of which-key--current-prefix
---
which-key.el | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/which-key.el b/which-key.el
index c76b653..580cab5 100644
--- a/which-key.el
+++ b/which-key.el
@@ -1418,9 +1418,9 @@ local bindings coming first. Within these categories
order using
(throw 'res res)))))))
(nreverse res)))
-(defun which-key--get-pseudo-binding (key-binding)
+(defun which-key--get-pseudo-binding (key-binding &optional prefix)
(let* ((pseudo-binding
- (key-binding (which-key--pseudo-key (kbd (car key-binding)) t)))
+ (key-binding (which-key--pseudo-key (kbd (car key-binding)) prefix)))
(pseudo-binding (when pseudo-binding (cadr pseudo-binding)))
(pseudo-desc (when pseudo-binding (car pseudo-binding)))
(pseudo-def (when pseudo-binding (cdr pseudo-binding)))
@@ -1433,11 +1433,11 @@ local bindings coming first. Within these categories
order using
(eq pseudo-def real-def))
(cons (car key-binding) pseudo-desc))))
-(defun which-key--maybe-replace (key-binding)
+(defun which-key--maybe-replace (key-binding &optional prefix)
"Use `which-key--replacement-alist' to maybe replace KEY-BINDING.
KEY-BINDING is a cons cell of the form \(KEY . BINDING\) each of
which are strings. KEY is of the form produced by `key-binding'."
- (let* ((pseudo-binding (which-key--get-pseudo-binding key-binding)))
+ (let* ((pseudo-binding (which-key--get-pseudo-binding key-binding prefix)))
(if pseudo-binding
pseudo-binding
(let* ((mode-res (which-key--get-replacements key-binding t))
@@ -1487,13 +1487,13 @@ which are strings. KEY is of the form produced by
`key-binding'."
map (kbd (which-key--current-key-string (car keydesc))))
(intern (cdr keydesc)))))
-(defun which-key--pseudo-key (key &optional use-current-prefix)
+(defun which-key--pseudo-key (key &optional prefix)
"Replace the last key in the sequence KEY by a special symbol
in order for which-key to allow looking up a description for the key."
(let* ((seq (listify-key-sequence key))
(final (intern (format "which-key-%s" (key-description (last seq))))))
- (if use-current-prefix
- (vconcat (which-key--current-key-list) (list final))
+ (if prefix
+ (vconcat prefix (list final))
(vconcat (butlast seq) (list final)))))
(defun which-key--maybe-get-prefix-title (keys)
@@ -1640,7 +1640,7 @@ return the docstring."
(t
(format "%s %s" current docstring)))))
-(defun which-key--format-and-replace (unformatted &optional preserve-full-key)
+(defun which-key--format-and-replace (unformatted &optional prefix
preserve-full-key)
"Take a list of (key . desc) cons cells in UNFORMATTED, add
faces and perform replacements according to the three replacement
alists. Returns a list (key separator description)."
@@ -1654,13 +1654,13 @@ alists. Returns a list (key separator description)."
(orig-desc (cdr key-binding))
(group (which-key--group-p orig-desc))
;; At top-level prefix is nil
- (keys (if (which-key--current-prefix)
- (concat (which-key--current-key-string) " " key)
+ (keys (if prefix
+ (concat (key-description prefix) " " key)
key))
(local (eq (which-key--safe-lookup-key local-map (kbd keys))
(intern orig-desc)))
(hl-face (which-key--highlight-face orig-desc))
- (key-binding (which-key--maybe-replace (cons keys orig-desc)))
+ (key-binding (which-key--maybe-replace (cons keys orig-desc)
prefix))
(final-desc (which-key--propertize-description
(cdr key-binding) group local hl-face orig-desc)))
(when final-desc
@@ -1810,7 +1810,7 @@ non-nil, then bindings are collected recursively for all
prefixes."
(when which-key-sort-order
(setq unformatted
(sort unformatted which-key-sort-order)))
- (which-key--format-and-replace unformatted recursive)))
+ (which-key--format-and-replace unformatted prefix recursive)))
;;; Functions for laying out which-key buffer pages
@@ -1957,7 +1957,7 @@ is the width of the live window."
(setf (which-key--pages-prefix-title result)
(or prefix-title
(which-key--maybe-get-prefix-title
- (which-key--current-key-string))))
+ (key-description prefix-keys))))
result)))
(defun which-key--lighter-status ()
@@ -2110,7 +2110,7 @@ and a page count."
"Show current page. N changes the current page to the Nth page
relative to the current one."
(which-key--init-buffer) ;; in case it was killed
- (let ((prefix-keys (key-description (which-key--current-prefix)))
+ (let ((prefix-keys (which-key--current-key-string))
golden-ratio-mode)
(if (null which-key--pages-obj)
(message "%s- which-key can't show keys: There is not \
@@ -2280,7 +2280,7 @@ prefix) if `which-key-use-C-h-commands' is non nil."
(interactive)
(if (not (which-key--popup-showing-p))
(which-key-show-standard-help)
- (let* ((prefix-keys (key-description (which-key--current-prefix)))
+ (let* ((prefix-keys (which-key--current-key-string))
(full-prefix (which-key--full-prefix prefix-keys current-prefix-arg
t))
(prompt (concat (when (string-equal prefix-keys "")
(which-key--propertize
- [elpa] master 3c05294 26/39: Fix which-key--create-pages, (continued)
- [elpa] master 3c05294 26/39: Fix which-key--create-pages, Justin Burkett, 2018/06/21
- [elpa] master adc0d66 06/39: Use safe version of propertize, Justin Burkett, 2018/06/21
- [elpa] master 0f80d0f 17/39: Use symbol at point in whow keymap functions, Justin Burkett, 2018/06/21
- [elpa] master 61e399f 22/39: Add and use which-key--automatic-display, Justin Burkett, 2018/06/21
- [elpa] master 506c348 10/39: Add which-key-show-full-keymap, Justin Burkett, 2018/06/21
- [elpa] master d19fe4e 30/39: Fix switching to top-level from which-key-undo-key, Justin Burkett, 2018/06/21
- [elpa] master 9dc8d32 20/39: Add which-key-toggle-docstrings, Justin Burkett, 2018/06/21
- [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 <=
- [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, 2018/06/21
- [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