From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: Making ESC not a prefix key while keeping Alt = Meta Date: Mon, 11 Sep 2006 09:20:02 -0600 Organization: IHS Message-ID: References: <1157748592.520351.123650@i3g2000cwc.googlegroups.com> <1157851494.463384.244420@i3g2000cwc.googlegroups.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1157988160 12095 80.91.229.2 (11 Sep 2006 15:22:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 11 Sep 2006 15:22:40 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Sep 11 17:22:38 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GMncJ-00058b-Pl for geh-help-gnu-emacs@m.gmane.org; Mon, 11 Sep 2006 17:22:36 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GMncJ-00082g-5E for geh-help-gnu-emacs@m.gmane.org; Mon, 11 Sep 2006 11:22:35 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GMnbA-0007Mc-7Z for help-gnu-emacs@gnu.org; Mon, 11 Sep 2006 11:21:24 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GMnb7-0007Iq-W1 for help-gnu-emacs@gnu.org; Mon, 11 Sep 2006 11:21:23 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GMnb7-0007IS-J0 for help-gnu-emacs@gnu.org; Mon, 11 Sep 2006 11:21:21 -0400 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GMncP-0006m6-Pz for help-gnu-emacs@gnu.org; Mon, 11 Sep 2006 11:22:42 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1GMnaq-0004rM-K8 for help-gnu-emacs@gnu.org; Mon, 11 Sep 2006 17:21:04 +0200 Original-Received: from 207.167.42.206 ([207.167.42.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 11 Sep 2006 17:21:04 +0200 Original-Received: from ihs_4664 by 207.167.42.206 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 11 Sep 2006 17:21:04 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 47 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 207.167.42.206 User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) In-Reply-To: <1157851494.463384.244420@i3g2000cwc.googlegroups.com> X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:37291 Archived-At: 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