From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11070 invoked from network); 25 Mar 1998 09:52:34 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 25 Mar 1998 09:52:34 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id EAA15530; Wed, 25 Mar 1998 04:46:14 -0500 (EST) Resent-Date: Wed, 25 Mar 1998 04:46:14 -0500 (EST) Message-Id: <199803250945.KAA03714@hydra.ifh.de> To: zsh-workers@math.gatech.edu Subject: PATCH: 3.0.5 Re: Weird bug with "bindkey" In-reply-to: "Peter Stephenson"'s message of "Wed, 25 Mar 1998 10:23:23 MET." <199803250923.KAA26983@hydra.ifh.de> Date: Wed, 25 Mar 1998 10:45:32 +0100 From: Peter Stephenson Resent-Message-ID: <"ZfJsS2.0.bo3.b9D6r"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/3816 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu > 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 Tel: +39 50 844536 WWW: http://www.ifh.de/~pws/ Gruppo Teorico, Dipartimento di Fisica Piazza Torricelli 2, 56100 Pisa, Italy