M-RET and M-UP/DOWN not working in Emacs org-mode in console/terminal

独自空忆成欢 提交于 2019-12-03 16:20:59

问题


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?


回答1:


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 here.




回答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.




回答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>


来源:https://stackoverflow.com/questions/5556678/m-ret-and-m-up-down-not-working-in-emacs-org-mode-in-console-terminal

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!