0

Environment

My emacs is GNU Emacs 29.4. I use it in a terminal emulator, iTerm2. I am on macOS Sonoma 14.5.

Problem

M-RET, M-S-RET, M-LEFT, M-RIGHT does not do what is documented in the org mode guide, https://orgmode.org/guide/Structure-Editing.html.

Other than that, I can use my Left Option key like a Meta key. (an iTerm Setting allows that.)*

How can I achieve the set of the functionalities that is defined in the guide linked above?

Findings

  1. Checked what function the key combination bound to. C-h k M-RET yields ~3 in the buffer.

  2. However, M-x org-meta-return enters a new heading before that. So, the function is there and works.

  3. Checked what key the function is bound to C-h a org-meta-return shows a page M-RET is listed, but not unexpected C-RET as it seems to be working:

    org-meta-return C-c C-x m, C-c C-x RET, M-RET | Insert a new heading or wrap a region in a table.

  4. Also, M-RET, and M-S-RET functionality seems to work with C-RET, and C-S-RET instead, respectively: They add new heading and todo element after the heading where point is at.

Configuration

I do not have any org-mode specific configuration other than:

(global-set-key (kbd "C-c l") #'org-store-link)
(global-set-key (kbd "C-c a") #'org-agenda)
(global-set-key (kbd "C-c c") #'org-capture)

*Also I am aware that Esc key can always be used for Meta, although not as press and hold but press.

2 Answers 2

0

C-h k M-RET yields ~3 in the buffer.

You are running Emacs inside of a terminal emulator. You generally can’t use M-RET in a terminal emulator at all; under normal circumstances terminal emulators tend to emulate the DEC VT100 and subsequent terminals which had no use for that key combination.

Some terminal emulators do have extended escape sequences for many or all key combinations that cannot otherwise be represented, but they aren’t standard and aren’t common. If you use xterm, search the documentation for modifyOtherKeys. If you use some other terminal emulator then I can’t help you; you’ll have to consult its documentation on your own.

Or you could just run the Emacs gui like a normal person.

1
  • Yes, you are right that I am using a Terminal emulator. I want to use emacs in a Terminal emulator to be able to use it wherever a unix terminal is available without the need of a gui, like a normal text editor, e.g. vim. I don't agree on your last line.
    – sçuçu
    Commented Jul 31 at 21:50
0

In a terminal emulator, if you don't have a Meta key, instead of M-RET, you can use ESC RET and similarly for the arrow keys: ESC <right>, etc.

You cannot do everything you can do in the GUI, but you can go fairly far.

See Using Org on a TTY in the manual.

11
  • I have a Meta key. (iTerm2/Settings/Profiles/Keys/Left Option key: Esc+). Thank you for the manual section.
    – sçuçu
    Commented Aug 2 at 0:00
  • Actually, checked and see, ESC RET behaves as M-RET, and so does the ESC <right> or other arrow keys. Thanks!
    – sçuçu
    Commented Aug 2 at 0:06
  • I can't parse your comment: does that mean that ESC RET and the rest work according to the documentation or not?
    – NickD
    Commented Aug 2 at 1:10
  • ESC RET behaves as M-RET is documented to behave. ESC <right>, ESC <left> and ESC <up>, and ESC <down> behave as corresponding M correspondents are documented to behave. Thanks!
    – sçuçu
    Commented Aug 2 at 19:29
  • OK - thanks for clarifying. I still don't understand why you think you have a Meta key, if it's never passed to Emacs, but that's a mystery for another day. All I really care about is that the documentation is correct.
    – NickD
    Commented Aug 2 at 19:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.