[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/which-key db3d003 21/51: Add full keymap versions of sh
From: |
Stefan Monnier |
Subject: |
[elpa] externals/which-key db3d003 21/51: Add full keymap versions of show-{major, minor}-mode |
Date: |
Tue, 8 Sep 2020 10:26:17 -0400 (EDT) |
branch: externals/which-key
commit db3d003e903deb07394b4e572206f809578278c6
Author: Justin Burkett <justin@burkett.cc>
Commit: Justin Burkett <justin@burkett.cc>
Add full keymap versions of show-{major,minor}-mode
Fixes #236
---
which-key.el | 34 ++++++++++++++++++++++++++--------
1 file changed, 26 insertions(+), 8 deletions(-)
diff --git a/which-key.el b/which-key.el
index 1da0cfb..d343be0 100644
--- a/which-key.el
+++ b/which-key.el
@@ -2290,7 +2290,7 @@ after first page."
(which-key--create-buffer-and-show nil nil nil "Top-level bindings"))
;;;###autoload
-(defun which-key-show-major-mode ()
+(defun which-key-show-major-mode (&optional all)
"Show top-level bindings in the map of the current major mode.
This function will also detect evil bindings made using
@@ -2299,13 +2299,24 @@ current evil state. "
(interactive)
(let ((map-sym (intern (format "%s-map" major-mode))))
(if (and (boundp map-sym) (keymapp (symbol-value map-sym)))
- (which-key--create-buffer-and-show
- nil nil
+ (which-key--show-keymap
+ "Major-mode bindings"
+ (symbol-value map-sym)
(apply-partially #'which-key--map-binding-p (symbol-value map-sym))
- "Major-mode bindings")
+ all)
(message "which-key: No map named %s" map-sym))))
;;;###autoload
+(defun which-key-show-full-major-mode ()
+ "Show all bindings in the map of the current major mode.
+
+This function will also detect evil bindings made using
+`evil-define-key' in this map. These bindings will depend on the
+current evil state. "
+ (interactive)
+ (which-key-show-major-mode t))
+
+;;;###autoload
(defun which-key-dump-bindings (prefix buffer-name)
"Dump bindings from PREFIX into buffer named BUFFER-NAME.
@@ -2485,7 +2496,7 @@ selected interactively from all available keymaps."
nil t))
;;;###autoload
-(defun which-key-show-minor-mode-keymap ()
+(defun which-key-show-minor-mode-keymap (&optional all)
"Show the top-level bindings in KEYMAP using which-key. KEYMAP
is selected interactively by mode in `minor-mode-map-alist'."
(interactive)
@@ -2501,12 +2512,19 @@ is selected interactively by mode in
`minor-mode-map-alist'."
minor-mode-map-alist))
nil t nil 'which-key-keymap-history))))
(which-key--show-keymap (symbol-name mode-sym)
- (cdr (assq mode-sym minor-mode-map-alist)))))
+ (cdr (assq mode-sym minor-mode-map-alist))
+ all)))
+;;;###autoload
+(defun which-key-show-full-minor-mode-keymap ()
+ "Show all bindings in KEYMAP using which-key. KEYMAP
+is selected interactively by mode in `minor-mode-map-alist'."
+ (interactive)
+ (which-key-show-minor-mode-keymap t))
(defun which-key--show-keymap
- (keymap-name keymap &optional prior-args all no-paging)
+ (keymap-name keymap &optional prior-args all no-paging filter)
(when prior-args (push prior-args which-key--prior-show-keymap-args))
- (let ((bindings (which-key--get-bindings nil keymap nil all)))
+ (let ((bindings (which-key--get-bindings nil keymap filter all)))
(if (= (length bindings) 0)
(message "which-key: No bindings found in %s" keymap-name)
(cond ((listp which-key-side-window-location)
- [elpa] externals/which-key 1231016 29/51: More workflow fixes, (continued)
- [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
- [elpa] externals/which-key dcb9820 16/51: Default to imprecise window fitting on terminal, Stefan Monnier, 2020/09/08
- [elpa] externals/which-key e554326 49/51: Remove testing badge from README, Stefan Monnier, 2020/09/08
- [elpa] externals/which-key db3d003 21/51: Add full keymap versions of show-{major, minor}-mode,
Stefan Monnier <=
- [elpa] externals/which-key 8b49ae9 42/51: Fix last commit, Stefan Monnier, 2020/09/08
- [elpa] externals/which-key b11227b 23/51: Strip out advice in command docstrings, Stefan Monnier, 2020/09/08
- [elpa] externals/which-key 9ff54ff 37/51: Fix short windows being resized, Stefan Monnier, 2020/09/08
- [elpa] externals/which-key 9550707 40/51: Merge remote-tracking branch 'hlissner/patch-1', Stefan Monnier, 2020/09/08
- [elpa] externals/which-key 3642c11 45/51: Speed up which-key--maybe-replace, Stefan Monnier, 2020/09/08
- [elpa] externals/which-key da1abb4 27/51: Fix previous commit, Stefan Monnier, 2020/09/08
- [elpa] externals/which-key 2b10b8e 50/51: Remove use of focus-{in, out}-hook, Stefan Monnier, 2020/09/08
- [elpa] externals/which-key 9d1de2f 20/51: Refactor regexp & fix incompatibility + error, Stefan Monnier, 2020/09/08
- [elpa] externals/which-key c4b7aae 32/51: Revive Cask file, Stefan Monnier, 2020/09/08
- [elpa] externals/which-key f9d8d49 39/51: Fix prefix argument for which-key-show-major-mode (#239), Stefan Monnier, 2020/09/08