Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: Make _xset complete more helpfully
- X-seq: zsh-workers 29245
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-workers <zsh-workers@xxxxxxx>
- Subject: PATCH: Make _xset complete more helpfully
- Date: Thu, 12 May 2011 18:59:28 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=eJbqlV49MVZPkU0NEAEjafSoKpGRo5yW/qsZNYYVwJU=; b=DATp9y/fbSdymTZGX1luz08YmHXbXQ6cOJqwCcC0Mh10Fzk/Z/+mA4aaXU+5nbaQfp lQT1OQwXX5B40YnOOGemQTwjmi7ywluxrJIE0NurBzbhgJ22ggYEbS2rP91cMiaP0Y1T z7WKnZ82uiBiu1Slyq9cyS7jTOwp6c8JBMju0=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=JvtgO+jie8nPpwMtoVyVj630Jp9ui+mFas3FFy3meiatFRzUxP3Wdm2SbpsRR3ZWyq RbdTAT+IZ/43ftzdDvQ3C0wNNT44Bay3R5eJidX53XAVDkL9yP1saK5ClSNLvmpec5FL Ca0Q39uoNLFChxpSmpSlrH0rEwKg0H3PXKUss=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
I've had this in my drafts folder for at least 3 years
"""
xset <tab> has absolutely zero effect, but if i type the first
argument it correctly completes some things i tried, others, not so
much. I'm happy if just the first argument thing is fixed though. It
seems to use _regex_arguments which I've never used before, so I'll
settle for mentioning it here and hoping for the best.
"""
Looking into it now, this seems to be the fix, but I'm not sure I
understand why. Is it simply wrong to give words not starting with a -
or + to _describe when you pass -o? Before the patch, even xset
mo<tab> doesn't complete mouse, but xset -b<tab> does complete xset
-bc. Not having either of -o or -O also works, but I feel like it
should be -O, probably. Because of the way xset treats options, things
that start with a - aren't really different from ones that don't.
I'm not exactly sure what I meant with some arguments not working,
maybe that things like xset dpms <tab> inserts force instead of also
saying you can type a number there. If you do start typing a number
and press tab it does say what the number is for though. I'm not going
to fiddle with that :).
--- a/Completion/X/Command/_xset
+++ b/Completion/X/Command/_xset
@@ -27,8 +27,8 @@ _xset_compopts () {
tmp=("$tmp[@]" "$opt")
fi
done
- _describe -o options tmp -- ||
- _describe -o options allopts --
+ _describe -O options tmp -- ||
+ _describe -O options allopts --
}
_xset_compfpadd () {
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author