emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-24 r116999: * lisp/emacs-lisp/cl-macs.el (cl--loop-l


From: Stefan Monnier
Subject: [Emacs-diffs] emacs-24 r116999: * lisp/emacs-lisp/cl-macs.el (cl--loop-let): Avoid `nil' as var name.
Date: Mon, 21 Apr 2014 21:18:17 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 116999
revision-id: address@hidden
parent: address@hidden
committer: Stefan Monnier <address@hidden>
branch nick: emacs-24
timestamp: Mon 2014-04-21 17:18:12 -0400
message:
  * lisp/emacs-lisp/cl-macs.el (cl--loop-let): Avoid `nil' as var name.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/emacs-lisp/cl-macs.el     clmacs.el-20091113204419-o5vbwnq5f7feedwu-612
  test/automated/cl-lib.el       cllib.el-20130711160611-o23w1tyz0y13jq8e-1
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-04-21 21:04:25 +0000
+++ b/lisp/ChangeLog    2014-04-21 21:18:12 +0000
@@ -1,7 +1,11 @@
+2014-04-21  Stefan Monnier  <address@hidden>
+
+       * emacs-lisp/cl-macs.el (cl--loop-let): Avoid `nil' as var name.
+
 2014-04-21  Michael Albinus  <address@hidden>
 
-       * net/tramp-sh.el (tramp-sh-handle-file-name-all-completions): Set
-       "IFS=" when using read builtin, in order to preserve spaces in
+       * net/tramp-sh.el (tramp-sh-handle-file-name-all-completions):
+       Set "IFS=" when using read builtin, in order to preserve spaces in
        the file name.  Add test messages for hunting a bug on hydra.
        (tramp-get-ls-command): Undo using "-b" argument.  It doesn't help.
 

=== modified file 'lisp/emacs-lisp/cl-macs.el'
--- a/lisp/emacs-lisp/cl-macs.el        2014-03-24 20:41:08 +0000
+++ b/lisp/emacs-lisp/cl-macs.el        2014-04-21 21:18:12 +0000
@@ -1542,12 +1542,14 @@
               (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)

=== modified file 'test/automated/cl-lib.el'
--- a/test/automated/cl-lib.el  2014-03-23 06:00:18 +0000
+++ b/test/automated/cl-lib.el  2014-04-21 21:18:12 +0000
@@ -195,6 +195,9 @@
   (should (eql (cl-mismatch "Aa" "aA") 0))
   (should (eql (cl-mismatch '(a b c) '(a b d)) 2)))
 
+(ert-deftest cl-lib-test-loop ()
+  (should (eql (cl-loop with (a b c) = '(1 2 3) return (+ a b c)) 6)))
+
 (ert-deftest cl-lib-keyword-names-versus-values ()
   (should (equal
            (funcall (cl-function (lambda (&key a b) (list a b)))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]