emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r110600: Fix for Eshell's for loop.


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110600: Fix for Eshell's for loop.
Date: Sat, 20 Oct 2012 19:54:24 +0800
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110600
fixes bug: http://debbugs.gnu.org/12571
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Sat 2012-10-20 19:54:24 +0800
message:
  Fix for Eshell's for loop.
  
  * eshell/esh-cmd.el (eshell-rewrite-for-command): Copy the body
  list explicitly.
modified:
  lisp/ChangeLog
  lisp/eshell/esh-cmd.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-10-20 11:35:05 +0000
+++ b/lisp/ChangeLog    2012-10-20 11:54:24 +0000
@@ -1,3 +1,8 @@
+2012-10-20  Chong Yidong  <address@hidden>
+
+       * eshell/esh-cmd.el (eshell-rewrite-for-command): Copy the body
+       list explicitly (Bug#12571).
+
 2012-10-20  Arne Jørgensen  <address@hidden>
 
        * progmodes/flymake.el (flymake-create-temp-inplace): Use

=== modified file 'lisp/eshell/esh-cmd.el'
--- a/lisp/eshell/esh-cmd.el    2012-09-24 18:38:14 +0000
+++ b/lisp/eshell/esh-cmd.el    2012-10-20 11:54:24 +0000
@@ -484,20 +484,22 @@
       (let ((body (car (last terms))))
        (setcdr (last terms 2) nil)
        `(let ((for-items
-                (append
-                 ,@(mapcar
-                    (lambda (elem)
-                      (if (listp elem)
-                          elem
-                        `(list ,elem)))
-                    (cdr (cddr terms)))))
-               (eshell-command-body '(nil))
+               (copy-tree
+                (append
+                 ,@(mapcar
+                    (lambda (elem)
+                      (if (listp elem)
+                          elem
+                        `(list ,elem)))
+                    (cdr (cddr terms))))))
+              (eshell-command-body '(nil))
                (eshell-test-body '(nil)))
-           (while (consp for-items)
-             (let ((,(intern (cadr terms)) (car for-items)))
-               (eshell-protect
-                ,(eshell-invokify-arg body t)))
-             (setq for-items (cdr for-items)))
+          (while (car for-items)
+            (let ((,(intern (cadr terms)) (car for-items)))
+              (eshell-protect
+               ,(eshell-invokify-arg body t)))
+            (setcar for-items (cadr for-items))
+            (setcdr for-items (cddr for-items)))
            (eshell-close-handles
             eshell-last-command-status
             (list 'quote eshell-last-command-result))))))


reply via email to

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