aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2014-11-05 22:27:23 -0500
committerStefan Monnier2014-11-05 22:27:23 -0500
commit577ef0bc58b5e8fd048bcc5bae8c34c4020fa2cc (patch)
tree597810e6269cae2f2de3f052626253daf03bb851
parent4d5468e5296ce42793a86808c62af8f99f556cba (diff)
downloademacs-577ef0bc58b5e8fd048bcc5bae8c34c4020fa2cc.tar.gz
emacs-577ef0bc58b5e8fd048bcc5bae8c34c4020fa2cc.zip
* lisp/subr.el (pop): Don't call the getter twice.
Fixes: debbugs:18968
-rw-r--r--lisp/ChangeLog2
-rw-r--r--lisp/subr.el3
2 files changed, 4 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 91a076e20e5..7dc4786aff5 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,7 @@
12014-11-06 Stefan Monnier <monnier@iro.umontreal.ca> 12014-11-06 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * subr.el (pop): Don't call the getter twice (bug#18968).
4
3 * emacs-lisp/macroexp.el (macroexp--expand-all): Optimize away trivial 5 * emacs-lisp/macroexp.el (macroexp--expand-all): Optimize away trivial
4 uses of `funcall'. 6 uses of `funcall'.
5 7
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."
169 ;; So we can use `pop' in the bootstrap before `gv' can be used. 169 ;; So we can use `pop' in the bootstrap before `gv' can be used.
170 (list 'prog1 place (list 'setq place (list 'cdr place))) 170 (list 'prog1 place (list 'setq place (list 'cdr place)))
171 (gv-letplace (getter setter) place 171 (gv-letplace (getter setter) place
172 `(prog1 ,getter ,(funcall setter `(cdr ,getter))))))) 172 (macroexp-let2 macroexp-copyable-p x getter
173 `(prog1 ,x ,(funcall setter `(cdr ,x))))))))
173 174
174(defmacro when (cond &rest body) 175(defmacro when (cond &rest body)
175 "If COND yields non-nil, do BODY, else return nil. 176 "If COND yields non-nil, do BODY, else return nil.