summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorTino Calancha <tino.calancha@gmail.com>2020-02-05 19:05:23 +0100
committerTino Calancha <tino.calancha@gmail.com>2020-02-05 19:05:23 +0100
commitebff24c0b8fa54854fe8445f2eba1d99fb76ecf2 (patch)
tree9516e728b939d8667b8c7e0caf68b716d73606d1 /lisp
parent0609dd481a3f6d0dfa598666d8068fa7e8c9d2f2 (diff)
downloademacs-ebff24c0b8fa54854fe8445f2eba1d99fb76ecf2.tar.gz
emacs-ebff24c0b8fa54854fe8445f2eba1d99fb76ecf2.tar.bz2
emacs-ebff24c0b8fa54854fe8445f2eba1d99fb76ecf2.zip
Eval macro arg just once
* lisp/emacs-lisp/cl-macs.el (cl--push-clause-loop-body): Use `macroexp-let2' (Bug#39428).
Diffstat (limited to 'lisp')
-rw-r--r--lisp/emacs-lisp/cl-macs.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index 9d0fd15bc3d..4c2f58907de 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -1037,9 +1037,10 @@ For more details, see Info node `(cl)Loop Facility'.
(defmacro cl--push-clause-loop-body (clause)
"Apply CLAUSE to both `cl--loop-conditions' and `cl--loop-body'."
- `(progn
- (push ,clause cl--loop-conditions)
- (push ,clause cl--loop-body)))
+ (macroexp-let2 nil sym clause
+ `(progn
+ (push ,sym cl--loop-conditions)
+ (push ,sym cl--loop-body))))
;; Below is a complete spec for cl-loop, in several parts that correspond
;; to the syntax given in CLtL2. The specs do more than specify where