Fix void-variable list error in multi-state binds

Caused by overzealous re-setting of a variable in a loop, when it should
only be set once.
This commit is contained in:
Henrik Lissner 2018-12-22 05:20:43 -05:00
parent 5e33fefd74
commit 4d3587c8d0
No known key found for this signature in database
GPG Key ID: 5F6C0EA160557395

View File

@ -238,14 +238,17 @@ For example, :nvi will map to (list 'normal 'visual 'insert). See
(when (or (memq 'global states) (null states)) (when (or (memq 'global states) (null states))
(setq states (delq 'global states)) (setq states (delq 'global states))
(push 'nil states)) (push 'nil states))
(dolist (state states) (if (and (listp def)
(memq (car-safe (doom-unquote def)) '(:def :ignore :keymap)))
(setq def `(quote ,(plist-put (general--normalize-extended-def (doom-unquote def))
:which-key desc)))
(when desc (when desc
(setq def (setq def `(list ,@(cond ((and (equal key "")
(if (and (equal key "") (null def))
(null def)) `(nil :which-key ,desc))
`(quote (nil :which-key ,desc)) ((plist-put (general--normalize-extended-def def)
`(list ,@(plist-put (general--normalize-extended-def def) :which-key desc)))))))
:which-key desc))))) (dolist (state states)
(push key (alist-get state doom--map-batch-forms)) (push key (alist-get state doom--map-batch-forms))
(push def (alist-get state doom--map-batch-forms)))) (push def (alist-get state doom--map-batch-forms))))