GNU bug report logs - #36103
24.5; Blank spaces around parentheses in history expansion in shell mode

Previous Next

Package: emacs;

Reported by: Enric Rodríguez Carbonell <erodri <at> cs.upc.edu>

Date: Wed, 5 Jun 2019 14:42:01 UTC

Severity: normal

Merged with 1795, 5007, 8027

Found in versions 23.2, 24.5

Full log


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

From: Noam Postavsky <npostavs <at> gmail.com>
To: Enric Rodríguez Carbonell <erodri <at> cs.upc.edu>
Cc: 36103 <at> debbugs.gnu.org
Subject: Re: bug#36103: 24.5;
 Blank spaces around parentheses in history expansion in shell mode
Date: Wed, 05 Jun 2019 21:02:33 -0400
merge 36103 8027
quit

Enric Rodríguez Carbonell <erodri <at> cs.upc.edu> writes:

> $ for file in $(ls); do echo $file; done

> $ !for

> M-x comint-replace-by-expanded-history

> $ for file in $ ( ls ) ; do echo $file ; done
>
> The blank spaces around the parentheses should not be there.
> Because of these blank spaces, this command cannot be executed,
> as "$ (" should be "$(".

Yes, the problem is in comint-arguments which attempts to parse a shell
line into separate arguments, using just a bunch of regexps.  This is
doomed to failure I think.  But the alternative would be a full blown
shell parser, so I don't know how feasible it will be to fix this bug.
It's been with us a long time.





This bug report was last modified 1 year and 250 days ago.

Previous Next


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