all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ben Bacarisse <ben.lists@bsb.me.uk>
To: help-gnu-emacs@gnu.org
Subject: Re: Fwd: C-[ is undefined
Date: Fri, 27 Jul 2018 17:19:15 +0100	[thread overview]
Message-ID: <87muuc3b3w.fsf@bsb.me.uk> (raw)
In-Reply-To: mailman.4322.1532697888.1292.help-gnu-emacs@gnu.org

John Shahid <jvshahid@gmail.com> writes:

> Ben Bacarisse <ben.lists@bsb.me.uk> writes:
>
>
> [...]
>
>>>>> Short story: ~C-x @ c [~ results in "C-[ is undefined" but I expected
>>>>> it to be the Meta prefix like in for example ~C-[ t~ for ~M-t~.
>>>>
>>>> I would expect C-x @ c [ to be the same as C-[
>>>
>>> Did you try? For me it is not the same which is what I wanted to say
>>> in the first place.
>>
>> Yes, I tried it, but my interpretation of the result ("C-[" is
>> undefined) was that C-x @ c [ was a way to generate a "key" that could
>> not otherwise be typed.
>>
>> That's kind of what happens.  For example, you can bind C-[ this way and
>> still use C-[ to get the ESC- prefix.
>>
>> However, that seems like an unlikely explanation!  It is probably
>> something to do with translated key sequences.  ESC and C-[ are not
>> exactly the same, but I am not expert enough to explain the way in which
>> they differ.
>
> I think there is an implicit assumption in this thread that Emacs is
> receiving key press events for both the 'Control' and '[' keys.  I tried
> this on my system using 'xev' and it receives a KeyPress event for
> 'Control' but as soon as I hit '[' the window receives a KeyPress event
> for Escape (i.e. '0x1b').  My conclusion is that Emacs doesn't even know
> that you pressed 'C-['.

Not here.  xev shows Control_L down, [ down, [ up, Control_l up.  Odd
difference.

> You can probably achieve the same result by translating 'C-[' to
> 'Escape' in the 'key-translation-map'.  This map is used after
> 'local-function-key-map' where the 'event-apply-control-modifier'
> applies the control modifier.  Another idea is to add an advice to
> 'event-apply-control-modifier'.

I thought it might be an interaction between translation maps and
others.

-- 
Ben.


  parent reply	other threads:[~2018-07-27 16:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-07 19:52 C-[ is undefined Michael Brand
2018-07-26  2:00 ` Fwd: " Michael Brand
     [not found] ` <mailman.4231.1532570417.1292.help-gnu-emacs@gnu.org>
2018-07-26 12:38   ` Ben Bacarisse
2018-07-27  0:17     ` Michael Brand
     [not found]     ` <mailman.4284.1532650678.1292.help-gnu-emacs@gnu.org>
2018-07-27  1:33       ` Ben Bacarisse
2018-07-27 13:24         ` John Shahid
     [not found]         ` <mailman.4322.1532697888.1292.help-gnu-emacs@gnu.org>
2018-07-27 16:19           ` Ben Bacarisse [this message]
2018-07-27 13:12 ` Noam Postavsky
2018-07-27 20:38   ` Stefan Monnier
2018-07-28 23:40   ` Michael Brand
2018-08-19 16:02     ` Michael Brand
2018-08-19 16:12       ` Stefan Monnier
2018-08-19 17:01       ` Michael Brand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87muuc3b3w.fsf@bsb.me.uk \
    --to=ben.lists@bsb.me.uk \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.