unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* emacs 21.4: can't bind umlaut keys
@ 2007-07-07  9:55 Peter Daum
  2007-07-07 15:24 ` Peter Dyballa
  2007-07-09 13:35 ` Representation of non-ascii keys in emacs? Peter Daum
  0 siblings, 2 replies; 3+ messages in thread
From: Peter Daum @ 2007-07-07  9:55 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

I am using a German keyboard, but usually write languages like "Perl"
at least as often as "German" and with the standard German keyboard
layout chars like "[]{}" are difficult to reach.

 Therefore, I had already long time ago written some ELisp code to
switch the binding of the umlaut keys between different sets of
keykbindings according to my current needs. Unfortunately, it is a
little tricky to refer to those keys in emacs lisp (and the exact
modalities changed a little since emacs 19).

Now after migrating my systems from Suse (9.3) to Debian (Etch), or,
as far as emacs is concerned, from version 21.3 to 21.4 my key bindings
don't work anymore and I can't figure out, what changed.

Here a minimal code snippet to illustrate the problem:

(defun latin1-to-emacs (char-code)
  (make-char 'latin-iso8859-1 (- char-code 128)))
(setq c_ae (latin1-to-emacs 228))
(local-set-key (make-vector 1 c_ae) "ae")

This should bind the key labeled "ä" to instead insert "ae". technically,
it still works on emacs 21.4 in Etch ((current-local-map) indicates the
change) but the key still produces "ä".
Some side notes:
- Emacs is running in unibyte mode
- The X server or the console driver (the problem is not X-related,
  on the console it's the same) produce the expected key event:
    state 0x0, keycode 48 (keysym 0xe4, adiaeresis), same_screen YES,
    XLookupString gives 1 bytes: (e4) "ä"
    XmbLookupString gives 1 bytes: (e4) "ä"

Anybody has any idea, what is going wrong?
Help would be greatly appreciated!

Regards,
                            Peter Daum

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

* Re: emacs 21.4: can't bind umlaut keys
  2007-07-07  9:55 emacs 21.4: can't bind umlaut keys Peter Daum
@ 2007-07-07 15:24 ` Peter Dyballa
  2007-07-09 13:35 ` Representation of non-ascii keys in emacs? Peter Daum
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Dyballa @ 2007-07-07 15:24 UTC (permalink / raw)
  To: Peter Daum; +Cc: help-gnu-emacs


Am 07.07.2007 um 11:55 schrieb Peter Daum:

> Help would be greatly appreciated!

You could add in X11 key bindings that are valid with an X11  
modifier, the alt key for example.

I don't understand your Elisp code; is GNU Emacs still getting the  
same "input?" C-h k <key> or C-q <key> might give hints ...

--
Mit friedvollen Grüßen

   Pete                           <]
              o        __o         |__    o       HPV, the real
     ___o    /I       -\<,         |o \  -\),-%     high speed!
___/\ /\___./ \___...O/ O____.....`-O-'-()--o_________________

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

* Representation of non-ascii keys in emacs?
  2007-07-07  9:55 emacs 21.4: can't bind umlaut keys Peter Daum
  2007-07-07 15:24 ` Peter Dyballa
@ 2007-07-09 13:35 ` Peter Daum
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Daum @ 2007-07-09 13:35 UTC (permalink / raw)
  To: help-gnu-emacs; +Cc: debian-emacsen

Hi,

Peter Daum wrote:

> Here a minimal code snippet to illustrate the problem:
> 
> (defun latin1-to-emacs (char-code)
>   (make-char 'latin-iso8859-1 (- char-code 128)))
> (setq c_ae (latin1-to-emacs 228))
> (local-set-key (make-vector 1 c_ae) "ae")
> 
> This should bind the key labeled "ä" to instead insert "ae". technically,
> it still works on emacs 21.4 in Etch ((current-local-map) indicates the
> change) but the key still produces "ä".


as I could meanwhile figure out, in the Debian Emacs21, the key labeled
"ä" is represented just by its iso8859-1 value (as also generally has been the
case for emacs versions before 21), so the example above could be simply:

   (local-set-key (make-vector 1 228) "ae")

But as far as I can see, this is only for the Debian emacs21 package (and I
still could not figure out, which modification is responsible for that) while
all other emacsens I tried (including version 22.1) still need

   (make-char 'latin-iso8859-1 (- char-code 128)

to get the emacs representation of a given iso8859-1 value.

Does anybody know what is going on here? Is this just a configuration option
set differently in Debian emacs? Is there any simpler/more portable way to
bind non-ascii keys?


Regards,
                        Peter Daum

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

end of thread, other threads:[~2007-07-09 13:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-07  9:55 emacs 21.4: can't bind umlaut keys Peter Daum
2007-07-07 15:24 ` Peter Dyballa
2007-07-09 13:35 ` Representation of non-ascii keys in emacs? Peter Daum

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 read-only IMAP folder(s) and NNTP newsgroup(s).