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)
|
(general--concat t doom-leader-key ,key)
|
||||||
,desc)
|
,desc)
|
||||||
wkforms))
|
wkforms))
|
||||||
;; Don't bind missing functions (so they don't throw errors when
|
(push `(define-key doom-leader-map (general--kbd ,key)
|
||||||
;; used). `fboundp' conveniently returns `t' for autoloaded
|
,(if (general--extended-def-p unquoted-def)
|
||||||
;; functions as well as defined ones.
|
(plist-get unquoted-def :def)
|
||||||
(let* ((fn (if (general--extended-def-p unquoted-def)
|
def))
|
||||||
(plist-get unquoted-def :def)
|
forms)))))
|
||||||
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)))))))
|
|
||||||
(macroexp-progn
|
(macroexp-progn
|
||||||
(append (nreverse forms)
|
(append (nreverse forms)
|
||||||
(when wkforms
|
(when wkforms
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue