Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Dynamic named directories and completion
- X-seq: zsh-users 23180
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Dynamic named directories and completion
- Date: Mon, 26 Feb 2018 21:22:56 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ntlworld.com; s=meg.feb2017; t=1519680177; bh=v1aChd+AIkQYoyDoC8hjSPS79t6WlbJkHgwhSOkvJmA=; h=Date:From:To:Subject:In-Reply-To:References; b=fiT/crFugfa3s/iHaqCS7BEza0wfW0lHhHfPbjwA9WC/hJm7KV5PF6SzdV+eehSej cCKP/HTWuaRKZisQvtOmMZ8iIcJ7/tIwrZX0NdB/sXmcq2/K7GB6+0Cib4ZJrvT89e zMj6Nb7ewdYKacBMN8YFuHEYwHLnpuLgb+RA40mVkMsaYpHCJQ38XDBQTO/S3ZBffe deMDe2d0yMzJTMTRn0reSfmVgEfU7eZwqVyoZJhihv9RtKZrI3lOBMy2RSiozjziE6 pYRdeasw/Ttragrgn16DI/DVcJBFDLBilfYvbqi/ET7tSI+oi+Eizbn71jTPkeV56m IyzvXUJpB8IIw==
- In-reply-to: <20180226200821.0ef8ecbb@ntlworld.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <p6nhj1$5nv$1@blaine.gmane.org> <m3po4wnni0.fsf@luffy.cx> <p6p952$9mi$2@blaine.gmane.org> <20180224193420.0d7d7d5c@ntlworld.com> <CGME20180226135458epcas2p2a2420b54f4d0a36357a655e31497ec85@epcas2p2.samsung.com> <p713bt$1so$1@blaine.gmane.org> <20180226144726.1d99a314@pwslap01u.europe.root.pri> <p71dcv$dne$1@blaine.gmane.org> <20180226200821.0ef8ecbb@ntlworld.com>
On Mon, 26 Feb 2018 20:08:21 +0000
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx> wrote:
> > I feel like expand-or-complete should work too, but as long as the
> > _expand patch makes it into the final code I'm happy.
>
> Yes, me too, particularly now Mikael has pointed out ^X*: I'll look
> at this separately.
I think this works.
What was happening was as a last search for something to expand the code
looked wildcards, and the square brackets triggered that.
pws
diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c
index caeef76..22c3812 100644
--- a/Src/Zle/zle_tricky.c
+++ b/Src/Zle/zle_tricky.c
@@ -456,6 +456,7 @@ checkparams(char *p)
static int
cmphaswilds(char *str)
{
+ char *ptr;
if ((*str == Inbrack || *str == Outbrack) && !str[1])
return 0;
@@ -465,6 +466,14 @@ cmphaswilds(char *str)
if (str[0] == '%' && str[1] ==Quest)
str += 2;
+ /*
+ * In ~[foo], the square brackets are not wild cards.
+ * This test matches the master one in filesubstr().
+ */
+ if (*str == Tilde && str[1] == Inbrack &&
+ (ptr = strchr(str+2, Outbrack)))
+ str = ptr + 1;
+
for (; *str;) {
if (*str == String || *str == Qstring) {
/* A parameter expression. */
Messages sorted by:
Reverse Date,
Date,
Thread,
Author