@map: fix nested @map calls not inheriting let-bindings

This commit is contained in:
Henrik Lissner 2017-02-09 05:05:33 -05:00
parent 7107d38d34
commit 3cfc7d1c0a

View file

@ -223,7 +223,7 @@ Example
(cond (cond
;; it's a sub expr ;; it's a sub expr
((listp key) ((listp key)
(push `(@map ,@key) forms)) (push (macroexpand `(@map ,@key)) forms))
;; it's a flag ;; it's a flag
((keywordp key) ((keywordp key)
@ -245,9 +245,9 @@ Example
`(vconcat ,prefix (if (stringp ,def) (kbd ,def) ,def)) `(vconcat ,prefix (if (stringp ,def) (kbd ,def) ,def))
`(vconcat ,prefix ,(if (stringp def) (kbd def) def)))))) `(vconcat ,prefix ,(if (stringp def) (kbd def) def))))))
(:map (setq keymaps (-list (pop rest)))) (:map (setq keymaps (-list (pop rest))))
(:after (prog1 `((@after ,(pop rest) (@map ,@rest))) (setq rest '()))) (:after (prog1 `((@after ,(pop rest) ,(macroexpand `(@map ,@rest)))) (setq rest '())))
(:when (prog1 `((if ,(pop rest) (@map ,@rest))) (setq rest '()))) (:when (prog1 `((if ,(pop rest) ,(macroexpand `(@map ,@rest)))) (setq rest '())))
(:unless (prog1 `((if (not ,(pop rest)) (@map ,@rest))) (setq rest '()))) (:unless (prog1 `((if (not ,(pop rest)) ,(macroexpand `(@map ,@rest)))) (setq rest '())))
(otherwise ; might be a state prefix (otherwise ; might be a state prefix
(mapc (lambda (letter) (mapc (lambda (letter)
(cond ((assoc letter state-map) (cond ((assoc letter state-map)