From 3cfc7d1c0af2ea3a404926389c5c8741db833b0c Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 9 Feb 2017 05:05:33 -0500 Subject: [PATCH] @map: fix nested @map calls not inheriting let-bindings --- core/core-lib.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/core-lib.el b/core/core-lib.el index 2e57c0498..23cdbbb42 100644 --- a/core/core-lib.el +++ b/core/core-lib.el @@ -223,7 +223,7 @@ Example (cond ;; it's a sub expr ((listp key) - (push `(@map ,@key) forms)) + (push (macroexpand `(@map ,@key)) forms)) ;; it's a flag ((keywordp key) @@ -245,9 +245,9 @@ Example `(vconcat ,prefix (if (stringp ,def) (kbd ,def) ,def)) `(vconcat ,prefix ,(if (stringp def) (kbd def) def)))))) (:map (setq keymaps (-list (pop rest)))) - (:after (prog1 `((@after ,(pop rest) (@map ,@rest))) (setq rest '()))) - (:when (prog1 `((if ,(pop rest) (@map ,@rest))) (setq rest '()))) - (:unless (prog1 `((if (not ,(pop rest)) (@map ,@rest))) (setq rest '()))) + (:after (prog1 `((@after ,(pop rest) ,(macroexpand `(@map ,@rest)))) (setq rest '()))) + (:when (prog1 `((if ,(pop rest) ,(macroexpand `(@map ,@rest)))) (setq rest '()))) + (:unless (prog1 `((if (not ,(pop rest)) ,(macroexpand `(@map ,@rest)))) (setq rest '()))) (otherwise ; might be a state prefix (mapc (lambda (letter) (cond ((assoc letter state-map)