From 577ef0bc58b5e8fd048bcc5bae8c34c4020fa2cc Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 5 Nov 2014 22:27:23 -0500 Subject: [PATCH] * lisp/subr.el (pop): Don't call the getter twice. Fixes: debbugs:18968 --- lisp/ChangeLog | 2 ++ lisp/subr.el | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 91a076e20e5..7dc4786aff5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2014-11-06 Stefan Monnier + * subr.el (pop): Don't call the getter twice (bug#18968). + * emacs-lisp/macroexp.el (macroexp--expand-all): Optimize away trivial uses of `funcall'. diff --git a/lisp/subr.el b/lisp/subr.el index 55ff739fec5..6ce02b79a0a 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -169,7 +169,8 @@ change the list." ;; So we can use `pop' in the bootstrap before `gv' can be used. (list 'prog1 place (list 'setq place (list 'cdr place))) (gv-letplace (getter setter) place - `(prog1 ,getter ,(funcall setter `(cdr ,getter))))))) + (macroexp-let2 macroexp-copyable-p x getter + `(prog1 ,x ,(funcall setter `(cdr ,x)))))))) (defmacro when (cond &rest body) "If COND yields non-nil, do BODY, else return nil. -- 2.39.5