From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15538 invoked by alias); 23 Oct 2014 03:18: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: 33515 Received: (qmail 29065 invoked from network); 23 Oct 2014 03:18:38 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=PLG4IkuH c=1 sm=1 tr=0 a=FT8er97JFeGWzr5TCOCO5w==:117 a=FT8er97JFeGWzr5TCOCO5w==:17 a=VRfkd_uakS0A:10 a=kj9zAlcOel0A:10 a=q2GGsy2AAAAA:8 a=oR5dmqMzAAAA:8 a=-9mUelKeXuEA:10 a=e_hKJX1a8NVQGz8CDSYA:9 a=CjuIK1q_8ugA:10 From: Bart Schaefer Message-id: <141022201837.ZM17848@torch.brasslantern.com> Date: Wed, 22 Oct 2014 20:18:37 -0700 In-reply-to: <5448210E.6090600@gmail.com> Comments: In reply to Vasiliy Ivanov "Re: _history_complete_{newer,older} complains on "unmat ched" in _all_labels if globbing" (Oct 23, 3:26am) References: <5446CB4F.7080808@gmail.com> <141021234353.ZM14828@torch.brasslantern.com> <54477091.8050102@gmail.com> <20141022110848.GC1692@tarsus.local2> <5448210E.6090600@gmail.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: _history_complete_{newer,older} complains on "unmat ched" in _all_labels if globbing Cc: Vasiliy Ivanov MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Oct 23, 3:26am, Vasiliy Ivanov wrote: } Subject: Re: _history_complete_{newer,older} complains on "unmat ched" in } } % a='1 2' } % ^D (seems history must be loaded from file to cause error) As a workaround until the patch below makes it into release, it would probably silence this "unmatched" (and possibly make your completions more pleasing) if you "setopt HIST_LEX_WORDS" in your .zlogin file. See the description of that option for details. } $ zsh -f } % export HISTSIZE=9000 } ... } % compinit } % *olo<^[/> } _all_labels:39: unmatched ' } _all_labels:39: unmatched ' OK, this really isn't directly related to history completion, it's a generic problem with compadd invoking the parser without first telling it to be quiet. With HIST_LEX_WORDS the string being parsed would already be a fully-quoted expression and the error would not occur in history word completion (but might occur under other circumstances). diff --git a/Src/Zle/compmatch.c b/Src/Zle/compmatch.c index 4cd3b9f..05ae43a 100644 --- a/Src/Zle/compmatch.c +++ b/Src/Zle/compmatch.c @@ -1014,6 +1014,7 @@ comp_match(char *pfx, char *sfx, char *w, Patprog cp, Cline *clp, int qu, Brinfo *bpl, int bcp, Brinfo *bsl, int bcs, int *exact) { char *r = NULL; + int onoerrs = noerrs; if (cp) { /* We have a globcomplete-like pattern, just use that. */ @@ -1033,12 +1034,14 @@ comp_match(char *pfx, char *sfx, char *w, Patprog cp, Cline *clp, int qu, */ teststr = dupstring(r); tokenize(teststr); + noerrs = 1; if (parse_subst_string(teststr)) teststr = r; else { remnulargs(teststr); untokenize(teststr); } + noerrs = onoerrs; } else teststr = r; if (!pattry(cp, teststr))