emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Euro sign bound, Pound sign not bound. (Bug?)


From: Kim F. Storm
Subject: Re: Euro sign bound, Pound sign not bound. (Bug?)
Date: Mon, 07 May 2007 17:35:16 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.98 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>> (t 342604 self-insert-command)
> [...]
>> (t 2211 nil)
>
>> or generically: (key-binding (vector (string-to-char "£")) t)  ->
>> self-insert-command
>> (key-binding "£" t)  -> nil
>
>> So, it seems to be a problem with the string specification of the key.
>
> Oh, it rings a bell: IIRC key-sequences specified as strings are presumed to
> be "sequences of bytes" (because the use of a string was introduced when
> those key-sequences could only come from a tty).  So they do not behave
> correctly in the presence of non-ASCII chars.
>
> The patch below seems to fix the problem.
>
>
>         Stefan
>
>
> --- keymap.c  04 avr 2007 10:34:26 -0400      1.350
> +++ keymap.c  07 mai 2007 11:17:18 -0400      
> @@ -1155,7 +1155,8 @@
>    if (SYMBOLP (def) && !EQ (Vdefine_key_rebound_commands, Qt))
>      Vdefine_key_rebound_commands = Fcons (def, Vdefine_key_rebound_commands);
>  
> -  meta_bit = VECTORP (key) ? meta_modifier : 0x80;
> +  meta_bit = (VECTORP (key) || STRINGP (key) && STRING_MULTIBYTE (key)

Please add parentheses to clarify precedence here.

> +           ? meta_modifier : 0x80);
>  
>    if (VECTORP (def) && ASIZE (def) > 0 && CONSP (AREF (def, 0)))
>      { /* DEF is apparently an XEmacs-style keyboard macro.  */
> @@ -1311,7 +1312,7 @@
>       c = Fevent_convert_list (c);
>  
>        /* Turn the 8th bit of string chars into a meta modifier.  */
> -      if (INTEGERP (c) && XINT (c) & 0x80 && STRINGP (key))
> +      if (STRINGP (key) && XINT (c) & 0x8 && !STRING_MULTIBYTE (key))

Shouldn't that be 0x80 ?

>       XSETINT (c, (XINT (c) | meta_modifier) & ~0x80);
>  
>        /* Allow string since binding for `menu-bar-select-buffer'

-- 
Kim F. Storm <address@hidden> http://www.cua.dk





reply via email to

[Prev in Thread] Current Thread [Next in Thread]