Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Path with spaces in _canonical_paths
- X-seq: zsh-workers 51034
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Cc: Thomas Gläßle <thomas@xxxxxxxxxx>
- Subject: Re: Path with spaces in _canonical_paths
- Date: Wed, 23 Nov 2022 14:13:57 +0000
- Archived-at: <https://zsh.org/workers/51034>
- Feedback-id: i425e4195:Fastmail
- In-reply-to: <CAH+w=7a1_O7nBO4jUH2otCnjvcW+tJmzPHqm_Zw+CVJtM_PyJw@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <sympa.1668791373.628329.85325.773@zsh.org> <CAH+w=7ZBYX3-X2AD_iDR6T4Yz8OdA1TE+YeC2qZmHdk+W=VbgA@mail.gmail.com> <cd447ee7-d991-a4fd-c155-ca1b6bb96d72@coldfix.de> <CAH+w=7ZHODk-ZKPLvXiyd6s17uO+fnC-vgxnHvyGnnrqzr7vrQ@mail.gmail.com> <45820bd7-fab6-70f5-5abb-dc444f6f1075@coldfix.de> <CAH+w=7a1_O7nBO4jUH2otCnjvcW+tJmzPHqm_Zw+CVJtM_PyJw@mail.gmail.com>
Bart Schaefer wrote on Mon, Nov 21, 2022 at 13:32:41 -0800:
> On Mon, Nov 21, 2022 at 9:41 AM Thomas Gläßle <thomas@xxxxxxxxxx> wrote:
> >
> > + local -a tmp_buffer
> > + compadd -A tmp_buffer "$__gopts[@]" -a files
> > [...]
> > + matches+=( "${(@)tmp_buffer/$canpref/$origpref}" )
> > else
> > # ### Ideally, this codepath would do what the 'if' above does,
> > # ### but telling compadd to pretend the "word on the command line"
> > # ### is ${"the word on the command line"/$origpref/$canpref}.
> > - matches+=(${${(M)files:#$canpref*}/$canpref/$origpref})
> > + matches+=(${${(M)tmp_buffer:#$canpref*}/$canpref/$origpref})
> > fi
>
> I'm not confident that's the right fix for other examples, given the
> "Ideally" comment there. Daniel, you were the last editor of that
> section of _canonical_paths but the change appears to have been
> related to its use in _mount (where it is no longer used now).
The change in question is workers/39070 (= zsh-5.2-406-gaa041f7a5).
> Any comment?
Not really.
The log message and thread of that change describe what use-case that
change was fixing: namely, «umount /f/b<TAB>» → «umount /foo/bar».
The comment quoted above concerns how the candidate completions are
compared to the word on the command line. The comment says that,
instead of applying s/foo/bar/ to the word on the command line and
comparing the result against the raw candidate completions, the reverse
is done — s/bar/foo/ is applied to the candidate completions and that's
compared to the raw word on the command line — and implies that that's
not exactly equivalent to the former, and that the former would be
preferred over the latter.
Adding or removing -Q or {(@)} (or ${(b)}, cf. workers/39080) might well
be independent of that issue, though.
HTH.
Daniel
P.S. Feel free to Cc me directly when there's a question to me
specifically.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author