* compadd -f with IPREFIX.
@ 1999-05-18 6:27 Tanaka Akira
0 siblings, 0 replies; 8+ messages in thread
From: Tanaka Akira @ 1999-05-18 6:27 UTC (permalink / raw)
To: zsh-workers
I found a problem with zsh-3.1.5-pws-18.
Z:akr@is27e1u11% ./Src/zsh -f
is27e1u11% cat <<'End' > Completion/User/_tst
heredoc> #compdef tst
heredoc> compset -P :
heredoc> compadd -f - *
heredoc> End
is27e1u11% fpath=($PWD/Completion/*(/))
is27e1u11% . Completion/Core/compinit
is27e1u11% tst :Compl<TAB>
then, I get following.
is27e1u11% tst :Completion
I think zsh should complete a suffix "/".
Also, truss reports that zsh stat ":Completion" as following.
stat64(":Completion", 0xFFBEEF00) Err#2 ENOENT
--
Tanaka Akira
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: compadd -f with IPREFIX.
@ 1999-05-31 7:03 Sven Wischnowsky
0 siblings, 0 replies; 8+ messages in thread
From: Sven Wischnowsky @ 1999-05-31 7:03 UTC (permalink / raw)
To: zsh-workers
Bart Schaefer wrote:
> Didn't you say the documentation explicitly says this won't happen? So
> shouldn't there be some kind of documentation patch to go with the change?
Ahem. Thanks.
Bye
Sven
diff -u od/Zsh/compwid.yo Doc/Zsh/compwid.yo
--- od/Zsh/compwid.yo Thu May 20 08:32:30 1999
+++ Doc/Zsh/compwid.yo Mon May 31 09:02:10 1999
@@ -424,7 +424,8 @@
)
item(tt(-r) var(remove-chars))(
This is a more versatile form of the tt(-q) option.
-The suffix given with tt(-S) will be automatically removed if
+The suffix given with tt(-S) or the slash automatically added after
+completing directories will be automatically removed if
the next character typed inserts one of the characters given in the
var(remove-chars). This string is parsed as a characters class and
understands the backslash sequences used by the tt(print) command. For
@@ -436,8 +437,8 @@
as `tt(-S "=" -r "= \t\n\-")'.
)
item(tt(-R) var(remove-func))(
-This is another form of the tt(-r) option. When a suffix given with the
-tt(-S) option has been inserted and the completion accepted, the function
+This is another form of the tt(-r) option. When a suffix
+has been inserted and the completion accepted, the function
var(remove-func) will be called after the next character typed. It is
passed the length of the suffix as an argument and can use the special
parameters available in ordinary (non-completion) zle widgets (see
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: compadd -f with IPREFIX.
1999-05-21 13:18 Sven Wischnowsky
@ 1999-05-29 8:15 ` Bart Schaefer
0 siblings, 0 replies; 8+ messages in thread
From: Bart Schaefer @ 1999-05-29 8:15 UTC (permalink / raw)
To: zsh-workers
On May 21, 3:18pm, Sven Wischnowsky wrote:
} Subject: Re: compadd -f with IPREFIX.
}
} Tanaka Akira wrote:
}
} > Sven Wischnowsky <wischnow@informatik.hu-berlin.de> writes:
} > > So the question to everyone is: should we change this to make -[rR]
} > > work even on automatically added suffixes?
} >
} > It's consistent and useful, I suppose.
}
} Yes, maybe.
Didn't you say the documentation explicitly says this won't happen? So
shouldn't there be some kind of documentation patch to go with the change?
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: compadd -f with IPREFIX.
@ 1999-05-21 13:18 Sven Wischnowsky
1999-05-29 8:15 ` Bart Schaefer
0 siblings, 1 reply; 8+ messages in thread
From: Sven Wischnowsky @ 1999-05-21 13:18 UTC (permalink / raw)
To: zsh-workers
Tanaka Akira wrote:
> In article <199905180954.LAA16898@beta.informatik.hu-berlin.de>,
> Sven Wischnowsky <wischnow@informatik.hu-berlin.de> writes:
> > So the question to everyone is: should we change this to make -[rR]
> > work even on automatically added suffixes?
>
> It's consistent and useful, I suppose.
Yes, maybe. And since this is only with explicitly given characters or
functions to remove the suffix, it won't interfere with previous
behavior anyway.
Bye
Sven
diff -u os/Zle/zle_tricky.c Src/Zle/zle_tricky.c
--- os/Zle/zle_tricky.c Thu May 20 08:32:47 1999
+++ Src/Zle/zle_tricky.c Fri May 21 15:13:30 1999
@@ -7112,9 +7112,13 @@
menuinsc++;
if (menuwe)
menuend++;
- if ((!menucmp || menuwe) && isset(AUTOREMOVESLASH)) {
- makesuffix(1);
- suffixlen['/'] = 1;
+ if (!menucmp || menuwe) {
+ if (m->remf || m->rems)
+ makesuffixstr(m->remf, m->rems, 1);
+ else if (isset(AUTOREMOVESLASH)) {
+ makesuffix(1);
+ suffixlen['/'] = 1;
+ }
}
}
}
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: compadd -f with IPREFIX.
1999-05-18 9:54 Sven Wischnowsky
@ 1999-05-18 17:11 ` Tanaka Akira
0 siblings, 0 replies; 8+ messages in thread
From: Tanaka Akira @ 1999-05-18 17:11 UTC (permalink / raw)
To: zsh-workers
In article <199905180954.LAA16898@beta.informatik.hu-berlin.de>,
Sven Wischnowsky <wischnow@informatik.hu-berlin.de> writes:
> Currently -r and -R only work on user-added suffixes given with -S.
> This is the way -q always worked (I didn't change anything ;-). It is
> also stated explicitly in the docs.
Hmm.
> So the question to everyone is: should we change this to make -[rR]
> work even on automatically added suffixes?
It's consistent and useful, I suppose.
--
Tanaka Akira
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: compadd -f with IPREFIX.
@ 1999-05-18 9:54 Sven Wischnowsky
1999-05-18 17:11 ` Tanaka Akira
0 siblings, 1 reply; 8+ messages in thread
From: Sven Wischnowsky @ 1999-05-18 9:54 UTC (permalink / raw)
To: zsh-workers
Tanaka Akira wrote:
> heredoc> compadd -f -r ':/ \t\n\-' - *
>
> is27e1u11% tst :Completion/
>
> There is no problem in above operation.
> But, I put ":", "/" is retained as follows.
>
> is27e1u11% tst :Completion/:
>
> I think that "/" should be removed.
Currently -r and -R only work on user-added suffixes given with -S.
This is the way -q always worked (I didn't change anything ;-). It is
also stated explicitly in the docs.
So the question to everyone is: should we change this to make -[rR]
work even on automatically added suffixes?
Bye
Sven
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: compadd -f with IPREFIX.
1999-05-18 7:15 Sven Wischnowsky
@ 1999-05-18 9:47 ` Tanaka Akira
0 siblings, 0 replies; 8+ messages in thread
From: Tanaka Akira @ 1999-05-18 9:47 UTC (permalink / raw)
To: zsh-workers
In article <199905180715.JAA15766@beta.informatik.hu-berlin.de>,
Sven Wischnowsky <wischnow@informatik.hu-berlin.de> writes:
> addmatches() used the IPREFIX it got also as `ripre' (the expanded
> form of the ignored prefix -- this is used for things like `~' and
> `$foo/<TAB>'). The patch makes it use a NULL pointer there.
Thanks. But I found another problem.
Z(2):akr@is27e1u11% ./Src/zsh -f
is27e1u11% cat <<'End' > Completion/User/_tst
heredoc> #compdef tst
heredoc> compset -P :
heredoc> compadd -f -r ':/ \t\n\-' - *
heredoc> End
is27e1u11% fpath=($PWD/Completion/*(/))
is27e1u11% . Completion/Core/compinit
is27e1u11% tst :Compl<TAB>
Then, I get following.
is27e1u11% tst :Completion/
There is no problem in above operation.
But, I put ":", "/" is retained as follows.
is27e1u11% tst :Completion/:
I think that "/" should be removed.
# The aim is colon-separated directories completion.
# compset -P '*:'; _path_files -r ':/ \t\n\-' -/
--
Tanaka Akira
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: compadd -f with IPREFIX.
@ 1999-05-18 7:15 Sven Wischnowsky
1999-05-18 9:47 ` Tanaka Akira
0 siblings, 1 reply; 8+ messages in thread
From: Sven Wischnowsky @ 1999-05-18 7:15 UTC (permalink / raw)
To: zsh-workers
Tanaka Akira wrote:
> is27e1u11% cat <<'End' > Completion/User/_tst
> heredoc> #compdef tst
> heredoc> compset -P :
> heredoc> compadd -f - *
> heredoc> End
>
> then, I get following.
>
> is27e1u11% tst :Completion
>
> I think zsh should complete a suffix "/".
addmatches() used the IPREFIX it got also as `ripre' (the expanded
form of the ignored prefix -- this is used for things like `~' and
`$foo/<TAB>'). The patch makes it use a NULL pointer there.
Bye
Sven
diff -u os/Zle/zle_tricky.c Src/Zle/zle_tricky.c
--- os/Zle/zle_tricky.c Sat May 8 14:31:49 1999
+++ Src/Zle/zle_tricky.c Tue May 18 09:07:49 1999
@@ -3734,7 +3735,7 @@
continue;
}
if (doadd) {
- cm = add_match_data(isalt, ms, lc, dat->ipre, dat->ipre,
+ cm = add_match_data(isalt, ms, lc, dat->ipre, NULL,
dat->isuf, dat->pre, dat->prpre,
dat->ppre, dat->psuf, dat->suf,
bpl, bsl, dat->flags, isexact);
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~1999-05-31 7:04 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-05-18 6:27 compadd -f with IPREFIX Tanaka Akira
1999-05-18 7:15 Sven Wischnowsky
1999-05-18 9:47 ` Tanaka Akira
1999-05-18 9:54 Sven Wischnowsky
1999-05-18 17:11 ` Tanaka Akira
1999-05-21 13:18 Sven Wischnowsky
1999-05-29 8:15 ` Bart Schaefer
1999-05-31 7:03 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).