mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-03 02:31:03 -08:00
Fix for Eshell's for loop.
* eshell/esh-cmd.el (eshell-rewrite-for-command): Copy the body list explicitly. Fixes: debbugs:12571
This commit is contained in:
parent
3503c79892
commit
045ef72904
2 changed files with 20 additions and 13 deletions
|
|
@ -1,3 +1,8 @@
|
||||||
|
2012-10-20 Chong Yidong <cyd@gnu.org>
|
||||||
|
|
||||||
|
* eshell/esh-cmd.el (eshell-rewrite-for-command): Copy the body
|
||||||
|
list explicitly (Bug#12571).
|
||||||
|
|
||||||
2012-10-20 Arne Jørgensen <arne@arnested.dk>
|
2012-10-20 Arne Jørgensen <arne@arnested.dk>
|
||||||
|
|
||||||
* progmodes/flymake.el (flymake-create-temp-inplace): Use
|
* 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))))
|
(let ((body (car (last terms))))
|
||||||
(setcdr (last terms 2) nil)
|
(setcdr (last terms 2) nil)
|
||||||
`(let ((for-items
|
`(let ((for-items
|
||||||
(append
|
(copy-tree
|
||||||
,@(mapcar
|
(append
|
||||||
(lambda (elem)
|
,@(mapcar
|
||||||
(if (listp elem)
|
(lambda (elem)
|
||||||
elem
|
(if (listp elem)
|
||||||
`(list ,elem)))
|
elem
|
||||||
(cdr (cddr terms)))))
|
`(list ,elem)))
|
||||||
(eshell-command-body '(nil))
|
(cdr (cddr terms))))))
|
||||||
|
(eshell-command-body '(nil))
|
||||||
(eshell-test-body '(nil)))
|
(eshell-test-body '(nil)))
|
||||||
(while (consp for-items)
|
(while (car for-items)
|
||||||
(let ((,(intern (cadr terms)) (car for-items)))
|
(let ((,(intern (cadr terms)) (car for-items)))
|
||||||
(eshell-protect
|
(eshell-protect
|
||||||
,(eshell-invokify-arg body t)))
|
,(eshell-invokify-arg body t)))
|
||||||
(setq for-items (cdr for-items)))
|
(setcar for-items (cadr for-items))
|
||||||
|
(setcdr for-items (cddr for-items)))
|
||||||
(eshell-close-handles
|
(eshell-close-handles
|
||||||
eshell-last-command-status
|
eshell-last-command-status
|
||||||
(list 'quote eshell-last-command-result))))))
|
(list 'quote eshell-last-command-result))))))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue