From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Stephen J. Turnbull" Newsgroups: gmane.emacs.devel Subject: Escape key as C-g Date: Tue, 05 Aug 2014 10:03:46 +0900 Message-ID: <87iom7lpcd.fsf@uwakimon.sk.tsukuba.ac.jp> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Trace: ger.gmane.org 1407200663 22194 80.91.229.3 (5 Aug 2014 01:04:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 5 Aug 2014 01:04:23 +0000 (UTC) Cc: Emacs-Devel devel To: Craig Muth Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 05 03:04:16 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 1XETAk-0002ik-OK for ged-emacs-devel@m.gmane.org; Tue, 05 Aug 2014 03:04:14 +0200 Original-Received: from localhost ([::1]:55748 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XETAk-0007JR-7k for ged-emacs-devel@m.gmane.org; Mon, 04 Aug 2014 21:04:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43923) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XETAZ-0007Ir-0s for emacs-devel@gnu.org; Mon, 04 Aug 2014 21:04:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XETAR-000529-A8 for emacs-devel@gnu.org; Mon, 04 Aug 2014 21:04:02 -0400 Original-Received: from mgmt1.sk.tsukuba.ac.jp ([130.158.97.223]:60755) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XETAQ-00050U-W7 for emacs-devel@gnu.org; Mon, 04 Aug 2014 21:03:55 -0400 Original-Received: from uwakimon.sk.tsukuba.ac.jp (uwakimon.sk.tsukuba.ac.jp [130.158.99.156]) by mgmt1.sk.tsukuba.ac.jp (Postfix) with ESMTP id 1BFBA3FA0B3E; Tue, 5 Aug 2014 10:03:47 +0900 (JST) Original-Received: by uwakimon.sk.tsukuba.ac.jp (Postfix, from userid 1000) id 0E46C1A2C7F; Tue, 5 Aug 2014 10:03:47 +0900 (JST) In-Reply-To: X-Mailer: VM undefined under 21.5 (beta34) "kale" acf1c26e3019 XEmacs Lucid (x86_64-unknown-linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 130.158.97.223 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:173421 Archived-At: Craig Muth writes: > 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? There aren't any, if your definition of "work" includes "doesn't break the function keys, the arrow keys, and pretty much everything that isn't an ASCII character or control function". (That last is an exaggeration, but the breakage will indeed be widespread.) The difference with the GUI is that in a GUI, Emacs has direct (well, OS-level) access to the keyboard. In TTY mode, on the other hand, Emacs does not have access to the keyboard. It has an input stream of octets which may be generated by a keyboard, and conventionally all but a few functions (basically, BEL, TAB, CR, LF, and ESC) are represented by control sequences, which are introduced by ASCII ESC. So, ironically, you could have almost any other key (preferably one represented by a single octet), but ESC is off limits. If you have a programmable terminal (Linux console, xterm), why not just have the terminal send C-g when you stroke ESC?