From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: Danek Duvall <duvall@emufarm.org>
Cc: zsh-users@sunsite.dk
Subject: Re: Completion function for bitkeeper?
Date: Wed, 19 Nov 2003 11:23:26 +0100 [thread overview]
Message-ID: <29608.1069237406@gmcs3.local> (raw)
In-Reply-To: <20031117175151.GA24060@lorien.emufarm.org>
Danek Duvall wrote:
> As it is, even with zparseopts (which I hadn't known about, so thank you
> for that), there's no way at all to tell whether a -e that's passed to
> my helper function is there because I passed it in explicitly through an
> argument to _arguments, or whether it's part of the set of arguments
> that's destined only for compadd. There's simply no way for me to know.
-e will only ever be there if you passed it explicitly. Though -e is an
option to compadd, it really wouldn't make sense to pass it to a
completion function. So you're safe with -e. Admittedly you would
not be safe had you chosen -x.
> So then the onus is on me to pick a flag that compadd doesn't already
> use. It uses seventeen uppercase letters, thirteen lowercase letters,
> and two numbers, and that's a pretty severe depletion of the usable
> namespace of flags. But assuming I choose one (and it's even remotely
A good few are safe to use: -a, -k, -f, -e, -W and -U are all safe. I'm
not sure about some such as -l, -Q, -C and -E without looking in more
detail. That perhaps should be documented somewhere.
> mnemonic), then there's no guarantee that a future release doesn't add a
> new flag to compadd, and bites me in the ass!
No there isn't but no compadd options have been added in a long while.
We can do a search on distributed functions if we do ever add one.
> So while I understand your explanation, my question of how to do this
> right is still going unanswered.
I think I've now explained how best to do this given the constraints of
the completion system as it currently stands.
I agree that it isn't ideal. The best alternative I can think of would
be to pass compadd options to the various tag handling functions
instead of the completion functions. Tag loops need rethinking anyway
and that isn't a trivial job. Discussion of possible changes to compsys
should go to zsh-workers, though.
Oliver
prev parent reply other threads:[~2003-11-19 10:20 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-23 16:00 Steve Borho
2003-05-23 16:01 ` Danek Duvall
2003-11-06 15:32 ` Danek Duvall
2003-11-07 19:17 ` Oliver Kiddle
2003-11-10 18:20 ` Danek Duvall
2003-11-11 8:22 ` Oliver Kiddle
2003-11-11 10:42 ` Peter Stephenson
2003-11-11 15:21 ` Oliver Kiddle
2003-11-11 15:24 ` Peter Stephenson
2003-11-11 16:13 ` Oliver Kiddle
2003-11-11 16:23 ` Peter Stephenson
2003-11-11 16:44 ` Oliver Kiddle
2003-11-11 16:23 ` Danek Duvall
2003-11-11 19:06 ` Oliver Kiddle
2003-11-11 21:28 ` Danek Duvall
2003-11-14 8:04 ` Oliver Kiddle
2003-11-14 10:47 ` Peter Stephenson
2003-11-14 13:09 ` Oliver Kiddle
2003-11-14 16:12 ` Bart Schaefer
2003-11-14 16:23 ` Peter Stephenson
2003-11-14 17:14 ` Bart Schaefer
2003-11-14 17:01 ` Oliver Kiddle
2003-11-14 15:46 ` Danek Duvall
2003-11-14 21:24 ` Danek Duvall
2003-11-17 15:47 ` Oliver Kiddle
2003-11-17 17:51 ` Danek Duvall
2003-11-19 10:23 ` Oliver Kiddle [this message]
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=29608.1069237406@gmcs3.local \
--to=okiddle@yahoo.co.uk \
--cc=duvall@emufarm.org \
--cc=zsh-users@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).