Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [RFC] Add xfail tests for || form of completion matchers



On Tue, Oct 12, 2021 at 8:26 AM Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
>
> Marlon Richert wrote on Tue, Oct 12, 2021 at 15:08:46 +0300:
> > On Mon, Oct 11, 2021 at 5:34 PM Marlon Richert <marlon.richert@xxxxxxxxx> wrote:
> >
> > I've now added an accompanying documentation update to the patch.
>
> Could you confirm that the text which the docs patch deletes or changes
> was all confirmed correct (even if perhaps unclear)?

For example, this part is misleading:

> > +By default, characters in the string to be completed (referred to here as the
> > +command line) map only onto identical characters in the list of matches
[...]
> > +missing characters are inserted only at the cursor position, if the shell
> > +option tt(COMPLETE_IN_WORD) is set, or at the end of the command line,

It's at the end of the current word, not the end of the command line.
The old wording nearly always says "string on the command line" which
is only somewhat better; if it's going to be completely rewritten to
drop "string on the", the phrase "command line" should become more
precise.  "Incomplete word" perhaps?

> > +) requires a var(match-spec) as it argument, consisting of one or more matching

"its"

> > +corresponding tests are applied to both characters, but they are not otherwise
> > +constrained; any matching character in one set goes with any matching character
> > +in the other set: this is equivalent to the behaviour of ordinary character
> > +classes.

What's an "ordinary" character class?  That is, what ordinary context
is implied?

> > +xitem(tt(l:)tt(|)var(lpat)tt(=)var(tpat))
> > +xitem(tt(L:)tt(|)var(lpat)tt(=)var(tpat))
> > +xitem(tt(r:)var(lpat)tt(|)tt(=)var(tpat))
> > +item(tt(R:)var(lpat)tt(|)tt(=)var(tpat))(
> > +Let any substring matching var(lpat) at the left (for tt(l:) and tt(L:)) or
> > +right (for tt(r:) and tt(R:)) edge of the command line be completed to any

Again, not the command line, just the current word under (or to the
left of) the cursor, but I'll stop mentioning this because it's a
problem with definition of terms.

> > +xitem(tt(l:)var(anchor)tt(|)var(lpat)tt(=)var(tpat))
> > +xitem(tt(L:)var(anchor)tt(|)var(lpat)tt(=)var(tpat))
> > +xitem(tt(r:)var(lpat)tt(|)var(anchor)tt(=)var(tpat))
> > +item(tt(R:)var(lpat)tt(|)var(anchor)tt(=)var(tpat))(
> > +Let any command line substring, which is left/right-adjacent (respectively) to
> > +a substring matching var(anchor) and which matches var(lpat), be completed to
> > +any trial completion substring, which
> > +startitemize()
> > +itemiz(\
> > +is adjacent to the same substring and which

Unclear whether "the same substring" refers to "any command line
substring" or to "a substring matching anchor".  I believe you mean
the former (or perhaps the larger substring composed of both of the
former)?  Best to specify.

I believe the rest of the explanations are correct, but it would be
good if Oliver confirms.

Did you remove the assorted other examples because there is a problem with them?




Messages sorted by: Reverse Date, Date, Thread, Author