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

Emacs20: problem redefining umlaut-keys



Hi,

I've got some problems using Emacs 20 with my Debian/GNU Linux system
(potato): In my .emacs I have the following lines:

-------8<----------(snip,snip)----------8<--------------------
(defun my-c-mode-common-hook ()
  (define-key c-mode-map [?ä] "]")     ; a-umlaut -> ]
  (define-key c-mode-map [?ö] "[")     ; o-umlaut -> [
  (define-key c-mode-map [?ü] "\\")    ; u-umlaut -> \
  (define-key c-mode-map [?Ä] "}")     ; A-umlaut -> }
  (define-key c-mode-map [?Ö] "{")     ; O-umlaut -> {
  (define-key c-mode-map [?Ü] "|")     ; U-umlaut -> |
  )

(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)
-------8<----------(snip,snip)----------8<--------------------

I do this to redefine my umlaut-keys (german keyboard layout) when
editing C/C++-Sources (where I do not need umlauts).

With Emacs 19 this works.  With Emacs 20 it does not.

The problem seems to be tricky:  I can redefine umlaut-keys using 
`M-x global-set-key`, but I can not do it with (global-set-key ...) in
my .emacs.

When I have the lines above in my .emacs and open a file "ha.c" with
Emacs 19, C-h v c-mode-map gives me: 
(keymap 
   (220 . "|") (196 . "}") (214 . "{")
   (252 . "\\") (246 . "[") (228 . "]")
   ...                       ^^^^^^^^^
Doing the same thing with Emacs 20 gives:
(keymap
 (2268 . "|") (2262 . "{") (2244 . "}")
 (2300 . "\\") (2294 . "[") (2276 . "]")
 ...                         ^^^^^^^^^^

Very strange: The key "ä" gives octal code 344 = 228 decimal.
2276 decimal = 4344 octal = 344oct + 4000oct = 228dec + 2048dec.
Where does the 2048 come from?

Does anybody of you (with a german keyboard, of course) have the same
problem? If not, could you please send me your configuration
(environment settings, version numbers of emacs etc., .emacs) via email?
I already asked in different newsgroups but got no solution.

Thanks in advance

  Jonas

-- 
 "OS/2?  Hah.  I've got Linux.  What a cool name"  (Linus Torvalds)


Reply to: