Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: 3.0.5 Re: Weird bug with "bindkey"



> Here's a patch for 3.1, which simply replaces zerrnam() with
> zwarnnam() everywhere in zle_keymap.c (the unidiff was very much
> shorter so I've sent that, but mail me if you need a context diff).
> 
> Looks like I've got 3.0.x lying around, so I'll dig out a patch for
> that, too.

This is the corresponding patch.  Key binding was rather simpler, so
it's shorter.  One of the errors was a zerr() instead of a zerrnam(),
which are not usually used in builtins.  I've just assumed that was an
inconsistency. (Goodness!  An inconsistency in zsh!  Whatever next, a
stone in the Great Wall of China??)

If you're looking around, you'll notice other zerr()'s in zle_main.c
haven't been touched, because they're part of the editor itself, not
bindkey, so they really should abort back to main command level.  I
think.  All zerr/zerrnam vs. zwarnnam in the shell are potentially
negotiable (although builtins should certainly have zwarnnam(), as
here).

--- Src/zle_main.c.warn	Fri Sep 26 03:42:19 1997
+++ Src/zle_main.c	Wed Mar 25 10:29:02 1998
@@ -888,12 +888,12 @@
     int i, *tab;
 
     if (ops['v'] && ops['e']) {
-	zerrnam(name, "incompatible options", NULL, 0);
+	zwarnnam(name, "incompatible options", NULL, 0);
 	return 1;
     }
     if (ops['v'] || ops['e'] || ops['d'] || ops['m']) {
 	if (*argv) {
-	    zerrnam(name, "too many arguments", NULL, 0);
+	    zwarnnam(name, "too many arguments", NULL, 0);
 	    return 1;
 	}
 	if (ops['d']) {
@@ -962,7 +962,7 @@
 		func = (ky = (Key) keybindtab->getnode(keybindtab, s)) ? ky->func
 		    : z_undefinedkey;
 	    if (func == z_undefinedkey) {
-		zerrnam(name, "in-string is not bound", NULL, 0);
+		zwarnnam(name, "in-string is not bound", NULL, 0);
 		zfree(s, len);
 		return 1;
 	    }
@@ -1022,7 +1022,7 @@
 		if (!strcmp(*argv, zlecmds[i].name))
 		    break;
 	    if (i == ZLECMDCOUNT) {
-		zerr("undefined function: %s", *argv, 0);
+		zwarnnam(name, "undefined function: %s", *argv, 0);
 		zfree(s, len);
 		return 1;
 	    }

-- 
Peter Stephenson <pws@xxxxxx>       Tel: +39 50 844536
WWW:  http://www.ifh.de/~pws/
Gruppo Teorico, Dipartimento di Fisica
Piazza Torricelli 2, 56100 Pisa, Italy



Messages sorted by: Reverse Date, Date, Thread, Author