Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Another _arguments problem.
- X-seq: zsh-workers 8490
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: Re: Another _arguments problem.
- Date: Tue, 2 Nov 1999 14:52:03 +0100 (MET)
- In-reply-to: Tanaka Akira's message of 02 Nov 1999 22:02:37 +0900
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
Tanaka Akira wrote:
> I found another _arguments problem, maybe.
>
> ...
>
> The description for "-V" should be displayed. Because the option "-N"
> takes optional arguments and "V" is treated as an argument for "-N".
Yep. Small off-by-one thinko.
I also found a small display bug with completion lists and two
references to old function names (i.e. uses of functions that have
been renamed). Sorry for the latter, but this machine always complains
about all unknown functions and variables (which are many) so I can't
easily see if there are typos or something like that somewhere. I only
just discovered that it complains about unknown functions when I
unload a module (it doesn't do that when I load the module, oh well...).
I found the display bug when trying `_netscape' and `_urls'. The
latter had some other problems: at one point host names were completed
without a `_description', leaving me with two groups with the same
matches, one with a explanation string, one without. Another problem
was that it used a local parameter `hosts' and `_hosts' then set that,
ignoring the globally set `hosts' parameter. Certainly not the right
thing.
Bye
Sven
diff -u -r oldsrc/Modules/parameter.c Src/Modules/parameter.c
--- oldsrc/Modules/parameter.c Tue Nov 2 13:07:00 1999
+++ Src/Modules/parameter.c Tue Nov 2 14:22:20 1999
@@ -1781,7 +1781,7 @@
static void
scanpmdisgaliases(HashTable ht, ScanFunc func, int flags)
{
- scanpmaliases(ht, func, flags, 1, DISABLED);
+ scanaliases(ht, func, flags, 1, DISABLED);
}
/* Table for defined parameters. */
diff -u -r oldsrc/Zle/compcore.c Src/Zle/compcore.c
--- oldsrc/Zle/compcore.c Tue Nov 2 12:02:10 1999
+++ Src/Zle/compcore.c Tue Nov 2 14:21:48 1999
@@ -334,7 +334,7 @@
while (1) {
if (!first)
- acceptlast();
+ accept_last();
first = 0;
if (!--nm)
diff -u -r oldsrc/Zle/compresult.c Src/Zle/compresult.c
--- oldsrc/Zle/compresult.c Tue Nov 2 12:02:11 1999
+++ Src/Zle/compresult.c Tue Nov 2 14:25:17 1999
@@ -1042,7 +1042,7 @@
} else {
if (oldlist) {
if (oldins && minfo.cur)
- acceptlast();
+ accept_last();
} else
minfo.cur = NULL;
}
@@ -1798,10 +1798,11 @@
q = skipnolist(q + 1);
mc++;
}
- while (i-- > 0)
- printm(g, NULL, mc++, ml, (!i),
+ while (i-- > 0) {
+ printm(g, NULL, mc, ml, (!i),
(g->widths ? g->widths[mc] : g->width), NULL, NULL);
-
+ mc++;
+ }
if (n) {
putc('\n', shout);
ml++;
diff -u -r oldsrc/Zle/computil.c Src/Zle/computil.c
--- oldsrc/Zle/computil.c Tue Nov 2 12:02:11 1999
+++ Src/Zle/computil.c Tue Nov 2 14:41:30 1999
@@ -1035,7 +1035,7 @@
state.optbeg = state.argbeg = state.inopt = cur;
state.singles = (!pe || !*pe);
- for (p = line + 1; p <= pe; p++) {
+ for (p = line + 1; p < pe; p++) {
if ((tmpopt = d->single[STOUC(*p)])) {
PERMALLOC {
state.oargs[tmpopt->num] = newlinklist();
diff -u -r oldcompletion/User/_urls Completion/User/_urls
--- oldcompletion/User/_urls Mon Nov 1 09:03:08 1999
+++ Completion/User/_urls Tue Nov 2 14:33:40 1999
@@ -37,7 +37,7 @@
# name used by a user placing web pages within their home area.
# e.g. compconf urls_localhttp=www:/usr/local/apache/htdocs:public_html
-local ipre scheme host user hosts ret=1 expl
+local ipre scheme host user uhosts ret=1 expl
local urls_path="${compconfig[urls_path]:-${ZDOTDIR:-$HOME}/.zsh/urls}"
local localhttp_servername="${${(@s.:.)compconfig[urls_localhttp]}[1]}"
local localhttp_documentroot="${${(@s.:.)compconfig[urls_localhttp]}[2]}"
@@ -93,10 +93,11 @@
# Complete hosts
if ! compset -P '(#b)([^/]#)/'; then
- hosts=($urls_path/$scheme/$PREFIX*$SUFFIX(/:t))
- (( $#hosts )) || _hosts -S/ && ret=0
- [[ "$scheme" = http ]] && hosts=($hosts $localhttp_servername)
- compadd "$@" -QS/ - $hosts && ret=0
+ uhosts=($urls_path/$scheme/$PREFIX*$SUFFIX(/:t))
+ (( $#uhosts )) || _hosts -S/ && ret=0
+ [[ "$scheme" = http ]] && uhosts=($uhosts $localhttp_servername)
+ _description expl host
+ compadd "$expl[@]" "$@" -QS/ - $uhosts && ret=0
return $ret
fi
host="$match[1]"
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author