zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: zsh-3.1.5-pws-19 unquotes prefix.
Date: Wed, 26 May 1999 08:43:08 +0200 (MET DST)	[thread overview]
Message-ID: <199905260643.IAA07549@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Tanaka Akira's message of 25 May 1999 03:20:04 +0900


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


             reply	other threads:[~1999-05-26  6:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-05-26  6:43 Sven Wischnowsky [this message]
1999-05-26 13:01 ` Tanaka Akira
  -- strict thread matches above, loose matches on Subject: below --
1999-05-27  6:24 Sven Wischnowsky
1999-05-24 18:20 Tanaka Akira

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=199905260643.IAA07549@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.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).