zsh-workers
 help / color / mirror / code / Atom feed
* bindkey -s problem in 3.1.1
@ 1997-03-03  9:42 Peter Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 1997-03-03  9:42 UTC (permalink / raw)
  To: Zsh hackers list

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?

-- 
Peter Stephenson <pws@ifh.de>       Tel: +49 33762 77366
WWW:  http://www.ifh.de/~pws/       Fax: +49 33762 77413
Deutsches Elektronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen
DESY-IfH, 15735 Zeuthen, Germany.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: bindkey -s problem in 3.1.1
@ 1997-03-04 19:06 Zefram
  0 siblings, 0 replies; 2+ messages in thread
From: Zefram @ 1997-03-04 19:06 UTC (permalink / raw)
  To: Z Shell workers mailing list

-----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-----


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1997-03-04 19:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-03-03  9:42 bindkey -s problem in 3.1.1 Peter Stephenson
1997-03-04 19:06 Zefram

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).