Skip to content

Commit

Permalink
Use declare form instead of put, for clarity
Browse files Browse the repository at this point in the history
* which-key.el (which-key-add-major-mode-key-based-replacements):
Use declare form instead of put.
  • Loading branch information
jeremy-bryant authored and justbur committed Mar 3, 2024
1 parent 85f17c0 commit acaf543
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions which-key.el
Original file line number Diff line number Diff line change
Expand Up @@ -1129,6 +1129,7 @@ replacements are added to `which-key-replacement-alist'."
The difference is that MODE specifies the `major-mode' that must
be active for KEY-SEQUENCE and REPLACEMENT (MORE contains
addition KEY-SEQUENCE REPLACEMENT pairs) to apply."
(declare (indent defun))
;; TODO: Make interactive
(when (not (symbolp mode))
(error "MODE should be a symbol corresponding to a value of major-mode"))
Expand All @@ -1155,8 +1156,6 @@ addition KEY-SEQUENCE REPLACEMENT pairs) to apply."
(if (assq mode which-key--prefix-title-alist)
(setcdr (assq mode which-key--prefix-title-alist) title-mode-alist)
(push (cons mode title-mode-alist) which-key--prefix-title-alist))))
(put 'which-key-add-major-mode-key-based-replacements
'lisp-indent-function 'defun)

(defun which-key-define-key-recursively (map key def &optional at-root)
"Recursively bind KEY in MAP to DEF on every level of MAP except the first.
Expand Down

0 comments on commit acaf543

Please sign in to comment.