GNU bug report logs - #15231
24.3.50; eshell: variable `name' treated different from other variables

Previous Next

Package: emacs;

Reported by: Gregor Zattler <telegraph <at> gmx.net>

Date: Sat, 31 Aug 2013 23:42:01 UTC

Severity: normal

Found in version 24.3.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 15231 in the body.
You can then email your comments to 15231 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#15231; Package emacs. (Sat, 31 Aug 2013 23:42:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Gregor Zattler <telegraph <at> gmx.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 31 Aug 2013 23:42:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Gregor Zattler <telegraph <at> gmx.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50;
 eshell: variable `name' treated different from other variables
Date: Sun, 01 Sep 2013 01:40:19 +0200
Dear Emacs developers,

eshell treats a variable named `name' different than a variable
named `foo' (or any(?) other name):

How to reproduce:

emacs -Q -nw -f eshell
#now type
for foo in * { echo "$foo" } 
# this lists the directory Emacs was started in
#now type
for name in * { echo "$name" } 
# this instead lists as many times 'name' as the above
# for statement listed objects in the directory.

E.g.:

~/src/emacs/doc $ for foo in * { echo "$foo" } 
Emacs/
lispintro/
lispref/
man/
misc/
~/src/emacs/doc $ for name in * { echo "$name" } 
name
name
name
name
name
~/src/emacs/doc $


This is the case  with 

GNU Emacs 24.3.50.1 (i486-pc-linux-gnu, X toolkit, Xaw scroll
bars) of 2013-08-31 on dex, modified by Debian

and with

GNU Emacs 23.4.1 (i486-pc-linux-gnu, X toolkit, Xaw3d scroll
bars) of 2013-07-01 on binet, modified by Debian


Is this a bug?

Thanks, Gregor
 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15231; Package emacs. (Tue, 03 Sep 2013 01:28:02 GMT) Full text and rfc822 format available.

Message #8 received at 15231 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Gregor Zattler <telegraph <at> gmx.net>
Cc: 15231 <at> debbugs.gnu.org
Subject: Re: bug#15231: 24.3.50;
 eshell: variable `name' treated different from other variables
Date: Mon, 02 Sep 2013 21:27:37 -0400
> Is this a bug?

Sounds like it, yes.  More specifically it sounds like changing Eshell
to use lexical-binding would fix this bug.


        Stefan "just reading his crystal ball"





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15231; Package emacs. (Thu, 12 Sep 2013 03:40:01 GMT) Full text and rfc822 format available.

Message #11 received at 15231 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Aidan Gauland <aidalgol <at> no8wireless.co.nz>
Cc: Gregor Zattler <telegraph <at> gmx.net>, 15231 <at> debbugs.gnu.org
Subject: Re: bug#15231: 24.3.50;
 eshell: variable `name' treated different from other variables
Date: Wed, 11 Sep 2013 23:39:33 -0400
>>> Is this a bug?
>> Sounds like it, yes.  More specifically it sounds like changing Eshell
>> to use lexical-binding would fix this bug.
> But why is this happening with just `name'?

I don't know the precise cause of the bug, but my crystal ball says that
the Eshell code that interprets your command itself uses a variable
named "name".  There are probably a few other variables names used by
Eshell that suffer from the same kind of "capture".


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15231; Package emacs. (Thu, 12 Sep 2013 04:51:02 GMT) Full text and rfc822 format available.

Message #14 received at 15231 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Aidan Gauland <aidalgol <at> no8wireless.co.nz>
Cc: Gregor Zattler <telegraph <at> gmx.net>, 15231 <at> debbugs.gnu.org
Subject: Re: bug#15231: 24.3.50;
 eshell: variable `name' treated different from other variables
Date: Thu, 12 Sep 2013 00:50:41 -0400
> I don't know the precise cause of the bug, but my crystal ball says that
> the Eshell code that interprets your command itself uses a variable
> named "name".  There are probably a few other variables names used by
> Eshell that suffer from the same kind of "capture".

I've just tried to convert Eshell to use lexical-binding and it appears
that this problem would indeed be fixed by such a change (if someone has
some kind of test suite for Eshell it would be very helpful, since
changing it to use lexical-binding is not completely trivial and might
introduce unexpected regressions).


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15231; Package emacs. (Thu, 12 Sep 2013 06:57:02 GMT) Full text and rfc822 format available.

Message #17 received at 15231 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Gregor Zattler <telegraph <at> gmx.net>,
 Aidan Gauland <aidalgol <at> no8wireless.co.nz>, 15231 <at> debbugs.gnu.org
Subject: Re: bug#15231: 24.3.50;
 eshell: variable `name' treated different from other variables
Date: Thu, 12 Sep 2013 08:56:25 +0200
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

> I've just tried to convert Eshell to use lexical-binding and it appears
> that this problem would indeed be fixed by such a change (if someone has
> some kind of test suite for Eshell it would be very helpful, since
> changing it to use lexical-binding is not completely trivial and might
> introduce unexpected regressions).

There is test/eshell.el. Btw, shouldn't it be moved to test/automated/ ?

>         Stefan

Best regards, Michael.




Reply sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
You have taken responsibility. (Thu, 12 Sep 2013 20:17:02 GMT) Full text and rfc822 format available.

Notification sent to Gregor Zattler <telegraph <at> gmx.net>:
bug acknowledged by developer. (Thu, 12 Sep 2013 20:17:03 GMT) Full text and rfc822 format available.

Message #22 received at 15231-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 15231-done <at> debbugs.gnu.org, Gregor Zattler <telegraph <at> gmx.net>,
 Aidan Gauland <aidalgol <at> no8wireless.co.nz>
Subject: Re: bug#15231: 24.3.50;
 eshell: variable `name' treated different from other variables
Date: Thu, 12 Sep 2013 16:16:24 -0400
>> I've just tried to convert Eshell to use lexical-binding and it appears
>> that this problem would indeed be fixed by such a change (if someone has
>> some kind of test suite for Eshell it would be very helpful, since
>> changing it to use lexical-binding is not completely trivial and might
>> introduce unexpected regressions).
> There is test/eshell.el. Btw, shouldn't it be moved to test/automated/ ?

Cool, indeed.  I moved the file, added a test to catch this bug, and
changed Eshell to use lexical-binding.


        Stefan




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 11 Oct 2013 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 310 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.