From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5605 invoked by alias); 21 May 2015 00:02:31 -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: 35246 Received: (qmail 888 invoked from network); 21 May 2015 00:02:27 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) 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,RCVD_IN_DNSWL_LOW autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=K328o0AEi04EZpsmlClScn2T6nU=; b=KSeTaT X+2fbXjToK21QGh5/TPTg2oX/shYZZco0Tldb9z5bHrWE3af3Hkg0dhnMSvU1T5C sz/Ak6vkt1u9MvKkf1AGkHRd5PAuDVpQ3FWPXpoCvZdz4wJaip8cCbL1ayk+uB2o BKv0TiKSW2/Hc9ZT6hBlZB7XJyAt81m9OopTg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=K328o0AEi04EZpsmlClScn2T6nU=; b=ZbkiC JCHJpq/2x4kcGXMeCMuoJi+guGw7S9Udwdzeb59zLE14jxMhf6CB2rUuCebrUgVO awoky2Xw6SNtZzEvsIy75TXjIi/ohKcHIQil2wgAAPd8hMB1M9pYAF6GpiyJbhwR n18T2GjwMJieUeocHdcB6z0fwAQZNBVyBrnSRs= X-Sasl-enc: wQjoDJ5YyLcN/RZMJzY/LsSLOFMOhBLpVgriqtttsBjq 1432165920 Date: Wed, 20 May 2015 23:51:58 +0000 From: Daniel Shahaf To: Zsh Hackers' List Subject: Re: [PATCH] compdescribe fix for unsorted groups (workers/34814) (was: Re: completion: git: --fixup: problem with _describe -2V and duplicate commit subjects) Message-ID: <20150520235158.GB2029@tarsus.local2> References: <5510AAD4.8040807@thequod.de> <20150329054753.GA2766@tarsus.local2> <20150514143627.GE1932@tarsus.local2> <20150519204446.GC1837@tarsus.local2> <150519152300.ZM12361@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <150519152300.ZM12361@torch.brasslantern.com> User-Agent: Mutt/1.5.21 (2010-09-15) Bart Schaefer wrote on Tue, May 19, 2015 at 15:23:00 -0700: > On May 19, 8:44pm, Daniel Shahaf wrote: > } Subject: Re: [PATCH] compdescribe fix for unsorted groups (workers/34814) > } > } 3. I propose the following documentation patch: > } > } +tt(_describe) should not be called more than once in a single call to > } +a completion function. > > Is it really any time _describe is called twice, or is it just that > _describe should not be called more than once with the same (or an > overlapping?) set of descriptions? If you call _describe more than once, with the same tag parameter in both calls (or with no -t parameter in both calls), and each of the two calls (separately) has a pair of items with equal description, then the display will be garbled. This happens even if no flags (other than possibly -t) are passed. I'm not sure whether that's a complete characterization, i.e., whether there are other circumstances that also trigger the problem. I think the trick might be to get cd_get() to pass -E to compadd (inserting an empty match) twice during one completion operation. While looking into this, I've also found a 100% CPU consumption bug; to reproduce (in master): autoload compinit compinit _f() { d=(d1); a=(); compadd -XX -JJ -E1 -d d -a a; compadd -XX -JJ -E1 -d d -a a }; compdef _f f f Backtrace: 0x00007ffff60b7a5d in do_menucmp (lst=4) at compresult.c:1234 1234 } while (!(minfo.group)->mcount); (gdb) bt #0 0x00007ffff60b7a5d in do_menucmp (lst=4) at compresult.c:1234 #1 0x00007ffff60a2aaf in before_complete (dummy=0x7ffff6516c30, lst=0x7fffffffdd5c) at compcore.c:478 #2 0x000000000046870f in runhookdef (h=0x7ffff6516c30, d=0x7fffffffdd5c) at module.c:996 #3 0x00007ffff62f7084 in docomplete (lst=4) at zle_tricky.c:622 #4 0x00007ffff62f66b7 in expandorcomplete (args=0x7ffff6517188) at zle_tricky.c:315 It's spinning in the outer of the two do-while loops in there, with minfo.cur being a dummy match. Cheers, Daniel