zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Mikael Magnusson <mikachu@gmail.com>
Cc: m0viefreak <m0viefreak.cm@googlemail.com>,
	Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: [PATCH] completion: matcher correspondence classes: fix offset
Date: Fri, 24 Dec 2021 11:58:45 -0800	[thread overview]
Message-ID: <CAH+w=7bVW_e5siv_oLu2SGqfSvypYFnAsTzNKpMo1toBBktVAg@mail.gmail.com> (raw)
In-Reply-To: <CAHYJk3RDwCZi1hfk0axb+0E5ySQ=brJYCW-CjFDMZhaaKDxniA@mail.gmail.com>

On Thu, Dec 23, 2021 at 12:25 PM Mikael Magnusson <mikachu@gmail.com> wrote:
>
> Were there ever any follwoups to this?

I don't recall seeing any.  Probably the only thing desirable beyond
that patch would be a regression test.

In the original message:
> > a) Why does "cfp_matcher_range" do nothing if more than
> >   one matcher spec is given?

It's not that it does nothing, it's that it never gets called by
cfp_matcher_pats() when there is a matcher-list style but not a
matcher style.  I haven't worked through exactly why THAT happens, but
it has to do with whether there's anything left over after the loop in
cfp_matcher_pats().  I have noticed that the "compadd -D" pass behaves
the same way regardless of the styles:  cfp_matcher_pats() loops
through the matcher spec and ends up with nothing left at the end, so
cfp_matcher_range() is not called.

> > b) Do we even need the "cfp_matcher_range" function
> >   at all? Seems like the later compadd -D works

Although _path_files is the only function that currently calls
compfiles -p, that doesn't mean no other function ever might ... so
what would happen if the compadd -D were never done?

> > c) Why does _path_files duplicate all matcher-list
> >   entries when calling "compfiles -p"?

It doesn't appear to duplicate matcher-list entries ... what it does
is build its own list of matchers from its -M option, the "expl" value
returned by _description, and the setting of nocaseglob, and then
appends that to the matcher-list passed down from _main_complete.
That may or may not duplicate parts of the matcher-list.  I suppose
_path_files could scan the $_matcher global to be sure it doesn't
append something that is already there ...?


  reply	other threads:[~2021-12-24 19:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-13 22:36 m0viefreak
2021-12-23 20:24 ` Mikael Magnusson
2021-12-24 19:58   ` Bart Schaefer [this message]
2021-12-24 21:17     ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH+w=7bVW_e5siv_oLu2SGqfSvypYFnAsTzNKpMo1toBBktVAg@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=m0viefreak.cm@googlemail.com \
    --cc=mikachu@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).