all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Stephen J. Turnbull" <stephen@xemacs.org>
To: Craig Muth <craig.muth@gmail.com>
Cc: Emacs-Devel devel <emacs-devel@gnu.org>
Subject: Escape key as C-g
Date: Tue, 05 Aug 2014 10:03:46 +0900	[thread overview]
Message-ID: <87iom7lpcd.fsf@uwakimon.sk.tsukuba.ac.jp> (raw)
In-Reply-To: <CAA0bO3FBSLZO2B814oz2_yy8_5Ps+ifnPJUs0xDxVmEbre2fNg@mail.gmail.com>

Craig Muth writes:

 > Regarding making the Escape key behave like C-g, this seems to work
 > fine in GUI emacs, but not terminal emacs:
 > 
 >   (define-key key-translation-map "\e" (kbd "C-g"))
 > 
 > Anyone know of some sort of settings change or other I could make to
 > get this to work in emacs running in a terminal?

There aren't any, if your definition of "work" includes "doesn't break
the function keys, the arrow keys, and pretty much everything that
isn't an ASCII character or control function".  (That last is an
exaggeration, but the breakage will indeed be widespread.)

The difference with the GUI is that in a GUI, Emacs has direct (well,
OS-level) access to the keyboard.  In TTY mode, on the other hand,
Emacs does not have access to the keyboard.  It has an input stream of
octets which may be generated by a keyboard, and conventionally all
but a few functions (basically, BEL, TAB, CR, LF, and ESC) are
represented by control sequences, which are introduced by ASCII ESC.

So, ironically, you could have almost any other key (preferably one
represented by a single octet), but ESC is off limits.

If you have a programmable terminal (Linux console, xterm), why not
just have the terminal send C-g when you stroke ESC?



  parent reply	other threads:[~2014-08-05  1:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-04 20:45 Escape key as C-g Craig Muth
2014-08-04 20:56 ` Drew Adams
2014-08-04 23:31 ` Juri Linkov
2014-08-05  0:26   ` Craig Muth
2014-08-05  7:21     ` Andreas Schwab
2014-08-05  1:03 ` Stephen J. Turnbull [this message]
2014-08-05 15:26 ` raman
2014-08-05 21:17   ` Craig Muth
2014-08-05 21:52     ` T.V Raman
2014-08-06 19:37       ` Craig Muth

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=87iom7lpcd.fsf@uwakimon.sk.tsukuba.ac.jp \
    --to=stephen@xemacs.org \
    --cc=craig.muth@gmail.com \
    --cc=emacs-devel@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.