From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Zsh Hackers' List <zsh-workers@zsh.org>
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 [thread overview]
Message-ID: <20150520235158.GB2029@tarsus.local2> (raw)
In-Reply-To: <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
next prev parent reply other threads:[~2015-05-21 0:02 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-23 22:05 completion: git: --fixup: problem with _describe -2V and duplicate commit subjects Daniel Hahler
2015-03-24 0:07 ` Daniel Hahler
2015-03-29 5:47 ` Daniel Shahaf
2015-03-30 18:21 ` Daniel Shahaf
2015-05-13 12:41 ` Daniel Hahler
2015-05-14 14:28 ` Daniel Shahaf
2015-05-13 12:44 ` Daniel Hahler
2015-05-14 14:36 ` [PATCH] compdescribe fix for unsorted groups (workers/34814) (was: Re: completion: git: --fixup: problem with _describe -2V and duplicate commit subjects) Daniel Shahaf
2015-05-16 22:54 ` Daniel Shahaf
2015-05-17 4:07 ` Bart Schaefer
2015-05-17 23:40 ` Daniel Shahaf
2015-05-18 4:00 ` Bart Schaefer
2015-05-19 1:36 ` Daniel Shahaf
2015-05-19 4:37 ` Bart Schaefer
2015-05-19 20:41 ` Daniel Shahaf
2015-05-19 22:03 ` Bart Schaefer
2015-05-19 20:44 ` Daniel Shahaf
2015-05-19 21:01 ` Daniel Shahaf
2015-05-19 22:23 ` Bart Schaefer
2015-05-20 23:51 ` Daniel Shahaf [this message]
2015-05-22 5:02 ` Bart Schaefer
2015-05-23 10:03 ` Daniel Shahaf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150520235158.GB2029@tarsus.local2 \
--to=d.s@daniel.shahaf.name \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).