all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Emacs does not distinguish between `æ' and `C-æ'
@ 2003-05-12 15:48 Jesper Harder
  2003-05-14 18:40 ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Jesper Harder @ 2003-05-12 15:48 UTC (permalink / raw)


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-æ'.


In GNU Emacs 21.3.1 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2003-04-28 on defun.localdomain
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.iso88591
  locale-coding-system: iso-latin-1
  default-enable-multibyte-characters: t

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

* Re: Emacs does not distinguish between `æ' and `C-æ'
  2003-05-12 15:48 Emacs does not distinguish between `æ' and `C-æ' Jesper Harder
@ 2003-05-14 18:40 ` Stefan Monnier
  2003-05-14 19:33   ` Emacs does not distinguish between `æ'and `C-æ' Andreas Schwab
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2003-05-14 18:40 UTC (permalink / raw)


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

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

* Re: Emacs does not distinguish between `æ'and `C-æ'
  2003-05-14 18:40 ` Stefan Monnier
@ 2003-05-14 19:33   ` Andreas Schwab
  0 siblings, 0 replies; 3+ messages in thread
From: Andreas Schwab @ 2003-05-14 19:33 UTC (permalink / raw)
  Cc: bug-gnu-emacs

"Stefan Monnier" <monnier+gmane.emacs.bugs/news/@rum.cs.yale.edu> writes:

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

It seems comment and code aren't in line.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

end of thread, other threads:[~2003-05-14 19:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-12 15:48 Emacs does not distinguish between `æ' and `C-æ' Jesper Harder
2003-05-14 18:40 ` Stefan Monnier
2003-05-14 19:33   ` Emacs does not distinguish between `æ'and `C-æ' Andreas Schwab

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.