Re: [Mac-emacs-users] [Mac-emacs-users]
Brought to you by:
akochoi
|
From: Steven T. <ste...@ma...> - 2002-10-03 16:31:49
|
It is mac specific (see the P.S.)
C-RET isn't recognized by the "carbon" mac distribution. This is
because the mac version treats RET as a standard ascii character and
not as a special "X Key Code". So when it tries to apply the ctrl to
RET is sees C-m and so interprets it as C-C-m. So the first C- is lost
The solution is to make RET appear to be a non-ascii character (then it
becomes <return>). This is what happens on X-windows as you have
noted. To do this, modify macterm.c:keycode_to_xkeysym_table[] to
start like this (where keycode 0x24 is mapped to Xkeysym 0xff0d)
static unsigned char keycode_to_xkeysym_table[] = {
/* 0x00 - 0x3f */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, '\x0d', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Then you need to have emacs recognize the the new key [return] is
actually C-m. So add these to lisp/term/mac-win.el or to your .emacs
file
(define-key function-key-map [return] [?\C-m])
(define-key function-key-map [M-return] [?\M-\C-m])
(put 'return 'ascii-character 13)
Should this be put in the main distribution? Should this be done for
other chars like escape and tab?
-Steven
P.S. These mailing lists are being deprecated. Look at
http://members.shaw.ca/akochoi-emacs/ for more information.
On Thursday, October 3, 2002, at 03:23 AM, Matthias Scheidegger wrote:
> Hi all,
>
> this might not be a mac-emacs specific question: Coming from
> Linux/Xemacs I tried to convert my hooks for various
> major modes. Changing (define-key c-mode-map ...) to (local-set-key
> ...) worked pretty well with the exception of the key combination
> Ctrl-Return. I figured this would be written
>
> (local-set-key "\C-\r" 'my-function)
>
> or
>
> (local-set-key [?\C-?\r] 'my-function)
>
> but neither worked. How can I get this to work?
>
> tnx
>
> Matthias
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Mac-emacs-users mailing list
> Mac...@li...
> https://lists.sourceforge.net/lists/listinfo/mac-emacs-users
|