zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: Make _xset complete more helpfully
@ 2011-05-12 16:59 Mikael Magnusson
  2011-05-12 17:14 ` Bart Schaefer
  0 siblings, 1 reply; 5+ messages in thread
From: Mikael Magnusson @ 2011-05-12 16:59 UTC (permalink / raw)
  To: zsh-workers

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-05-12 18:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-12 16:59 PATCH: Make _xset complete more helpfully Mikael Magnusson
2011-05-12 17:14 ` Bart Schaefer
2011-05-12 17:22   ` Bart Schaefer
2011-05-12 17:40     ` Mikael Magnusson
2011-05-12 18:29       ` Bart Schaefer

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).