From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: _xwit
Date: Fri, 24 Mar 2000 13:54:30 +0100 (MET) [thread overview]
Message-ID: <200003241254.NAA26008@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Tanaka Akira's message of 24 Mar 2000 20:26:21 +0900
Tanaka Akira wrote:
> This is a completion function for xwit.
>
> I used _regex_arguments for parsing a command line since xwit has the
> option -keyrepeat which cannot be handled by _arguments. -keyrepeat
> takes variable length of arguments for it, but the last argument is
> featureless --- just a integer. So _arguments cannot detect end of
> the option.
Hm. If I parsed _xwit correctly (which I'm not sure about, because I
haven't really understood _regex_arguments yet):
_arguments '-keyrepeat:*[0-9]##:keycode: ' ...
What have I missed?
> ...
>
> +_wanted colormapids expl 'colormap id' || return 1
>
> +compadd "$expl[@]" "$@" "$desc[@]" - "${(@)list%% *}"
If the tag alias changes make it in, this would become what is shown
in the patch below.
> ...
>
> +_xwit_compopts () {
> + local expl
> + _description options expl option
> + compadd "$expl[@]" - ${(k)no[(R)*~0]} || compadd "$expl[@]" - ${(k)no}
The patch also shows one of the way to do this with tag aliases. Unless
we find a way to put that into _regex_arguments, that is. We would
need the descriptions and tags there then but it doesn't handle them,
right? Sigh.
Bye
Sven
diff -ru ../z.old/Completion/X/_x_colormapid Completion/X/_x_colormapid
--- ../z.old/Completion/X/_x_colormapid Fri Mar 24 13:46:31 2000
+++ Completion/X/_x_colormapid Fri Mar 24 13:48:33 2000
@@ -2,7 +2,7 @@
local expl list desc
-_wanted colormapids expl 'colormap id' || return 1
+_wanted colormapids || return 1
list=(${(f)"$(xprop -root -f RGB_COLOR_MAP 32xcccccccxx ': $0\n'|awk -F'[ ():]' '/^[a-zA-Z_]+\(RGB_COLOR_MAP\)/ {print $5, "--", $1}')"})
@@ -12,4 +12,4 @@
desc=()
fi
-compadd "$expl[@]" "$@" "$desc[@]" - "${(@)list%% *}"
+_loop colormapids expl 'colormap id' compadd "$@" "$desc[@]" - "${(@)list%% *}"
diff -ru ../z.old/Completion/X/_xwit Completion/X/_xwit
--- ../z.old/Completion/X/_xwit Fri Mar 24 13:46:31 2000
+++ Completion/X/_xwit Fri Mar 24 13:52:01 2000
@@ -16,8 +16,8 @@
_xwit_compopts () {
local expl
- _description options expl option
- compadd "$expl[@]" - ${(k)no[(R)*~0]} || compadd "$expl[@]" - ${(k)no}
+ _wanted options expl option compadd - ${(k)no[(R)*~0]} ||
+ _loop options expl option compadd - ${(k)no}
}
_regex_arguments _xwit_parse \
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
next reply other threads:[~2000-03-24 12:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-03-24 12:54 Sven Wischnowsky [this message]
2000-03-24 13:33 ` Tanaka Akira
2000-03-24 18:38 ` Tanaka Akira
-- strict thread matches above, loose matches on Subject: below --
2000-03-27 11:00 Sven Wischnowsky
2000-03-24 11:26 Tanaka Akira
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=200003241254.NAA26008@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).