zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Cc: Vasiliy Ivanov <beelzebubbie.logs@gmail.com>
Subject: Re: _history_complete_{newer,older} complains on "unmat ched" in _all_labels if globbing
Date: Wed, 22 Oct 2014 20:18:37 -0700	[thread overview]
Message-ID: <141022201837.ZM17848@torch.brasslantern.com> (raw)
In-Reply-To: <5448210E.6090600@gmail.com>

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))


  reply	other threads:[~2014-10-23  3:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-21 21:08 _history_complete_{newer,older} complains on «unmatched» " Vasiliy Ivanov
2014-10-22  6:43 ` _history_complete_{newer,older} complains on "unmat ched" " Bart Schaefer
2014-10-22  8:53   ` Vasiliy Ivanov
2014-10-22 11:08     ` Daniel Shahaf
2014-10-22 21:26       ` Vasiliy Ivanov
2014-10-23  3:18         ` Bart Schaefer [this message]
2014-10-24 20:47           ` Vasiliy Ivanov

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=141022201837.ZM17848@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=beelzebubbie.logs@gmail.com \
    --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).