[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#36103: 24.5; Blank spaces around parentheses in history expansion in
From: |
Noam Postavsky |
Subject: |
bug#36103: 24.5; Blank spaces around parentheses in history expansion in shell mode |
Date: |
Wed, 05 Jun 2019 21:02:33 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) |
merge 36103 8027
quit
Enric RodrÃguez Carbonell <erodri@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.