From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1552 invoked from network); 4 Mar 1997 19:15:22 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by coral.primenet.com.au with SMTP; 4 Mar 1997 19:15:22 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id OAA27891; Tue, 4 Mar 1997 14:04:16 -0500 (EST) Resent-Date: Tue, 4 Mar 1997 14:04:16 -0500 (EST) From: Zefram Message-Id: <24133.199703041906@stone.dcs.warwick.ac.uk> Subject: Re: bindkey -s problem in 3.1.1 To: zsh-workers@math.gatech.edu (Z Shell workers mailing list) Date: Tue, 4 Mar 1997 19:06:41 +0000 (GMT) X-Patch: 200 X-Loop: zefram@dcs.warwick.ac.uk X-Stardate: [-31]8973.98 X-Phase: The Moon is Waning Crescent (25% of Full) X-US-Congress: Moronic fuckers X-Personality: INTJ Content-Type: text Resent-Message-ID: <"yPfoD3.0.kp6.m877p"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/2951 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu -----BEGIN PGP SIGNED MESSAGE----- Peter wrote: >As far as I know, the user side of the zle code hasn't changed yet, but >I'm having problems: > >bindkey -s "^X^L" "^@" > >should make "^X^L" do set-mark-command, but actually it produces a >pound (sterling) sign on my keyboard. The sequence bound to doesn't >seem to matter. > >Is this a statement against European monetary union or a bug? Ah, you've seen through my cunning plan! Yes, I'm protesting against the unimaginative bureaucrats at Brussels -- I can think of much better names for a currency unit than "Euro". And its symbol isn't even in Unicode... There are actually two interacting bugs here, both in the new keymap code. (I knew it was looking too good to be true.) Firstly, when a send-string is pushed back, the start of the metafied string is pushed back, rather than the string itself. In this case, given the string "\0", the string "\203" (correct length prefix of "\203 ") is being pushed back. Secondly, when a metafiable character is read from the input buffer, the variable c (used in self-insert) is being set to the last character of the metafied form of the string being read, rather than the last character read. In this case, when "\203" is read, it is metafied as "\203\243", and c is set to '\243', which just happens to be the sterling sign in Latin-1. -zefram *** Src/Zle/zle_keymap.c 1997/01/29 03:25:45 1.8 --- Src/Zle/zle_keymap.c 1997/03/04 02:06:16 *************** *** 1146,1154 **** keybuf = realloc(keybuf, keybufsz *= 2); if(imeta(c)) { keybuf[keybuflen++] = Meta; ! c ^= 32; ! } ! keybuf[keybuflen++] = c; keybuf[keybuflen] = 0; return c; } --- 1146,1154 ---- keybuf = realloc(keybuf, keybufsz *= 2); if(imeta(c)) { keybuf[keybuflen++] = Meta; ! keybuf[keybuflen++] = c ^ 32; ! } else ! keybuf[keybuflen++] = c; keybuf[keybuflen] = 0; return c; } *************** *** 1187,1193 **** return NULL; } pb = unmetafy(ztrdup(str), &len); ! ungetkeys(str, len); zfree(pb, strlen(str) + 1); goto sentstring; } --- 1187,1193 ---- return NULL; } pb = unmetafy(ztrdup(str), &len); ! ungetkeys(pb, len); zfree(pb, strlen(str) + 1); goto sentstring; } -----BEGIN PGP SIGNATURE----- Version: 2.6.2 iQCVAwUBMxuHDXD/+HJTpU/hAQHKaQP8CEk9Sc8F31ZoeE1j6utDbvUfPaQCcFWF fMoKeRjgWMjramOuMTxa9zgLArhAJxZdb4bQwV7o7+5YMLkjmSCJBWbiQNOaLKhJ OfyhR/iPzSszh/qXWuDoDBO5HwtR25g7DAeoEhex6pHbXBMwoey3MR9b2cZCei4h 4YWhnngj70I= =4OGw -----END PGP SIGNATURE-----