all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* return and enter keys in emacs 21.3 on MacOSX 10.2
@ 2003-01-16 17:41 Tiago Henriques
  2003-01-16 20:02 ` Kai Großjohann
  0 siblings, 1 reply; 6+ messages in thread
From: Tiago Henriques @ 2003-01-16 17:41 UTC (permalink / raw)


Hi,

I'm using emacs 21.3.50.5 with MacOSX 10.2.3 (Jaguar, update 3).
Unfortunately I'm having a bit of a problem with, since my Return key
doesn't seem to work correctly under Jaguar. Using my 500MHz iBook,
the only way I can make it work is by pressing Fn-Return or Ctrl-M,
which is annoying. Using an external USB  keyboard I still have the
same problem, the only difference being that the KeyPad Enter key
seems to be recognized as return.

I understand that these 2 separate keys correspond to 2 different
keycodes, and usually are associated with the following ascii
characters:

Return: ascii 13
Enter: ascii 3

It seems emacs is only accepting ascii 3 for Return, instead of
accepting 13 or both. How can I configure my .emacs file so that it
maps Return to Enter, making the  Return key emit ascii 3? Or am I
looking at it the wrong way?

I've googled for the answer for one and a half days, and was unable to
find a solution.

Thanks in advance for any advice,

Tiago Henriques

PS: In case of doubt, here is my .emacs file:

(setq mac-command-key-is-meta nil)
(global-set-key [(alt v)] 'yank)
(global-set-key [(alt c)] 'kill-ring-save)
(global-set-key [(alt x)] 'kill-region)
(global-set-key [(alt q)] 'save-buffers-kill-emacs)
(global-set-key [(alt z)] 'undo)

(setq load-path (cons "~/Documents/emacs/" load-path))
(setq load-path (cons "~/Documents/emacs/rozenberg/" load-path))
(setq auto-mode-alist
      (cons '("\\.py$" . python-mode) auto-mode-alist))
(setq interpreter-mode-alist
      (cons '("python" . python-mode)
            interpreter-mode-alist))
(autoload 'python-mode "python-mode" "Python editing mode." t)
(add-hook 'python-mode-hook
          '(lambda ()
                 (define-key py-mode-map "\C-c\C-c" 'py-execute-prog)
                 (define-key py-mode-map "\C-c\C-g" 'py-call-pdb)
                 (define-key py-mode-map "\C-c\C-w" 'pychecker)))
(load "py-mode-ext.el")                                               
         ;;; add these lines if you like color-based syntax
highlighting
(global-font-lock-mode t)
(setq font-lock-maximum-decoration t)

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

* Re: return and enter keys in emacs 21.3 on MacOSX 10.2
  2003-01-16 17:41 return and enter keys in emacs 21.3 on MacOSX 10.2 Tiago Henriques
@ 2003-01-16 20:02 ` Kai Großjohann
  2003-01-17 11:52   ` Tiago Henriques
  0 siblings, 1 reply; 6+ messages in thread
From: Kai Großjohann @ 2003-01-16 20:02 UTC (permalink / raw)


Are you running Emacs under a window system (Aqua in this case, I
guess)?

What does C-h l print after you hit the return key?

What does C-h c <return> print?

What do C-h l and C-h c show for the "other" return key?
-- 
Ambibibentists unite!

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

* Re: return and enter keys in emacs 21.3 on MacOSX 10.2
  2003-01-16 20:02 ` Kai Großjohann
