all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Mapping ESC to Cancel in terminal emacs
@ 2015-02-01 22:39 Craig Muth
  2015-02-02  8:33 ` David Kastrup
  2015-02-02 17:07 ` Stefan Monnier
  0 siblings, 2 replies; 3+ messages in thread
From: Craig Muth @ 2015-02-01 22:39 UTC (permalink / raw)
  To: Emacs-Devel devel

I added some elisp to the following emacswiki page that gets somewhat
close to making ESC behave like C-g.  It uses a small cua-mode-like
delay to distinguish using ESC as a prefix key from an ESC to cancel:

http://www.emacswiki.org/emacs/CancelingInEmacs

Anyone know of a better way to put something like "\eb" back into
unread-command-events, so it replicate the state before the event was
read?  Here's a relevant blurb I added at the bottom of the emacswiki
page:

-------------------------------------------------------------------
One drawback, though, is that it messes up C-h C-k, making it think
the key you typed was only escape. Does anyone know of a better way of
putting the escape and the subsequent key back into effect than the
following? Maybe a way that makes it not treat the escape separately?

      (setq unread-command-events (cons event unread-command-events))
 ; Puts subsequent key back into effect
      (setq unread-command-events (cons 27 unread-command-events))   ;
Puts escape back into effect
-------------------------------------------------------------------

Caveat: I do fully realize that making escape work like C-g in a
general way is a bad idea. I have in mind the exceptional case where
emacs is used as an engine, or when you're temporarily remapping
escape while pairing with a user who isn't yet familiar with emacs.

Thanks!
--Craig



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-02-02 17:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-01 22:39 Mapping ESC to Cancel in terminal emacs Craig Muth
2015-02-02  8:33 ` David Kastrup
2015-02-02 17:07 ` Stefan Monnier

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.