Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: _history_complete_{newer,older} complains on "unmat ched" in _all_labels if globbing
- X-seq: zsh-workers 33510
- From: Vasiliy Ivanov <beelzebubbie.logs@xxxxxxxxx>
- To: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- Subject: Re: _history_complete_{newer,older} complains on "unmat ched" in _all_labels if globbing
- Date: Thu, 23 Oct 2014 03:26:38 +0600
- Cc: zsh-workers@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=odeYQsr3cTfwFX93mPaeIFTuxa5t3Kdvjo8c7fy7qFk=; b=OPanDAY5G6DSU56XUkYKUlPTaQEkHzJDmmdCZBVgDHAbpEFXYiDc/CrnlfUutQonjz rkslYkGDlvuI8W2yfDUDLwf0ExidbqGYdCjSR+fIPjkbUJLYnm9DVfd/+/Sca9Q0ThFW n9bAA+LmU/vRLPKR5xjUAC77mM+6EUCJJ4lwzKr81APt8X47yOHE9zAaohRfsmkDjDHQ VRf+B3pMRCPKkZbwretCXCTnwQDZqU0GBnAZ4HBMLAEy17Edgs0nirnkSL/1Fnn5pUF0 MBSzETqJ592Hpk7ttVhmNBK2Mzlm7J5xC87KjlVY6BHBSlKv/VQqaQSRvdcrzRO1MYrm nfJQ==
- In-reply-to: <20141022110848.GC1692@tarsus.local2>
- 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: <5446CB4F.7080808@gmail.com> <141021234353.ZM14828@torch.brasslantern.com> <54477091.8050102@gmail.com> <20141022110848.GC1692@tarsus.local2>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 10/22/14 17:08, Daniel Shahaf wrote:
> Vasiliy Ivanov wrote on Wed, Oct 22, 2014 at 14:53:37 +0600:
>> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
>>
>> On 10/22/14 12:43, Bart Schaefer wrote:
>>> On Oct 22, 3:08am, Vasiliy Ivanov wrote: } } % typeset -a somevariable } % somevariable=(1
>>> 2 3) } } % *mevar<_history-complete-older> (completed properly, 2 items suggested -
>>> 'somevariable=(' and } 'somevariable', guessed because expand prefix suffix style) } } but
>>> fires hundreds of messages: } _all_labels:39: closing brace expected } ... }
>>> _all_labels:39: unmatched ' } ... } _all_labels:39: unmatched " } } reproducible with any
>>> globbing syntax, zsh 5.0.7
>>>
>>> There's something else about your configuration that you're not telling us, because I can't
>>> get any completions at all for *mevar unless I "setopt globcomplete", and I don't get any
>>> error messages even with that set.
>>>
>>> Line 39 of _all_labels is
>>>
>>> "${(@)argv[4,__pre]}" "${(P@)2}" "${(@)argv[__suf,-1]}" && __ret=0
>>>
>>> which ends up substituting into something like
>>>
>>> +_all_labels:39> compadd -1 -V -default- -X '%SCompleting %Uhistory word%u%s' -Q -a
>>> 'historywords[beg,beg+slice]' +_all_labels:39> __ret=0
>>>
>>> (though in your case the assignment to __ret is likely not happening)
>>>
>>
>> I was able to reproduce with zsh -f and minimal configuration:
>>
>> % setopt globcomplete % autoload -U compinit % compinit
>>
>> but *only* with my existing (2300+ records) history file; starting with empty one doesn't
>> throw these messages. Line 39 in my case is «compadd -1 -V -default- -Q -a
>> historywords[beg,beg+slice]»
>>
>> How can I debug this further (which history records leads to «unmatched» messages)? Any hints
>> will be extremely helpful.
>
> Have you tried a binary search?
>
> That is: split the history file to two roughly equal parts and try each one of them to see if
> it reproduces the error. It is likely that exactly one of the two halves will reproduce the
> error. Repeat the bifurcation process recursively within that half until you narrow the
> problem to a single history entry.
>
> Cheers, Daniel
>
Thanks for refreshing my knowlegde, but *manual* binary search.. so scary :)
Nevertheless, I reproduced this error from the scratch:
$ zsh -f
% export HISTSIZE=9000
% export HISTFILE=~/.test.history
% export SAVEHIST=$HISTSIZE
% setopt sharehistory
% setopt extendedhistory
% setopt globcomplete
% autoload -U compinit
% compinit
% a='1 2'
% ^D (seems history must be loaded from file to cause error)
$ zsh -f
% export HISTSIZE=9000
…
% compinit
% *olo<^[/>
_all_labels:39: unmatched '
_all_labels:39: unmatched '
% <completed>autoload
adding b="3 4" to history increases error count:
% *olo<^[/>
_all_labels:39: unmatched "
_all_labels:39: unmatched "
_all_labels:39: unmatched '
_all_labels:39: unmatched '
% <completed>autoload
- --
Regards,
Vasiliy Ivanov <beelzebubbie.logs@xxxxxxxxx>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQEcBAEBAgAGBQJUSCEOAAoJEAnDj7eK12hqBGgH/0+s1uRhtr4mTGwWIWOnRaeS
4/0DUvFKGg03B3TjWE4cPlHDjo8bGCGP/M3xfqf8YtfUrP4yKsGFe4cqO3zBlUbK
sxupJHd5OWviJACeV38K7Vhreahvpl7ZwLwXfbdnpnCeaYgOsBSdlJoKtrqdH+O/
RsUZvr8EFrxoD/vQBe0Li1cTtulJCB0pByBzuGMfGEHm7ilmwxfRB3zQebQRT18k
xIF8JjAincfImOcuwM3e3VjX0eeUeW/LO8utx8Qxc78VluawLUdC3sTsiOjTAx44
YtgtI/HzhdblV3RAcWKcwFBrwykI3EjacCHtjloHvnGNsx97mxr5WLd4AQnBHgc=
=GU5c
-----END PGP SIGNATURE-----
Messages sorted by:
Reverse Date,
Date,
Thread,
Author