summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2014-04-22 14:32:51 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2014-04-22 14:32:51 -0700
commit42e910349d699ee3f8024371ca1e60e015fc6aa7 (patch)
treeba589f3f7c278671f0ae9c5c8f15c241ae8dd674 /lisp/emacs-lisp
parent4f96579371290b201a973072a1c2f237755bb954 (diff)
parent34e856d5ac828753b7be20e2471f39fb613f7f40 (diff)
downloademacs-42e910349d699ee3f8024371ca1e60e015fc6aa7.tar.gz
emacs-42e910349d699ee3f8024371ca1e60e015fc6aa7.tar.bz2
emacs-42e910349d699ee3f8024371ca1e60e015fc6aa7.zip
Merge from emacs-24; up to 2014-04-22T20:19:17Z!eggert@cs.ucla.edu
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/cl-macs.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index fe064b81e31..c9f5f68a4d3 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -1548,12 +1548,13 @@ If BODY is `setq', then use SPECS for assignments rather than for bindings."
(if (and (cl--unused-var-p temp) (null expr))
nil ;; Don't bother declaring/setting `temp' since it won't
;; be used when `expr' is nil, anyway.
- (when (cl--unused-var-p temp)
+ (when (or (null temp) (cl--unused-var-p temp))
;; Prefer a fresh uninterned symbol over "_to", to avoid
;; warnings that we set an unused variable.
(setq temp (make-symbol "--cl-var--"))
;; Make sure this temp variable is locally declared.
- (push (list (list temp)) cl--loop-bindings))
+ (when (eq body 'setq)
+ (push (list (list temp)) cl--loop-bindings)))
(push (list temp expr) new))
(while (consp spec)
(push (list (pop spec)