zsh-workers
 help / color / mirror / code / Atom feed
From: Zefram <zefram@dcs.warwick.ac.uk>
To: zsh-workers@math.gatech.edu (Z Shell workers mailing list)
Subject: Re: bindkey -s problem in 3.1.1
Date: Tue, 4 Mar 1997 19:06:41 +0000 (GMT)	[thread overview]
Message-ID: <24133.199703041906@stone.dcs.warwick.ac.uk> (raw)

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


             reply	other threads:[~1997-03-04 19:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-03-04 19:06 Zefram [this message]
  -- strict thread matches above, loose matches on Subject: below --
1997-03-03  9:42 Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=24133.199703041906@stone.dcs.warwick.ac.uk \
    --to=zefram@dcs.warwick.ac.uk \
    --cc=zsh-workers@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).