From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3987 invoked by alias); 6 Sep 2017 12:31:52 -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: 41645 Received: (qmail 5712 invoked by uid 1010); 6 Sep 2017 12:31:52 -0000 X-Qmail-Scanner-Diagnostics: from nm13-vm3.bullet.mail.ir2.yahoo.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(212.82.96.182):SA:0(-4.7/5.0):. Processed in 5.912157 secs); 06 Sep 2017 12:31:52 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,T_DKIM_INVALID,T_SPF_TEMPERROR autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: okiddle@yahoo.co.uk X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1504700764; bh=dRXGCHNGQzfwBDcULxirIghIQPBJXBv2V+N6gZLJyts=; h=In-reply-to:From:References:To:Subject:Date:From:Subject; b=tcAMEExS2Z0qK1i4pew1BiCKOywYPj7+vRVCKyhy6j5k1U+mLtgMCZukWHiwIpLkteVXrp7iQJgQkvy3IxEnp34qQ9GGcd7m90udqqQIertlwwOVdUHZr6/44pbSRiuhead4MwpCgHmwPArrSMYn9s+QeXJ3VArgdmBNBPuorK2OvzdBvPuu9hNunKQjrTUuslsYkioZVxKL6fy4JCnbThu/tBWEQqgFKuq2lkvo7g9BB6p7JTPtWDRE9TGDmFQ0FKQ6m1s4v+g/22NVsiFdJ1f8timkG7NDFhqMksG127Oq6RByjAPOeJ4Mmm20mINQuV2OdtciPAcpb/5B7JjeTA== X-Yahoo-Newman-Id: 711964.26107.bm@smtp133.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: PL1Y5wAVM1nbhoWEr1i59XzTBtwadT_Gfu1X0weFu921c_X wxi0xNjoN4g_PlxIUiwsx4Y2JXS2RSaitkuzy4Y7YrJ.HsxaHCzdK4_oA.sJ rheIdSDK_wQEcTMfaY4TlitksWTrsQYPmxFAiiDf2qNnSTZlFr5Ur6jLEQoL WUbIbqpPrtD_ZYxxTtiWCvYgdNz.a6cq6QmNZFvMd5gCOXyP1IzpYXTFzB.V 5EV1wWtPQ.tJDo00FcQS5eZvuFL0GwOczC6PENUoz2TVrk_VhFJ8aOiNZHlp c334hPcpTncsRSQKMplbu9hbqnGdTNiSjpGn_wqFUKe5n9ecIUs.VQ0qGEQf oR_fWPCOpBSZxCrCk.gB9k75FyelHkMWPZBxghLCH6eoR3SXKnhn6JLt9raP 5McCSbCb5cBSz9KptzG7V5si88aGWxp3avyBHuR9WRM2tQByoEki2R2fUO71 ZR5kCTp.yktLG6Mugso.rG.jP9MdSr1IkHZa2eYPZLaCNBA-- X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- In-reply-to: <68D6FE10-4636-4582-AC2A-1FB0852EAC28@kba.biglobe.ne.jp> From: Oliver Kiddle References: <68D6FE10-4636-4582-AC2A-1FB0852EAC28@kba.biglobe.ne.jp> To: zsh-workers@zsh.org Subject: Re: [PATCH] update _ps (with question) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <20454.1504700763.1@thecus.kiddle.eu> Date: Wed, 06 Sep 2017 14:26:03 +0200 Message-ID: <20455.1504700763@thecus.kiddle.eu> On 2 Sep, "Jun T." wrote: > > if [[ -z $pids ]]; then > _pids && compstate[insert]= > fi > > Why compstate[insert] need be reset here? If it is reset, then > nothing is completed by 'ps ...' You can remove it. It is reset because _pids sets it (depending on insert-ids) to menu and we've got BSD options mixed in so _pids setting it is not as appropriate. I've just experimented with it a bit and it's a bit tricky. _pids doesn't really have wider knowledge of what other matches there might be (aside from $compstate[nmatches]) so it is hard to have it adapt to that. 'ps ' gets me menu selection. What do you have insert-ids, menu and tag-order set to for this context? Following patch is a totally unrelated minor tweak for ps completion on Solaris. Oliver --- Completion/Unix/Command/_ps 2017-09-06 11:48:08.927796173 +0200 +++ Completion/Unix/Command/_ps 2017-09-06 11:49:04.773755213 +0200 @@ -226,8 +226,9 @@ if [[ $OSTYPE = (*bsd*|darwin*|dragonfly*) ]]; then compset -P - && pids=1 else - _arguments -C -s $args '*:: :->rest' && ret=0 - [[ -z "$state" || $OSTYPE = solaris* ]] && return ret + [[ $OSTYPE = solaris* ]] || args+=( '*:: :->rest' ) + _arguments -C -s $args && ret=0 + [[ -z "$state" ]] && return ret fi _values -s '' -S ' ' 'options' $bsd && ret=0