Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

Commit

Permalink
Add which-key-C-h-map-prompt to make it customizable
Browse files Browse the repository at this point in the history
Fixes #350
  • Loading branch information
justbur committed Jul 12, 2023
1 parent ee6f063 commit df6b0cb
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions which-key.el
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,25 @@ Only takken into account when popup type is side-window."
'which-key
:type 'boolean)

(defvar which-key-C-h-map-prompt
(concat " \\<which-key-C-h-map>"
" \\[which-key-show-next-page-cycle]"
which-key-separator "next-page,"
" \\[which-key-show-previous-page-cycle]"
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]"
which-key-separator "abort"
" 1..9"
which-key-separator "digit-arg")
"Prompt to display when invoking `which-key-C-h-map'. This string
is fed into `substitute-command-keys'")

(defvar which-key-C-h-map
(let ((map (make-sparse-keymap)))
(dolist (bind `(("\C-a" . which-key-abort)
Expand Down Expand Up @@ -2419,22 +2438,7 @@ prefix) if `which-key-use-C-h-commands' is non nil."
full-prefix
(which-key--propertize
(substitute-command-keys
(concat
" \\<which-key-C-h-map>"
" \\[which-key-show-next-page-cycle]"
which-key-separator "next-page,"
" \\[which-key-show-previous-page-cycle]"
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]"
which-key-separator "abort"
" 1..9"
which-key-separator "digit-arg"))
which-key-C-h-map-prompt)
'face 'which-key-note-face)))
(key (let ((key (read-key prompt)))
(if (numberp key)
Expand Down

0 comments on commit df6b0cb

Please sign in to comment.