tags:

views:

94

answers:

1

I want to bind "C-[" like so:

(define-key py-mode-map "\C-["  'py-shift-region-left)

The problem is, Emacs sees "C-[" as ESC. Am I missing something?

+6  A: 

Well, as it happens, "\C-[" and ESC are the same character. They are also being reported as the same by xkbwatch, which leads me to believe that X is reporting those keypresses to applications in the same way, so there's nothing to be done on the Emacs side of things. As for somehow making "\C-[" not act like ESC at a lower level, unfortunately I've no idea, I always considered it a pinky-saving feature.

Michał Marczyk
Note that I see the same *effect* using GNU Emacs on Windows, not involving X in any way. Remapping at the X level may offer a way around this problem, but it seems that Emacs has some assumptions built in that must be overcome as well.
seh
And the same effect on Linux console, too.
Wei Hu