Undo noop'ed leader binds for missing commands
This was too magical and caused more confusion than the void-function and commandp errors before it. Addresses #1309, #1308 Relevant to #1217
This commit is contained in:
parent
2514b7476e
commit
43bc14d38e
1 changed files with 5 additions and 13 deletions
|
@ -99,19 +99,11 @@ If any hook returns non-nil, all hooks after it are ignored.")
|
|||
(general--concat t doom-leader-key ,key)
|
||||
,desc)
|
||||
wkforms))
|
||||
;; Don't bind missing functions (so they don't throw errors when
|
||||
;; used). `fboundp' conveniently returns `t' for autoloaded
|
||||
;; functions as well as defined ones.
|
||||
(let* ((fn (if (general--extended-def-p unquoted-def)
|
||||
(plist-get unquoted-def :def)
|
||||
def))
|
||||
(unquoted-fn (doom-unquote fn)))
|
||||
(when (or (not (symbolp unquoted-fn))
|
||||
(symbolp fn)
|
||||
(fboundp unquoted-fn))
|
||||
(push `(define-key doom-leader-map (general--kbd ,key)
|
||||
,fn)
|
||||
forms)))))))
|
||||
(push `(define-key doom-leader-map (general--kbd ,key)
|
||||
,(if (general--extended-def-p unquoted-def)
|
||||
(plist-get unquoted-def :def)
|
||||
def))
|
||||
forms)))))
|
||||
(macroexp-progn
|
||||
(append (nreverse forms)
|
||||
(when wkforms
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue