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

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

Re: Emacs does not distingui sh between `æ' and `C-æ'


From: Stefan Monnier
Subject: Re: Emacs does not distingui sh between `æ' and `C-æ'
Date: 14 May 2003 14:40:54 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

> My Danish keyboard has an `æ' key.  In Emacs 21.2 `æ' and `C-æ' were
> recognized as different key sequences:
> (read-key-sequence "")  Input: æ  =>   [230]
> (read-key-sequence "")  Input: C-æ  => [134]
> This is no longer the case in Emacs 21.3 (and cvs head):
> (read-key-sequence "")  Input: æ  =>   [2278]
> (read-key-sequence "")  Input: C-æ  => [2278]
> This means that I can only bind `æ', but not `C-æ'.

I think this is due to the fact that Emacs ignores modifiers on
multibyte-char keys.  It worked before because your key was not recognized
as a multibyte-char key (it was only converted to the proper latin-1 char
when inserting the char in the buffer).  But by fixing this bug, I bumped
into the limitation you're seeing.

The patch below should fix it (applied to both branches).


        Stefan


Index: keyboard.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/keyboard.c,v
retrieving revision 1.741
diff -u -r1.741 keyboard.c
--- keyboard.c  10 May 2003 22:15:35 -0000      1.741
+++ keyboard.c  14 May 2003 18:38:00 -0000
@@ -5013,8 +5013,15 @@
     case MULTIBYTE_CHAR_KEYSTROKE_EVENT:
       {
        Lisp_Object lispy_c;
+       int c = event->code;
 
-       XSETFASTINT (lispy_c, event->code);
+       /* Add in the other modifier bits.  We took care of ctrl_modifier
+          just above, and the shift key was taken care of by the X code,
+          and applied to control characters by make_ctrl_char.  */
+       c |= (event->modifiers
+             & (meta_modifier | alt_modifier
+                | hyper_modifier | super_modifier | ctrl_modifier));
+       XSETFASTINT (lispy_c, c);
        return lispy_c;
       }
 





reply via email to

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