From: Sven Wischnowsky <wischnow@berkom.de>
To: zsh-workers@sunsite.dk
Subject: Re: Redirection completion
Date: Mon, 11 Mar 2002 12:16:17 +0100 [thread overview]
Message-ID: <15500.37377.808155.293654@wischnow.berkom.de> (raw)
In-Reply-To: <3922.1015844089@csr.com>
Peter Stephenson wrote:
> Sven Wischnowsky wrote:
> > So, I wrote the patch below. Removing the -T stuff and consistently
> > using names like `-value-foo' or `-redirect-echo-2>' everywhere, both
> > for the context used for styles and for compdef/#compdef (that's why
> > we don't need separated sets of completion functions anymore).
>
> This makes a lot of sense.
Good.
> I haven't quite understood how this system
> handles the difference between `-redirect-2>' and `-redirect-echo-2>'.
> Suppose I defined a redirection for the former, will I still get a
> context including `-redirect-echo-2>'? And is that the same for a plain
> `-redirect-'? I would guess yes, since the context depends on what you
> are completing rather than what function is doing it (and patterns are a
> more natural part of styles than of compdef definitions).
The functions calling _dispatch give it a bunch of string that are to
be looked up in order until one with a defined function is found.
And, in this case, _redirect makes sure to give first `-redirect-echo-2>',
then `-redirect-2>'. So you can define a special version for echo and
another one for completion after `2>' everywhere else. _dispatch adds
to this the context `-default-' preceded by the prefix it was given,
so default redirection completion is defined by `-redirect--default-',
which is what is now in _files.
_redirect itself is still in charge of the context -redirect- itself.
> The only worry is that someone, somewhere will decide it's a great idea
> to have commands beginning with `-' for some special use. I don't see
> how we can guard against that in general, though. We can't make the
> current set of completion functions indendent of the choice of
> character. We may just as well stick with -. Maybe we could allow it
> to be escaped, like `:' (often) can be.
Hm, yes, although having to quote a hyphen looks weird. I would have
suggested usin `|' if that weren't a pattern matching character.
Safer would be `;' but that looks too much like a colon for my taste.
Maybe use a comma?
Bye
Sven
--
Sven Wischnowsky wischnow@berkom.de
next prev parent reply other threads:[~2002-03-11 11:17 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-03-08 12:33 Peter Stephenson
2002-03-08 12:54 ` Sven Wischnowsky
2002-03-08 14:06 ` Peter Stephenson
2002-03-08 14:10 ` Sven Wischnowsky
2002-03-11 8:42 ` Sven Wischnowsky
2002-03-11 9:58 ` Sven Wischnowsky
2002-03-11 10:54 ` Peter Stephenson
2002-03-11 11:16 ` Sven Wischnowsky [this message]
2002-03-11 11:29 ` Peter Stephenson
2002-03-11 12:08 ` Sven Wischnowsky
2002-03-11 14:01 ` Peter Stephenson
2002-03-11 16:56 ` Bart Schaefer
2002-03-12 9:03 ` Sven Wischnowsky
2002-03-12 13:16 ` Oliver Kiddle
2002-03-13 9:25 ` Sven Wischnowsky
2002-03-13 16:55 ` Peter Stephenson
2002-03-14 12:03 ` Sven Wischnowsky
2002-03-13 17:58 ` Oliver Kiddle
2002-03-13 18:19 ` Bart Schaefer
2002-03-14 13:51 ` Oliver Kiddle
2002-03-14 14:41 ` Peter Stephenson
2002-03-14 14:43 ` Sven Wischnowsky
2002-03-08 13:20 ` Oliver Kiddle
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=15500.37377.808155.293654@wischnow.berkom.de \
--to=wischnow@berkom.de \
--cc=zsh-workers@sunsite.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).