zsh-users
 help / color / mirror / code / Atom feed
From: "Andrej Borsenkow" <Andrej.Borsenkow@mow.siemens.ru>
To: "Bart Schaefer" <schaefer@candle.brasslantern.com>,
	"E. Jay Berkenbilt" <ejb@ql.org>, <zsh-users@sunsite.auc.dk>
Subject: RE: completion with globbing, take 2
Date: Mon, 18 Sep 2000 10:07:29 +0400	[thread overview]
Message-ID: <000001c02136$b9c1f2a0$21c9ca95@mow.siemens.ru> (raw)
In-Reply-To: <1000917184320.ZM19505@candle.brasslantern.com>

>
> More precisely, you were told that Andrej does that.
>

First, I must apologize for wrong advice (you should not answer such questions
at 10pm :-( And I misunderstood the question anyway.

> Andrej probably wasn't expecting you to use it verbatim, though, because
> he didn't show you what his settings for the matcher-list style are.  You
> didn't say whether you have any settings for matcher-list; if you don't,
> the _match completer won't do anything.
>

No, wrong. _match has absolutely nothing to do with matcher-list style (that
was introduced only recently). _match was first "alternative" for
GLOB_COMPLETE option. It tries to match the list of possible completions
against pattern on command line. This works for _every_ completion (while
GLOB_COMPLETE worked only for files). But _match never tries to *expand* the
pattern - that is what _expand is for.

matcher-list is used to set global "matchers" - e.g. to do case-insensitive or
partial-word completion, like completing c-w to complete-word :-)) or g_c to
G_c to globcomplete.

> } I want behavior more like what expand-or-complete does except that I
> } want only what the completion system would return to be substituted.
>

Thinking about it, I believe, that _match would be the correct completer to do
it. There are many cases where we simply cannot do expansion at all - option
names, widget names etc etc etc. So, consider something like

setopt *complete*TAB

WIth _match this enters menu completion - but _expand_word (I tried it) gives
you nothing. So, there seems to be no way to just insert all matching choices.
While _expand (and friends) may be useful at times, _match just seems to be
more powerful. (Of course, another general solution is to have widget that
would insert all listed choices at once. Was not it discussed once?)


> That's what the _expand completer is for.  I believe you want:
>
> zstyle ':completion:*' completer _oldlist _expand _complete _match
> zstyle ':completion::expand:*' completions true
>

Actually, no. It works in this case only because file completion itself is
using globbing - that is, the set of possible matches is determined by pattern
on command line. But the original wish was:

	the * gets replaced with all the choices that the completion system
	returns at that time (i.e., whatever glob pattern I've typed should be
	applied to the completion choices rather than to files)?

It is exactly what _match does ... without giving you the way to insert all
choices.

> And maybe you don't even need the _match on the end, if you haven't
> worked out any matcher-list values yet.  The _match completer is for
> doing things like case-insensitive completion and completion of sub-
> parts of file names (e.g., completing on both sides of a ".").
>

No. See above the description of _match.

-andrej


  parent reply	other threads:[~2000-09-18  6:08 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-09-17 17:50 E. Jay Berkenbilt
2000-09-17 18:43 ` Bart Schaefer
2000-09-17 23:03   ` E. Jay Berkenbilt
2000-09-18  0:17     ` completion and globbing, part 2 E. Jay Berkenbilt
2000-09-18  6:53       ` Andrej Borsenkow
2000-09-18  9:59         ` insert-all-matches example " Andrej Borsenkow
2000-09-18 17:28           ` completion with globbing, take 2 Bart Schaefer
2000-09-18 18:08             ` Andrej Borsenkow
2000-09-19  2:02               ` Bart Schaefer
2000-09-20 15:06                 ` Andrej Borsenkow
2000-09-20 16:12                   ` Bart Schaefer
2000-09-18 22:07             ` E. Jay Berkenbilt
2000-09-19  2:14               ` Bart Schaefer
2001-02-20  9:55                 ` Job Table Nick Cross
2000-09-18  6:07   ` Andrej Borsenkow [this message]
2000-10-04 11:14 completion with globbing, take 2 Sven Wischnowsky

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='000001c02136$b9c1f2a0$21c9ca95@mow.siemens.ru' \
    --to=andrej.borsenkow@mow.siemens.ru \
    --cc=ejb@ql.org \
    --cc=schaefer@candle.brasslantern.com \
    --cc=zsh-users@sunsite.auc.dk \
    /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).