help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Ctrl-[ ?


From: Noam Postavsky
Subject: Re: Ctrl-[ ?
Date: Fri, 7 Jun 2019 09:54:59 -0400

On Fri, 7 Jun 2019 at 09:23, Jean-Christophe Helary
<jean.christophe.helary@traduction-libre.org> wrote:

> (define-key input-decode-map "\C-[" [C-left-bracket])

> I still don't understand where that "left-bracket" comes from so if you could 
> explain that would be extra nice.

It's just an arbitrary symbol choice, you can choose a different one
if you like.

(define-key input-decode-map "\C-[" [C-open-square])
(define-key global-map [C-open-square] 'forward-char)

So if I understand correctly, what happens is that Emacs gets Ctrl+[
from the windowing system, translates that into the ASCII ESC
character (aka 27, aka #x1B, aka ^[, aka \C-[). Then runs it through
input-decode-map which translates it to C-open-square like we told it
to. And then we can use C-open-square in keybindings as normal.



reply via email to

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