Zsh Mailing List Archive
Messages sorted by:
- X-seq: zsh-users 19714
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: completion
- Date: Thu, 08 Jan 2015 00:31:24 -0800
- In-reply-to: <54ADBAA5.firstname.lastname@example.org>
- List-help: <mailto:email@example.com>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:firstname.lastname@example.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <5488D414.email@example.com> <firstname.lastname@example.org> <5488F0AC.email@example.com> <141210214454.ZM12261@torch.brasslantern.com> <5489C8F4.firstname.lastname@example.org> <141211092824.ZM13349@torch.brasslantern.com> <5489F1BC.email@example.com> <20150107150109.GA14088@ypig.lip.ens-lyon.fr> <CAH+w=7YQ=VrWFjCXn4q7U48e3R+eNTF9xihHBf-oFDYTVR_zGQ@mail.gmail.com> <54AD8803.firstname.lastname@example.org> <CAH+w=7ZLc_8dYPL7sy_ESuvnZ-ob69nBAXM4_UeZzSdn_NSisw@mail.gmail.com> <CAH+w=7b9i6NdD3=5SJpiaHP5HsObAoNRYFJrvxV88Sf5DFCypg@mail.gmail.com> <54ADBAA5.email@example.com>
On Jan 7, 3:00pm, Ray Andrews wrote:
} To put it in English, what I'm reaching for (I think), sounds something
} like this:
} If [something-on-command-line] matches [this-pattern] (a filter), then
} expand that pattern using [this-particular-set-of-rules], and then
} search (go find) in [this-particular-group-of-objects] for
} [this-particular-glob-pattern] and put that on my command line.
Incidentally, no, it's not like that at all. In fact its so far from
that, that I can't even reword the above to give a better sense of it.
Completion involves several layers of loops-within-loops, it can't be
described in a single if-then sentence.
If you ignore a lot of the looping parts and the listing of ambiguous
matches, then it's sort of like:
Choose a completer and pass it some information about the command line,
from which it will construct a context which summarizes the meaning of
the command line in about six words. For each/any configuration option
that may be useful, use the context to find the best definition among
the set of zstyle patterns the user has defined. Some of those options
(called styles) should explain where to look for [this-particular-group-
of-strings], otherwise use a fallback to find them. Compare whatever
strings you end up with to the word to the left of or under the cursor
and put the longest unambiguous common substring that matches on the
command line, assuming the other styles said that's what you should do.
If there aren't any matches at all, try again with the next completer
until something is found or there are no more completers.
Messages sorted by: