14

I'm using emacs23 on Ubuntu 32-bit 10.04/10.10 with GNOME and Compiz.

Pressing M-RET in an org-mode plain list in Emacs (GUI) inserts a new item. Pressing M-Up moves the item up in the list.

These keys don't work as expected in emacs -nw under Terminator and gnome-terminal. The M-Up key does nothing, whereas the M-RET key simply moves the cursor down one line and indents the position. The keys also don't "work" in xterm, which inserts \215 instead. Pressing ESC-RET or ESC-Up instead produces the expected functionality. The same problems exist if I run emacs -nw on a headless server accessed via ssh under Terminator, gnome-terminal and xterm.

I've searched both generally and on the org-mode Gmane list for an answer to this, but have not found anything. Is this a known issue with org-mode or is it related to the terminal emulator and/or the Window Manager?

itsjeyd
  • 5,070
  • 2
  • 30
  • 49
SabreWolfy
  • 5,392
  • 11
  • 50
  • 73

3 Answers3

5

In addition to the keys in my question, S-TAB, S-Left, S-Right, S-Up and S-Down were not working over ssh and PuTTY. Using certain keys on a TTY connection (ssh, screen, PuTTY) is a known issue.

Alternative keys are included in org-mode as detailed in 'Using Org on a TTY' in the org-mode manual.

bertieb
  • 168
  • 10
SabreWolfy
  • 5,392
  • 11
  • 50
  • 73
3

Alternative key combinations exist

for equivalent to M-RET M C-m "<return>" is the Return ↩ key while emacs runs in a graphical user interface.

"RET" is the Return ↩ key while emacs runs in a terminal.

"RET" is also equivalent to "C-m" (【Ctrl+m】). (http://ergoemacs.org/emacs/emacs_key_notation_return_vs_RET.html)

as equivalents for M-<up/down> you can use

ESC-<up>
ESC-<down>
user30619
  • 31
  • 1
2

The menubar of terminal emulator is not letting the M key that is meant for Emacs be passed down to Emacs. For Emacs to receive the M key as it is supposed to, you could either use the Esc or disable the menubar and use M key in Emacs as usual.

ADDED:

For the xterm, if you do CTRL+Mouse Button 1, you will see "Meta sends Escape". You need to make sure that option is checked/enabled to make M work as it should in Emacs.

vpit3833
  • 7,817
  • 2
  • 25
  • 25
  • @vpti3833: Thanks for the reply. How come `M-x` works in Emacs in Terminator/gnome-terminal? The `M` is getting through in this case. Disabling the menubar in gnome-terminal results in `M-UP` working, but not `M-RET`. – SabreWolfy Apr 06 '11 at 06:20
  • @SabreWolfy: `M-Ret` should be doing something in the terminal emulators, then. In xterm it toggles between fullscreen and windowed display. Not sure what it does in others, though. – vpit3833 Apr 06 '11 at 06:33
  • Thanks. I've looked at the keyboard shortcuts in GNOME itself and in the emulators. `M-RET` is not bound to anything. I'll have to look into it further. I'll also try setting up `xterm` as you suggest. – SabreWolfy Apr 06 '11 at 06:43