From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6426 invoked by alias); 12 May 2011 16:59:45 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 29245 Received: (qmail 9358 invoked from network); 12 May 2011 16:59:34 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.212.43 as permitted sender) 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= MIME-Version: 1.0 Date: Thu, 12 May 2011 18:59:28 +0200 Message-ID: Subject: PATCH: Make _xset complete more helpfully From: Mikael Magnusson To: zsh-workers Content-Type: text/plain; charset=UTF-8 I've had this in my drafts folder for at least 3 years """ xset 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 doesn't complete mouse, but xset -b 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 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