From 29abf59bad60ab9098231ddf2957ee8c9e68637a Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Wed, 14 Aug 2013 00:40:20 -0400 Subject: [PATCH] macroexpand not needed Since lambda thunking replaced quoting in a76d167. To see why, observe that cases 3 and 4 disassemble to identical code. The difference between cases 1 and 2 shows why the macroexpand was needed originally. (defmacro test-quote (name-string) `(eval-after-load "foo" `(with-elapsed-timer ,(format "Configuring package %s" name-string) (message "test-quote")))) (defmacro test-expand-quote (name-string) `(eval-after-load "foo" ,(macroexpand-all `(with-elapsed-timer ,(format "Configuring package %s" name-string) (message "test-expand-quote"))))) (defmacro test-lambda (name-string) `(eval-after-load "foo" `(,(lambda () (with-elapsed-timer ,(format "Configuring package %s" name-string) (message "test-lambda")))))) (defmacro test-expand-lambda (name-string) `(eval-after-load "foo" `(,(lambda () ,(macroexpand-all `(with-elapsed-timer ,(format "Configuring package %s" name-string) (message "test-lambda"))))))) (disassemble (lambda () (test-quote "testing..."))) (disassemble (lambda () (test-expand-quote "testing..."))) (disassemble (lambda () (test-lambda "testing..."))) (disassemble (lambda () (test-expand-lambda "testing..."))) --- lisp/use-package/use-package.el | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lisp/use-package/use-package.el b/lisp/use-package/use-package.el index ed63bd05620..eb3c7030108 100644 --- a/lisp/use-package/use-package.el +++ b/lisp/use-package/use-package.el @@ -653,10 +653,9 @@ For full documentation. please see commentary. `(eval-after-load ,(if (stringp name) name `',name) `(,(lambda () (if ,requires-test - ,(macroexpand-all - `(with-elapsed-timer - ,(format "Configuring package %s" name-string) - ,config-body))))))) + (with-elapsed-timer + ,(format "Configuring package %s" name-string) + ,config-body)))))) t)) `(if (and ,(or predicate t) ,requires-test) -- 2.39.2