From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: Re: Bad interaction between -iprefix and -string
Date: Thu, 11 Feb 1999 17:34:34 +0100 (MET) [thread overview]
Message-ID: <199902111634.RAA06689@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Sven Wischnowsky's message of Thu, 11 Feb 1999 16:41:32 +0100 (MET)
I wrote:
> Peter Stephenson wrote:
>
> > % stest name=y<TAB> # produces...
> > % stest name=yan # OK so far, add `,te' by hand...
> > % stest name=yan,te<TAB> # produces...
> > % stest name=yan,tedick # The te is being ignored, too.
>
> Stuff like the above makes me think that even more control over the
> inserted suffixes would be nice. In this case: make a `,' fall in
> place automatically.
That was nonsense, of course. This:
__stest () {
if [[ -iprefix name= ]]
then
[[ -string , ]]
compadd -qr ',' -S ' ' -m yan tan tethera dick
fi
}
should work perfectly well. But at least trying it revealed two bugs:
with the `-m' option compadd should use IPREFIX and in addmatches()
(which is the function used for compadd) we shouldn't tokenize the
contents of the completion variables.
With the patch below, it works.
Bye
Sven
--- os/Zle/zle_tricky.c Mon Feb 8 13:18:36 1999
+++ Src/Zle/zle_tricky.c Thu Feb 11 17:31:46 1999
@@ -2489,16 +2489,15 @@
SWITCHHEAPS(compheap) {
HEAPALLOC {
if (aflags & CAF_MATCH) {
- ctokenize(lipre = dupstring(compiprefix));
- remnulargs(lipre);
- ctokenize(lpre = dupstring(compprefix));
- remnulargs(lpre);
+ lipre = dupstring(compiprefix);
+ lpre = dupstring(compprefix);
llpl = strlen(lpre);
- ctokenize(lsuf = dupstring(compsuffix));
- remnulargs(lsuf);
+ lsuf = dupstring(compsuffix);
}
if (ipre)
ipre = (lipre ? dyncat(lipre, ipre) : dupstring(ipre));
+ else if (lipre)
+ ipre = lipre;
if (ppre) {
ppre = dupstring(ppre);
lpl = strlen(ppre);
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
next reply other threads:[~1999-02-11 16:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-02-11 16:34 Sven Wischnowsky [this message]
-- strict thread matches above, loose matches on Subject: below --
1999-02-11 15:41 Sven Wischnowsky
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=199902111634.RAA06689@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).