* lisp/emacs-lisp/cl-macs.el (cl--loop-let): Avoid `nil' as var name.
This commit is contained in:
parent
505fa2ab43
commit
622eef687c
3 changed files with 13 additions and 4 deletions
|
@ -1542,12 +1542,14 @@ 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 (and (eq body 'setq) (cl--unused-var-p temp))
|
||||
(when (or (null temp)
|
||||
(and (eq body 'setq) (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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue