From: Peter Stephenson <pws@csr.com>
To: zsh-workers@sunsite.dk
Subject: Re: Allow completion to work with files starting with = (equal sign)
Date: Wed, 03 Oct 2007 17:12:35 +0100 [thread overview]
Message-ID: <200710031612.l93GCajn029286@news01.csr.com> (raw)
In-Reply-To: <200710031527.l93FRSXS016734@news01.csr.com>
I quite like this patch anyway, though I think new completion already
handles this.
Index: Src/Zle/compctl.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/compctl.c,v
retrieving revision 1.34
diff -u -r1.34 compctl.c
--- Src/Zle/compctl.c 6 Jul 2007 21:52:40 -0000 1.34
+++ Src/Zle/compctl.c 3 Oct 2007 16:09:51 -0000
@@ -3501,7 +3501,7 @@
p++;
/* Get the pattern string. */
tokenize(g = dupstrpfx(g, p - g));
- if (*g == '=')
+ if (*g == '=' && isset(EQUALS))
*g = Equals;
if (*g == '~')
*g = Tilde;
Index: Src/Zle/zle_tricky.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_tricky.c,v
retrieving revision 1.88
diff -u -r1.88 zle_tricky.c
--- Src/Zle/zle_tricky.c 30 Aug 2007 21:46:02 -0000 1.88
+++ Src/Zle/zle_tricky.c 3 Oct 2007 16:09:52 -0000
@@ -1608,6 +1608,13 @@
*q = Bnull;
}
}
+ /*
+ * Leading "=" gets tokenized in case the EQUALS options
+ * changes afterwards. It's too late for that now, so restore it
+ * to a plain "=" if the option is unset.
+ */
+ if (*s == Equals && !isset(EQUALS))
+ *s = '=';
/* While building the quoted form, we also clean up the command line. */
for (p = s, i = wb, j = 0; *p; p++, i++) {
int skipchars;
--
Peter Stephenson <pws@csr.com> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
parent reply other threads:[~2007-10-03 16:13 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <200710031527.l93FRSXS016734@news01.csr.com>]
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=200710031612.l93GCajn029286@news01.csr.com \
--to=pws@csr.com \
--cc=zsh-workers@sunsite.dk \
/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).