From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: Silly questions about _arguments & Co (and probably bugs)
Date: Mon, 13 Sep 1999 13:56:58 +0200 (MET DST) [thread overview]
Message-ID: <199909131156.NAA21019@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Tanaka Akira's message of 10 Sep 1999 00:44:34 +0900
Tanaka Akira wrote:
> I think `compconf option_prefix=all' is useful.
(Btw, the value of option_prefix isn't used any more -- only whether
it's empty or not.)
> And, I found another problem. `patch -f<TAB>' does not show list of
> completion candidates. However completion itself works well.
>
> ...
>
> So, I think this is the problem of `_display'.
Almost. There were two problems: with single-letter options
PREFIX/SUFFIX weren't cleared before `_display' was called (so that
(almost) no option matched) and the return value of `_display' wasn't
used to find out that `_arguments' should create the list itself.
Bye
Sven
diff -u -r oldcompletion/Base/_arguments Completion/Base/_arguments
--- oldcompletion/Base/_arguments Mon Sep 13 13:13:10 1999
+++ Completion/Base/_arguments Mon Sep 13 13:51:43 1999
@@ -822,12 +822,17 @@
if [[ -n "$sopts" && -n "$PREFIX" &&
"$PREFIX" = [-+]${~soptseq}[$sopts] ]]; then
if [[ "$PREFIX" = [-+]${~soptseq1} ]]; then
- if [[ -n "$compconfig[describe_options]" &&
- "$compconfig[describe_options]" != *\!${cmd}* ]]; then
- _display tmp odescr
- else
- tmp="( ${(j: :)${(@)${(@M)${=:-${(k)opts} ${(k)dopts} ${(k)odopts}}:#[-+]?(|=)}#?}%=} )"
+ local dpre="$PREFIX" dsuf="$SUFFIX"
+
+ PREFIX=''
+ SUFFIX=''
+ if [[ -z "$compconfig[describe_options]" ||
+ "$compconfig[describe_options]" = *\!${cmd}* ]] ||
+ ! _display tmp odescr; then
+ tmp=( "${dpre[1]}${(@o)^${(@)${(@M)${=:-${(k)opts} ${(k)dopts} ${(k)odopts}}:#[-+]?(|=)}#?}%=}" )
fi
+ PREFIX="$dpre"
+ SUFFIX="$dsuf"
compadd "$expl[@]" -Q -M 'r:|[_-]=* r:|=*' -y tmp - \
"${PREFIX}${(@k)^opts[(I)${PREFIX[1]}?]#?}" \
"${PREFIX}${(@k)^dopts[(I)${PREFIX[1]}?]#?}" \
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
next reply other threads:[~1999-09-13 11:57 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-09-13 11:56 Sven Wischnowsky [this message]
1999-09-13 13:57 ` Tanaka Akira
-- strict thread matches above, loose matches on Subject: below --
1999-09-13 14:21 Sven Wischnowsky
1999-09-09 14:27 Sven Wischnowsky
1999-09-09 22:01 ` Tanaka Akira
1999-09-09 13:55 Sven Wischnowsky
1999-09-09 14:05 ` Andrej Borsenkow
1999-09-09 15:15 ` Andrej Borsenkow
1999-09-09 15:44 ` Tanaka Akira
1999-09-09 13:13 Andrej Borsenkow
1999-09-09 13:54 ` Tanaka Akira
1999-09-09 14:26 ` Andrej Borsenkow
1999-09-09 14:32 ` Tanaka Akira
1999-09-09 14:34 ` Andrej Borsenkow
1999-09-09 14:45 ` Tanaka Akira
1999-09-09 15:02 ` Andrej Borsenkow
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=199909131156.NAA21019@beta.informatik.hu-berlin.de \
--to=wischnow@informatik.hu-berlin.de \
--cc=zsh-workers@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).