From: Alexandre Duret-Lutz <duret_g@epita.fr>
To: zsh-workers@math.gatech.edu
Cc: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
Subject: Re: PATCH: _diff (new), _prcs (upgrade)
Date: 28 Jan 2000 17:24:14 +0100 [thread overview]
Message-ID: <mvb901aw4ep.fsf@phobos.lrde.epita.fr> (raw)
In-Reply-To: Sven Wischnowsky's message of "Fri, 28 Jan 2000 16:11:19 +0100 (MET)"
>>> "Sven" == Sven Wischnowsky <wischnow@informatik.hu-berlin.de> writes:
Sven> Alexandre Duret-Lutz wrote:
[...]
Sven> The only problem is that this means that such options will always be
Sven> combined with the ones a user might define in a style. I.e. there are
Sven> actually two types of options a completion function might give to a
Sven> command: those that *have* to be there to make it work in the way the
Sven> function needs it (like the -v for diff) and those the completion
Sven> functions *suggests* to use -- which may be overridden by a user's
Sven> style. Ideally, we should support both cases...
Yes, I was speaking of what you call *suggested* options. As for now, to
set these options, we should set a default style in compinit or elsewhere.
But since these *suggested* options must be quite uncommon, this is not a
problem. ok.
[...]
>> and if a rule is chosen, _call can apply it
[...]
Sven> I suggested that to enable completion functions to make it as you
Sven> described in 9453: if we are completing for the command, call it
Sven> without a `command', otherwise with it. And that can't be decided in
Sven> _call.
I must be missing something. Can't $curcontext be used?
I am thinking about something like this:
#
_call () {
if [[ $curcontext == *:$1: ]]
then
$1 #(A)
else
command $1 #(B)
fi
}
_f() {
_call foo
}
compdef _f foo bar
seems to run either (A) or (B) wheter I complete after foo or bar.
--
Alexandre Duret-Lutz
next prev parent reply other threads:[~2000-01-28 16:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-01-28 15:11 Sven Wischnowsky
2000-01-28 16:24 ` Alexandre Duret-Lutz [this message]
-- strict thread matches above, loose matches on Subject: below --
2000-01-31 9:09 Sven Wischnowsky
2000-01-28 10:25 Sven Wischnowsky
2000-01-28 15:04 ` Alexandre Duret-Lutz
2000-01-28 8:26 Sven Wischnowsky
2000-01-28 9:49 ` Alexandre Duret-Lutz
2000-01-27 16:08 Sven Wischnowsky
2000-01-27 17:21 ` Alexandre Duret-Lutz
2000-01-29 8:49 ` Alexandre Duret-Lutz
2000-01-27 14:52 Alexandre Duret-Lutz
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=mvb901aw4ep.fsf@phobos.lrde.epita.fr \
--to=duret_g@epita.fr \
--cc=wischnow@informatik.hu-berlin.de \
--cc=zsh-workers@math.gatech.edu \
/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).