Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] compdescribe fix for unsorted groups (workers/34814) (was: Re: completion: git: --fixup: problem with _describe -2V and duplicate commit subjects)
- X-seq: zsh-workers 35246
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Zsh Hackers' List <zsh-workers@xxxxxxx>
- Subject: Re: [PATCH] compdescribe fix for unsorted groups (workers/34814) (was: Re: completion: git: --fixup: problem with _describe -2V and duplicate commit subjects)
- Date: Wed, 20 May 2015 23:51:58 +0000
- 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=
- In-reply-to: <150519152300.ZM12361@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <5510AAD4.8040807@thequod.de> <20150329054753.GA2766@tarsus.local2> <20150514143627.GE1932@tarsus.local2> <20150519204446.GC1837@tarsus.local2> <150519152300.ZM12361@torch.brasslantern.com>
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 <TAB><TAB><TAB>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author