zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: completion with prefix which contains meta character.
Date: Thu, 6 Jan 2000 10:38:34 +0100 (MET)	[thread overview]
Message-ID: <200001060938.KAA17703@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Tanaka Akira's message of 06 Jan 2000 17:04:47 +0900


Tanaka Akira wrote:

> I tried to complete with prefix `*' but zsh doesn't work well.
> 
> Z(2):akr@is27e1u11% Src/zsh -f
> is27e1u11% bindkey -e; autoload -U compinit; compinit -D; compdef _tst tst
> is27e1u11% _tst () { compadd -P '*' xxx }
> is27e1u11% tst \*<TAB>
> 
> This doesn't complete anything.
> 
> is27e1u11% _tst () { compadd -P '\*' xxx } 
> is27e1u11% tst \*<TAB>
> 
> This doesn't complete anything too.

But it should. At least I wanted to get the -P and -S be used
literally (should be the most powerful, right?).

Since I feel adventurous today, I even documented that.

And that rembslash() didn't make any sense at all.

Bye
 Sven

diff -ru ../z.old/Doc/Zsh/compwid.yo Doc/Zsh/compwid.yo
--- ../z.old/Doc/Zsh/compwid.yo	Thu Jan  6 10:27:21 2000
+++ Doc/Zsh/compwid.yo	Thu Jan  6 10:37:22 2000
@@ -420,7 +420,8 @@
 startitem()
 item(tt(-P) var(prefix))(
 This gives a string to be inserted before the given var(words).  The
-string given is not considered as part of the match.
+string given is not considered as part of the match and any shell
+metacharacters in it will not be quoted when the string is inserted.
 )
 item(tt(-S) var(suffix))(
 Like tt(-P) but gives a string to be inserted after the match.
diff -ru ../z.old/Src/Zle/compcore.c Src/Zle/compcore.c
--- ../z.old/Src/Zle/compcore.c	Thu Jan  6 10:27:14 2000
+++ Src/Zle/compcore.c	Thu Jan  6 10:32:46 2000
@@ -1629,9 +1629,7 @@
 		llsl = strlen(lsuf);
 		/* Test if there is an existing -P prefix. */
 		if (dat->pre && *dat->pre) {
-		    char *dp = rembslash(dat->pre);
-
-		    pl = pfxlen(dp, lpre);
+		    pl = pfxlen(dat->pre, lpre);
 		    llpl -= pl;
 		    lpre += pl;
 		}

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


             reply	other threads:[~2000-01-06  9:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-01-06  9:38 Sven Wischnowsky [this message]
2000-01-06 14:48 ` Tanaka Akira
  -- strict thread matches above, loose matches on Subject: below --
2000-01-07 10:50 Sven Wischnowsky
2000-01-07  9:27 Sven Wischnowsky
2000-01-06 15:03 Sven Wischnowsky
2000-01-06 23:38 ` Tanaka Akira
2000-01-06  8:04 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=200001060938.KAA17703@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).