From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: Escape key as C-g Date: Mon, 4 Aug 2014 13:56:56 -0700 (PDT) Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1407185854 21395 80.91.229.3 (4 Aug 2014 20:57:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 4 Aug 2014 20:57:34 +0000 (UTC) To: Craig Muth , Emacs-Devel devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 04 22:57:27 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XEPJp-0008F3-Ui for ged-emacs-devel@m.gmane.org; Mon, 04 Aug 2014 22:57:22 +0200 Original-Received: from localhost ([::1]:54480 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEPJp-00013k-J4 for ged-emacs-devel@m.gmane.org; Mon, 04 Aug 2014 16:57:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49070) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEPJf-00012T-4T for emacs-devel@gnu.org; Mon, 04 Aug 2014 16:57:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XEPJW-0007Vn-EH for emacs-devel@gnu.org; Mon, 04 Aug 2014 16:57:11 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:34115) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEPJW-0007Vj-7W for emacs-devel@gnu.org; Mon, 04 Aug 2014 16:57:02 -0400 Original-Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s74KuxjO023330 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 4 Aug 2014 20:57:00 GMT Original-Received: from userz7022.oracle.com (userz7022.oracle.com [156.151.31.86]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s74KuweJ023319 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 4 Aug 2014 20:56:59 GMT Original-Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userz7022.oracle.com (8.14.5+Sun/8.14.4) with ESMTP id s74KuveW020326; Mon, 4 Aug 2014 20:56:58 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6691.5000 (x86)] X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 141.146.126.69 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:173416 Archived-At: > Regarding making the Escape key behave like C-g, this seems to work > fine in GUI emacs, but not terminal emacs: >=20 > (define-key key-translation-map "\e" (kbd "C-g")) >=20 > 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 ` ' (`keyboard-escape-quit') can either quit or abort. (We defined it this way because 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.)