aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Burkett2023-07-12 17:51:08 -0400
committerJustin Burkett2023-07-12 17:51:08 -0400
commitdf6b0cb8449812e7fb200bc852107fa7eb708496 (patch)
tree20c28629487b8b99e800cf0700b922921e8732a7
parentee6f0637f75ded903653b7a300a8588e3a8427f7 (diff)
downloademacs-df6b0cb8449812e7fb200bc852107fa7eb708496.tar.gz
emacs-df6b0cb8449812e7fb200bc852107fa7eb708496.zip
Add which-key-C-h-map-prompt to make it customizable
Fixes #350
-rw-r--r--which-key.el36
1 files changed, 20 insertions, 16 deletions
diff --git a/which-key.el b/which-key.el
index f7c4f160625..25f2397a9a8 100644
--- a/which-key.el
+++ b/which-key.el
@@ -437,6 +437,25 @@ Only takken into account when popup type is side-window."
437 'which-key 437 'which-key
438 :type 'boolean) 438 :type 'boolean)
439 439
440(defvar which-key-C-h-map-prompt
441 (concat " \\<which-key-C-h-map>"
442 " \\[which-key-show-next-page-cycle]"
443 which-key-separator "next-page,"
444 " \\[which-key-show-previous-page-cycle]"
445 which-key-separator "previous-page,"
446 " \\[which-key-undo-key]"
447 which-key-separator "undo-key,"
448 " \\[which-key-toggle-docstrings]"
449 which-key-separator "toggle-docstrings,"
450 " \\[which-key-show-standard-help]"
451 which-key-separator "help,"
452 " \\[which-key-abort]"
453 which-key-separator "abort"
454 " 1..9"
455 which-key-separator "digit-arg")
456 "Prompt to display when invoking `which-key-C-h-map'. This string
457is fed into `substitute-command-keys'")
458
440(defvar which-key-C-h-map 459(defvar which-key-C-h-map
441 (let ((map (make-sparse-keymap))) 460 (let ((map (make-sparse-keymap)))
442 (dolist (bind `(("\C-a" . which-key-abort) 461 (dolist (bind `(("\C-a" . which-key-abort)
@@ -2419,22 +2438,7 @@ prefix) if `which-key-use-C-h-commands' is non nil."
2419 full-prefix 2438 full-prefix
2420 (which-key--propertize 2439 (which-key--propertize
2421 (substitute-command-keys 2440 (substitute-command-keys
2422 (concat 2441 which-key-C-h-map-prompt)
2423 " \\<which-key-C-h-map>"
2424 " \\[which-key-show-next-page-cycle]"
2425 which-key-separator "next-page,"
2426 " \\[which-key-show-previous-page-cycle]"
2427 which-key-separator "previous-page,"
2428 " \\[which-key-undo-key]"
2429 which-key-separator "undo-key,"
2430 " \\[which-key-toggle-docstrings]"
2431 which-key-separator "toggle-docstrings,"
2432 " \\[which-key-show-standard-help]"
2433 which-key-separator "help,"
2434 " \\[which-key-abort]"
2435 which-key-separator "abort"
2436 " 1..9"
2437 which-key-separator "digit-arg"))
2438 'face 'which-key-note-face))) 2442 'face 'which-key-note-face)))
2439 (key (let ((key (read-key prompt))) 2443 (key (let ((key (read-key prompt)))
2440 (if (numberp key) 2444 (if (numberp key)