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: Mike Jonkmans
Subject: Re: About `M-C-e` expand result `'` failed
Date: Thu, 1 Feb 2024 00:05:41 +0100

On Wed, Jan 31, 2024 at 04:25:18PM -0500, Chet Ramey wrote:
> On 1/30/24 10:59 AM, Zachary Santer wrote:
> > On Tue, Jan 30, 2024 at 10:04 AM Andreas Schwab <schwab@suse.de> wrote:
> > 
> > > The command is doing exactly what it is documented to do, that is do all
> > > of the shell word expansions.
> > 
> > Quote Removal shows up as a subsection of the Shell Expansion section in
> > the manual, but it doesn't show up in the list of expansions at the
> > beginning of that section.[1] Additionally, we see the following:
> > > After these expansions are performed, quote characters present in the
> > original word are removed unless they have been quoted themselves (quote
> > removal).
> 
> Quote removal is part of the shell word expansion process. POSIX lists it
> as one of the word expansions, and it is.

The first sentence under EXPANSION may make you think otherwise:
  Expansion is performed on the command line after it has been split into words.
  There are seven kinds of expansion performed: brace expansion,
  tilde expansion, parameter and variable expansion, command substitution,
  arithmetic expansion, word splitting, and pathname expansion.

The third sentence, after this, corrects this:
  After these expansions are performed, quote characters present in the original
  word are removed unless they have been quoted themselves (quote removal).

That sentence could also be placed right after the first.


Returning to `shell-expand-line'.
As end user I would expect that, running shell-expand-line then accept-line,
would do the same as just an accept-line.

Quote removal is absolutely needed, otherwise expansions may mess up
the result when they introduce quotes.

I think that escaping is needed after quote removal in shell-expand-line.

-- 
Regards, Mike Jonkmans



reply via email to

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