@ 2003-01-17 11:52   ` Tiago Henriques
  2003-01-17 15:19     ` Tiago Henriques
  2003-01-17 15:45     ` Benjamin Riefenstahl
  0 siblings, 2 replies; 6+ messages in thread
From: Tiago Henriques @ 2003-01-17 11:52 UTC (permalink / raw)


kai.grossjohann@uni-duisburg.de (Kai Großjohann wrote in message news:<84ptqwn9r4.fsf@lucy.is.informatik.uni-duisburg.de>...
> Are you running Emacs under a window system (Aqua in this case, I
> guess)?
> 
> What does C-h l print after you hit the return key?
> 
> What does C-h c <return> print?
> 
> What do C-h l and C-h c show for the "other" return key?

C-h c <return>:
<return> is undefined

C-h c <keypad enter>:
RET (translated from <kp-enter>) runs the command newline

After I type these 2 commands, C-h l shows:
(...) C-h c <return> C-h c <kp-enter> C-h l

It seems that the return key is unassigned. How can I assign it to run
the command newline, similarly to the keypad-enter key?

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

* Re: return and enter keys in emacs 21.3 on MacOSX 10.2
  2003-01-17 11:52   ` Tiago Henriques
@ 2003-01-17 15:19     ` Tiago Henriques
  2003-01-17 15:45     ` Benjamin Riefenstahl
  1 sibling, 0 replies; 6+ messages in thread
From: Tiago Henriques @ 2003-01-17 15:19 UTC (permalink / raw)


> It seems that the return key is unassigned. How can I assign it to run
> the command newline, similarly to the keypad-enter key?

I added the following line to my .emacs file:

(global-set-key [return] 'newline)

and now I can use the main keyboard's <return> key as normal when
typing in a standard buffer. However, when I use the mini-buffer (e.g.
when visiting a file with C-x C-f) it doesn't seem to work, while both
C-m amd <keypad enter> do work.

It seems that instead of assigning the command "newline" to the return
key I need to translate <return> to RET, as emacs is apparently
already doing with <keypad enter>:

C-h c <keypad enter>:
RET (translated from <kp-enter>) runs the comand newline

How can I do this translation?

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

* Re: return and enter keys in emacs 21.3 on MacOSX 10.2
  2003-01-17 11:52   ` Tiago Henriques
  2003-01-17 15:19     ` Tiago Henriques
@ 2003-01-17 15:45     ` Benjamin Riefenstahl
  2003-01-19 22:12       ` Tiago Henriques
  1 sibling, 1 reply; 6+ messages in thread
From: Benjamin Riefenstahl @ 2003-01-17 15:45 UTC (permalink / raw)


Hi Tiago,


tiagohenriques@lycos.co.uk (Tiago Henriques) writes:
> C-h c <return>:
> <return> is undefined
> 
> C-h c <keypad enter>:
> RET (translated from <kp-enter>) runs the command newline
> 
> After I type these 2 commands, C-h l shows:
> (...) C-h c <return> C-h c <kp-enter> C-h l
> 
> It seems that the return key is unassigned. How can I assign it to run
> the command newline, similarly to the keypad-enter key?

Been there recently.  I think this should help:

  (define-key function-key-map [return] [?\C-m])

OTOH, I copied this line from lisp/term/mac-win.el, and that file
should be loaded on Emacs startup, as I understand it.


so long, benny

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

* Re: return and enter keys in emacs 21.3 on MacOSX 10.2
  2003-01-17 15:45     ` Benjamin Riefenstahl
@ 2003-01-19 22:12       ` Tiago Henriques
  0 siblings, 0 replies; 6+ messages in thread
From: Tiago Henriques @ 2003-01-19 22:12 UTC (permalink / raw)


Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de> wrote in message
> tiagohenriques@lycos.co.uk (Tiago Henriques) writes:
> > It seems that the return key is unassigned. How can I assign it to run
> > the command newline, similarly to the keypad-enter key?
> 
> Been there recently.  I think this should help:
> 
>   (define-key function-key-map [return] [?\C-m])

Great tip! That one line seems to have solved the problem. Thanks a lot!

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

end of thread, other threads:[~2003-01-19 22:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-16 17:41 return and enter keys in emacs 21.3 on MacOSX 10.2 Tiago Henriques
2003-01-16 20:02 ` Kai Großjohann
2003-01-17 11:52   ` Tiago Henriques
2003-01-17 15:19     ` Tiago Henriques
2003-01-17 15:45     ` Benjamin Riefenstahl
2003-01-19 22:12       ` Tiago Henriques

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.