zsh-workers
 help / color / mirror / code / Atom feed
* zsh-3.1.5-pws-19 unquotes prefix.
@ 1999-05-24 18:20 Tanaka Akira
  0 siblings, 0 replies; 4+ messages in thread
From: Tanaka Akira @ 1999-05-24 18:20 UTC (permalink / raw)
  To: zsh-workers

Z(2):akr@is27e1u11% ./Src/zsh -f
is27e1u11% fpath=($PWD/Completion/*(/))
is27e1u11% . Completion/Core/compinit
is27e1u11% _tst () { compset -P '\*' && compadd -- a }
is27e1u11% _comps[tst]=_tst
is27e1u11% tst \*<TAB>

I get following.

is27e1u11% tst *a 

I think that zsh sould not unquote *.

is27e1u11% tst \*a 
-- 
Tanaka Akira


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: zsh-3.1.5-pws-19 unquotes prefix.
@ 1999-05-27  6:24 Sven Wischnowsky
  0 siblings, 0 replies; 4+ messages in thread
From: Sven Wischnowsky @ 1999-05-27  6:24 UTC (permalink / raw)
  To: zsh-workers


Tanaka Akira wrote:

> is27e1u11% fpath=($PWD/Completion/*(/))
> is27e1u11% . Completion/Core/compinit
> is27e1u11% _tst () { compadd -P '\*' a }              
> is27e1u11% _comps[tst]=_tst
> is27e1u11% tst \*<TAB>
> 
> Then, I get no completion.

Argh. Sorry, I just forgot to change `compadd -P', too. Of course it's 
the same fix as for comp{gen,ctl}.

Bye
 Sven

--- os/Zle/zle_tricky.c	Tue May 25 19:47:05 1999
+++ Src/Zle/zle_tricky.c	Wed May 26 20:28:14 1999
@@ -3609,7 +3609,9 @@
 		llsl = strlen(lsuf);
 		/* Test if there is an existing -P prefix. */
 		if (dat->pre && *dat->pre) {
-		    pl = pfxlen(dat->pre, lpre);
+		    char *dp = rembslash(dat->pre);
+
+		    pl = pfxlen(dp, lpre);
 		    llpl -= pl;
 		    lpre += pl;
 		}

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: zsh-3.1.5-pws-19 unquotes prefix.
  1999-05-26  6:43 Sven Wischnowsky
@ 1999-05-26 13:01 ` Tanaka Akira
  0 siblings, 0 replies; 4+ messages in thread
From: Tanaka Akira @ 1999-05-26 13:01 UTC (permalink / raw)
  To: zsh-workers

In article <199905260643.IAA07549@beta.informatik.hu-berlin.de>,
  Sven Wischnowsky <wischnow@informatik.hu-berlin.de> writes:

> That was one problem. The other was that with old completion and
> `compctl -P '\*' -k '(a b)' foo', completion after `ls \*<TAB>' didn't 
> work at all.
> 
> Again, completion and quoting, sigh.

Thanks. But I found another problem with \*.

is27e1u11% fpath=($PWD/Completion/*(/))
is27e1u11% . Completion/Core/compinit
is27e1u11% _tst () { compadd -P '\*' a }              
is27e1u11% _comps[tst]=_tst
is27e1u11% tst \*<TAB>

Then, I get no completion.

If _tst is defined as following, I get "tst \*a " correctly.
_tst () { compgen -P '\*' -k '(a)' }
-- 
Tanaka Akira


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: zsh-3.1.5-pws-19 unquotes prefix.
@ 1999-05-26  6:43 Sven Wischnowsky
  1999-05-26 13:01 ` Tanaka Akira
  0 siblings, 1 reply; 4+ messages in thread
From: Sven Wischnowsky @ 1999-05-26  6:43 UTC (permalink / raw)
  To: zsh-workers


Tanaka Akira wrote:

> Z(2):akr@is27e1u11% ./Src/zsh -f
> is27e1u11% fpath=($PWD/Completion/*(/))
> is27e1u11% . Completion/Core/compinit
> is27e1u11% _tst () { compset -P '\*' && compadd -- a }
> is27e1u11% _comps[tst]=_tst
> is27e1u11% tst \*<TAB>
> 
> I get following.
> 
> is27e1u11% tst *a 
> 
> I think that zsh sould not unquote *.
> 
> is27e1u11% tst \*a 

That was one problem. The other was that with old completion and
`compctl -P '\*' -k '(a b)' foo', completion after `ls \*<TAB>' didn't 
work at all.

Again, completion and quoting, sigh.

Bye
 Sven

--- os/Zle/zle_tricky.c	Fri May 21 23:47:01 1999
+++ Src/Zle/zle_tricky.c	Tue May 25 19:40:22 1999
@@ -3596,8 +3596,13 @@
 	    /* Get the contents of the completion variables if we have
 	     * to perform matching. */
 	    if (dat->aflags & CAF_MATCH) {
-		lipre = dupstring(compiprefix);
-		lisuf = dupstring(compisuffix);
+		if (dat->aflags & CAF_QUOTE) {
+		    lipre = dupstring(compiprefix);
+		    lisuf = dupstring(compisuffix);
+		} else {
+		    lipre = quotename(compiprefix, NULL);
+		    lisuf = quotename(compisuffix, NULL);
+		}
 		lpre = dupstring(compprefix);
 		lsuf = dupstring(compsuffix);
 		llpl = strlen(lpre);
@@ -5324,10 +5329,11 @@
 	int pl = 0;
 
 	if (*s) {
+	    char *dp = rembslash(cc->prefix);
 	    /* First find out how much of the prefix is already on the line. */
 	    sd = dupstring(s);
 	    untokenize(sd);
-	    pl = pfxlen(cc->prefix, sd);
+	    pl = pfxlen(dp, sd);
 	    s += pl;
 	    sd += pl;
 	    offs -= pl;
@@ -5335,7 +5341,7 @@
     }
     /* Does this compctl have a suffix (compctl -S)? */
     if (cc->suffix) {
-	char *sdup = dupstring(cc->suffix);
+	char *sdup = rembslash(cc->suffix);
 	int sl = strlen(sdup), suffixll;
 
 	/* Ignore trailing spaces. */

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1999-05-27  6:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-05-24 18:20 zsh-3.1.5-pws-19 unquotes prefix Tanaka Akira
1999-05-26  6:43 Sven Wischnowsky
1999-05-26 13:01 ` Tanaka Akira
1999-05-27  6:24 Sven Wischnowsky

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