Commit 045ef729 authored by Chong Yidong's avatar Chong Yidong

Fix for Eshell's for loop.

* eshell/esh-cmd.el (eshell-rewrite-for-command): Copy the body
list explicitly.

Fixes: debbugs:12571
parent 3503c798
2012-10-20 Chong Yidong <>
* eshell/esh-cmd.el (eshell-rewrite-for-command): Copy the body
list explicitly (Bug#12571).
2012-10-20 Arne Jørgensen <>
* progmodes/flymake.el (flymake-create-temp-inplace): Use
......@@ -484,20 +484,22 @@ implemented via rewriting, rather than as a function."
(let ((body (car (last terms))))
(setcdr (last terms 2) nil)
`(let ((for-items
(lambda (elem)
(if (listp elem)
`(list ,elem)))
(cdr (cddr terms)))))
(cdr (cddr terms))))))
(eshell-command-body '(nil))
(eshell-test-body '(nil)))
(while (consp for-items)
(while (car for-items)
(let ((,(intern (cadr terms)) (car for-items)))
,(eshell-invokify-arg body t)))
(setq for-items (cdr for-items)))
(setcar for-items (cadr for-items))
(setcdr for-items (cddr for-items)))
(list 'quote eshell-last-command-result))))))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment