Emacs: Key Notation <return> vs RET

By Xah Lee. Date: . Last updated: .

"<return>" vs "RET"

"<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). [see Emacs Key Syntax Explained]

if you define:

(global-set-key (kbd "<return>") 'backward-char)

and run emacs in terminal, your keybinding will have no effect.

you need to use:

(global-set-key (kbd "RET") 'backward-char)

But the problem is, by binding (kbd "RET"), you are also binding (kbd "C-m"), regardless you run emacs in terminal or GUI.

"<tab>" vs "TAB"

Same situation for "<return>" vs "RET".

Also, "ESC" is the same as "C-[".

Put $5 at https://www.patreon.com/xahlee , or goto paypal.com and pay to Xah@XahLee.org . Message me on XahLee discord, say so, ask me questions.
Or Buy Xah Emacs Tutorial

Emacs Tutorial

Emacs Init

Emacs Keys

ELisp

ELisp Examples

ELisp Write Major Mode


Emacs Keys

Overview

How-To

Key Tips

Emacs Pinky

Keybinding Design

Misc