GNU bug report logs - #5007
23.1; comint history doesn't handle multi-character delimiters

Previous Next

Package: emacs;

Reported by: Mark Diekhans <markd <at> kermodei.com>

Date: Sat, 21 Nov 2009 17:30:03 UTC

Severity: normal

Merged with 1795, 8027, 36103

Found in versions 23.2, 24.5

Full log


Message #19 received at control <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 6 years and 9 days ago.

Previous Next


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