[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Difference between GUI/terminal when using "kbd" macro

From: Stefan Monnier
Subject: Re: Difference between GUI/terminal when using "kbd" macro
Date: Tue, 19 Feb 2013 08:32:41 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

>   (global-set-key [?\C-x ?\e] 'save-buffers-kill-emacs)
>   (global-set-key (kbd "C-x <escape>") 'save-buffers-kill-emacs)

The escape key usually is linked to the escape char, but the two
are different.  Under a tty, Emacs receives the exact same byte-sequence
from the terminal if you type the escape key or if you type C-[ (both
send the escape char).
Under a GUI, on the other hand, Emacs can distinguish the two, so under
a GUI, the escape key doesn't send `?\e' (aka ESC for kbd) but `escape'
(aka <escape> for kbd) which is usually turned into a ?\e via
function-key-map (i.e. only if there's no corresponding binding for the
key sequence with `escape').

Same thing happens with tab (i.e. TAB (aka C-i) vs tab) and return
(i.e. RET (aka C-m) vs return).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]