Zsh Mailing List Archive
Messages sorted by:
- X-seq: zsh-users 19705
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: completion
- Date: Wed, 7 Jan 2015 12:42:41 -0800
- In-reply-to: <CAH+w=7ZLc_8dYPL7sy_ESuvnZ-ob69nBAXM4_UeZzSdn_NSisw@mail.gmail.com>
- List-help: <mailto:firstname.lastname@example.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:email@example.com>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <5488D414.firstname.lastname@example.org> <email@example.com> <5488F0AC.firstname.lastname@example.org> <141210214454.ZM12261@torch.brasslantern.com> <5489C8F4.email@example.com> <141211092824.ZM13349@torch.brasslantern.com> <5489F1BC.firstname.lastname@example.org> <20150107150109.GA14088@ypig.lip.ens-lyon.fr> <CAH+w=7YQ=VrWFjCXn4q7U48e3R+eNTF9xihHBf-oFDYTVR_zGQ@mail.gmail.com> <54AD8803.email@example.com> <CAH+w=7ZLc_8dYPL7sy_ESuvnZ-ob69nBAXM4_UeZzSdn_NSisw@mail.gmail.com>
On Jan 7, 2015 11:51 AM, "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx> wrote:
> The hardest part of the zstyle mechanism is grasping the "reverse pattern
match" lookup mechanism. Your hypothetical assassination example is
inaccurate because you're applying the patterns in the wrong "direction".
Here's possibly a way to think about this. Let's consider two applications
of patterns, globbing and zstyle.
Globbing starts with a search space full of very specific objects:
Individual file names. You provide a general description (the pattern) and
globbing looks up all the specific objects.
Zstyle starts with an *empty* search space and a whole lot of very specific
*searches* (at least one for every possible word-on-the-command-line you
might want to complete). These searches are called style contexts. You
populate the search space with general descriptions of the style contexts
you care about, and zstyle looks up the single general description that
best fits a specific search.
This is why there are wildcards in the commands that set styles. There are
no wildcards in the commands that test or look up styles.
"Show me the dogs in this park that are on a leash." You search the park
for dogs, there may be lots but it is an instantaneous finite number.
"All dogs in this park must be on a leash." You check every animal you see
entering the park to see if it is a dog and has a leash. You have no idea
how many animals or leashes you may eventually find, but if the current
animal is a dog, you know it has to have a leash to be allowed in the park.
Messages sorted by: