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

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

[elpa] master 9dc8d32 20/39: Add which-key-toggle-docstrings


From: Justin Burkett
Subject: [elpa] master 9dc8d32 20/39: Add which-key-toggle-docstrings
Date: Thu, 21 Jun 2018 15:48:15 -0400 (EDT)

branch: master
commit 9dc8d3233b6a4d8079c8a8a4b24f61ac146aa694
Author: Justin Burkett <address@hidden>
Commit: Justin Burkett <address@hidden>

    Add which-key-toggle-docstrings
---
 which-key.el | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/which-key.el b/which-key.el
index 2158dd9..82e747a 100644
--- a/which-key.el
+++ b/which-key.el
@@ -418,6 +418,8 @@ prefixes in `which-key-paging-prefixes'"
   (let ((map (make-sparse-keymap)))
     (dolist (bind '(("\C-a" . which-key-abort)
                     ("a" . which-key-abort)
+                    ("\C-d" . which-key-toggle-docstrings)
+                    ("d" . which-key-toggle-docstrings)
                     ("\C-h" . which-key-show-standard-help)
                     ("h" . which-key-show-standard-help)
                     ("\C-n" . which-key-show-next-page-cycle)
@@ -2228,6 +2230,14 @@ current evil state. "
   (let ((current-prefix-arg prefix-arg))
     (which-key-reload-key-sequence)))
 
+(defun which-key-toggle-docstrings (&optional _)
+  "Toggle the display of docstrings."
+  (interactive)
+  (unless (eq which-key-show-docstrings 'docstring-only)
+    (setq which-key-show-docstrings (null which-key-show-docstrings)))
+  (which-key-reload-key-sequence)
+  (which-key--create-buffer-and-show which-key--current-prefix))
+
 ;;;###autoload
 (defun which-key-C-h-dispatch ()
   "Dispatch C-h commands by looking up key in
@@ -2255,6 +2265,8 @@ prefix) if `which-key-use-C-h-commands' is non nil."
                               which-key-separator "previous-page,"
                               " \\[which-key-undo-key]"
                               which-key-separator "undo-key,"
+                              " \\[which-key-toggle-docstrings]"
+                              which-key-separator "toggle-docstrings,"
                               " \\[which-key-show-standard-help]"
                               which-key-separator "help,"
                               " \\[which-key-abort]"



reply via email to

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