unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: Making ESC not a prefix key while keeping Alt = Meta
Date: Mon, 11 Sep 2006 09:20:02 -0600	[thread overview]
Message-ID: <ee3usa$bbu$1@sea.gmane.org> (raw)
In-Reply-To: <1157851494.463384.244420@i3g2000cwc.googlegroups.com>

Yevgeniy Makarov wrote:
> Kevin Rodgers wrote:
> 
>> (global-set-key "\0" (global-key-binding "\e"))
>> (setq meta-prefix-char ?\0)
>> (global-unset-key "\e")
> 
> This indeed disassociates ESC from Alt; however, ESC remains a prefix
> key. For example, when I press ESC, Emacs waits a little and then
> displays "ESC-" in the minibuffer, waiting for the second key in the
> sequence. A similar thing happens when I press C-h ESC (describe key
> briefly).

Apparently some modes bind ESC locally e.g. lisp-interaction-mode
(*scratch) and help-mode (*Help*).  So you'd need to put
(local-unset-key "\e") in each such mode's hook.

> When I say
> 
> (global-set-key "\e" 'keyboard-quit)
> 
> this indeed puts keyboard-quit function in the global-keymap where
> ESC-prefix used to be. However, ESC does not become a synonym for C-g:
> for example, when I do C-x C-f (find file), I can't terminate input
> using ESC.

 From the Quitting node of the Emacs Lisp manual:

,----
|  -- Command: keyboard-quit
|      This function signals the `quit' condition with `(signal 'quit
|      nil)'.  This is the same thing that quitting does.  (See `signal'
|      in *Note Errors::.)
|
|    You can specify a character other than `C-g' to use for quitting.
| See the function `set-input-mode' in *Note Terminal Input::.
`----

The first node under Terminal Input is Input Modes, which describes
the set-input-mode and current-input-mode functions.  So:

(let ((input-mode (current-input-mode)))
   (setcar (nthcdr 3 input-mode) ?\e)	; QUIT = ESC
   (set-input-mode input-mode))

-- 
Kevin

  reply	other threads:[~2006-09-11 15:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-08 20:49 Making ESC not a prefix key while keeping Alt = Meta Yevgeniy Makarov
2006-09-09 14:49 ` Kevin Rodgers
     [not found] ` <mailman.6687.1157813407.9609.help-gnu-emacs@gnu.org>
2006-09-10  1:24   ` Yevgeniy Makarov
2006-09-11 15:20     ` Kevin Rodgers [this message]
     [not found]     ` <mailman.6777.1157988085.9609.help-gnu-emacs@gnu.org>
2006-09-12  2:36       ` Yevgeniy Makarov

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='ee3usa$bbu$1@sea.gmane.org' \
    --to=ihs_4664@yahoo.com \
    /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.
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).