bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: About `M-C-e` expand result `'` failed


From: Chet Ramey
Subject: Re: About `M-C-e` expand result `'` failed
Date: Tue, 6 Feb 2024 11:22:56 -0500
User-agent: Mozilla Thunderbird

On 2/3/24 7:44 AM, Martin D Kealey wrote:
On Wed, 31 Jan 2024 at 01:04, Andreas Schwab <schwab@suse.de> wrote:

On Jan 30 2024, Zachary Santer wrote:
There's no way this is the intended behavior, right?

The command is doing exactly what it is documented to do, that is do all
of the shell word expansions.


If that's how the documentation is interpreted, then clearly there's a bug
in the documentation, because this is almost never *useful* behaviour.

It actually says:

shell-expand-line (M-C-e) ... This performs alias and history expansion
as well as all of the shell word expansions.

It does *not* say that it does quote removal.

So your position is that quote removal is not one of the shell word
expansions?

It could be argued that quote removal is implicitly required for some of
the steps to proceed, but in that case it can equally be argued that such
removal must therefore be reversed afterwards.

If you want to undo the word expansions, use the readline undo command
(C-_ in emacs mode). You'll get an idea of what the shell will do with
the command, and your command as you entered it will be restored.


By all means, add a "strip-quotes" command to readline, so the user can use
in the exceptional cases where you want to diverge from what the shell
would have done without M-C-e,

The result is exactly what the shell would have done when it expanded the
command.


but by default any expansion or substitution
that's triggered by a readline command should render a result that's immune
to that same expansion being done again when the user hits enter.

By all means, advocate for a quote-words readline command.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]