From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11335 invoked by alias); 15 Sep 2016 04:49:41 -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: 39338 Received: (qmail 15353 invoked from network); 15 Sep 2016 04:49:41 -0000 X-Qmail-Scanner-Diagnostics: from out4-smtp.messagingengine.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(66.111.4.28):SA:0(0.0/5.0):. Processed in 0.338845 secs); 15 Sep 2016 04:49:41 -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=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at daniel.shahaf.name does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=8QCMGK9OGhSr2bkN d2Y23gcA3/Y=; b=3GCcdniXKKmuoPKoZ/IikJHobaV9QtctAgFbyK3itnUJJnsL hOSnkUttNHbW4u1WKQ+/ncjxXc2o4qBbHmZbaN+yJ8Spn6tteDOjFf7jj47jt8Cm tM6IZ1+hTlqVe4i3MVvgW00zTjgjFzGMVPyxT4Qq8YVBbxVqJzq6S4rsUAY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=8QCMGK9OGhSr2bk Nd2Y23gcA3/Y=; b=draNX0CNn4HL2+otGVgPRTLTnon9Dtv8emzYdRjfxU1hfuV MCrQdpIKPkWO4tQRs9psA1NjAYgHVA+8vyrqw3+/6Lk5aBrEENlP1YytzmX3Qrla Xy/aPyXs4X6bj0htIa7f1cCNVs+d8qtdLFjCcR4+FnodDBe+T1f0iyzYGzSQ= X-Sasl-enc: BvwWMhwCwc+/ou0Sa+YNef4Lk+geoSLOCXXruHDudZLW 1473914976 Date: Thu, 15 Sep 2016 04:48:55 +0000 From: Daniel Shahaf To: zsh-workers@zsh.org Subject: Re: [PATCH] _postfix (postconf): Complete only applicable parameters for -X and -#. Message-ID: <20160915044855.GA22306@fujitsu.shahaf.local2> References: <1473830073-331-1-git-send-email-danielsh@fujitsu.shahaf.local2> <160914094658.ZM29734@torch.brasslantern.com> <20160915021503.GA15486@fujitsu.shahaf.local2> <160914203506.ZM32505@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <160914203506.ZM32505@torch.brasslantern.com> User-Agent: Mutt/1.5.23 (2014-03-12) Bart Schaefer wrote on Wed, Sep 14, 2016 at 20:35:06 -0700: > On Sep 15, 2:15am, Daniel Shahaf wrote: > } Subject: Re: [PATCH] _postfix (postconf): Complete only applicable paramet > } > } The prompt says: > } > } zsh: do you wish to see all 112 possibilities (28 lines)? > } > } If I answer "yes" then I get 28 lines, that show everything in my > } `postconf -n` output and nothing else: > > And how many words is that, all together? I think it must be counting > the words in the descriptions as "possibilities" which probably has > something to do with the way the column positions are abused to get > the description to line up nicely alongside the thing described. Bingo. I see it now. My 'postconf -n' has: - 1 value that repeats 3 times - 2 values that repeat twice, each - 25 values that appear once each So _describe puts that into a table as follows: a1 a2 a3 -- va b1 b2 -- vb c1 c2 -- vc k1 -- v1 k2 -- v2 ⋮ k25 -- v25 The table has 4 columns — headed by "a1", "a2", "a3", and "-- v1" where the double-hyphen is the list-separator style — and 28 rows, so it counts as 28×4 = 112 matches. Here's a reproducer: _f () { a=( ) i=25 while (( i-- ) do a+=( k${i}:v$i ) done a+=( a{1..3}:va b{1..2}:vb c{1..2}:vc ) a=( ${a/:/_______________________:} ) _describe d a }