unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Craig Muth <craig.muth@gmail.com>,
	Emacs-Devel devel <emacs-devel@gnu.org>
Subject: RE: Escape key as C-g
Date: Mon, 4 Aug 2014 13:56:56 -0700 (PDT)	[thread overview]
Message-ID: <b8c0f9d1-99e0-4551-8bbc-80ba1da3b2e6@default> (raw)
In-Reply-To: <CAA0bO3FBSLZO2B814oz2_yy8_5Ps+ifnPJUs0xDxVmEbre2fNg@mail.gmail.com>

> 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?

Not an answer to your question, but I suggest that you not do that,
unless you really never need any keys that have ESC as a prefix.

Are you aware that `ESC-ESC-ESC' already does the same thing as `C-g'
in many cases?  (It's really not hard to hit it 3 times instead of 1.)

From the Emacs manual, node `Quitting':

 The sequence `<ESC> <ESC> <ESC>' (`keyboard-escape-quit') can either
 quit or abort.  (We defined it this way because <ESC> means "get out"
 in many PC programs.)  It can cancel a prefix argument, clear a
 selected region, or get out of a Query Replace, like `C-g'.  It can get
 out of the minibuffer or a recursive edit, like `C-]'.  It can also get
 out of splitting the frame into multiple windows, as with `C-x 1'.  One
 thing it cannot do, however, is stop a command that is running.  That's
 because it executes as an ordinary command, and Emacs doesn't notice it
 until it is ready for the next command.

Note the last part.  It is this that I think prevents you from defining
another key to do exactly and always what `C-g' does.  I believe that
`C-g' is hardwired in some places.  (Someone will correct me if I am
mistaken.)



  reply	other threads:[~2014-08-04 20:56 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 [this message]
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
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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=b8c0f9d1-99e0-4551-8bbc-80ba1da3b2e6@default \
    --to=drew.adams@oracle.com \
    --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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).