From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Felix Crux Newsgroups: gmane.emacs.help Subject: Re: Difference between GUI/terminal when using "kbd" macro Date: Mon, 18 Feb 2013 14:33:11 -0500 Message-ID: References: <87wqu5jv1l.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1361216035 30504 80.91.229.3 (18 Feb 2013 19:33:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 18 Feb 2013 19:33:55 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Jambunathan K Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Feb 18 20:34:17 2013 Return-path: Envelope-to: geh-help-gnu-emacs@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 1U7WTh-0004iM-4D for geh-help-gnu-emacs@m.gmane.org; Mon, 18 Feb 2013 20:34:17 +0100 Original-Received: from localhost ([::1]:47729 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7WTN-0005rR-1a for geh-help-gnu-emacs@m.gmane.org; Mon, 18 Feb 2013 14:33:57 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:51699) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7WTB-0005g3-OK for help-gnu-emacs@gnu.org; Mon, 18 Feb 2013 14:33:49 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U7WT8-0005o5-Sn for help-gnu-emacs@gnu.org; Mon, 18 Feb 2013 14:33:45 -0500 Original-Received: from mail-ob0-f173.google.com ([209.85.214.173]:43936) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7WT8-0005nv-O7 for help-gnu-emacs@gnu.org; Mon, 18 Feb 2013 14:33:42 -0500 Original-Received: by mail-ob0-f173.google.com with SMTP id dn14so5812552obc.4 for ; Mon, 18 Feb 2013 11:33:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type:x-gm-message-state; bh=N76U6gssg9Z4BFhFcu8TftnEmqrWmm6ars9jlo36KbI=; b=bylu6RSWGIT+QVxaKt4zcXElf99jvsNNOP5NaLyy8sddtGt+uxTQwHj00JqHNH5mPa x3jbalPfwb2+KcoY/hQCrqtZdZzYUss6bQgfvBCRKYrOEMvkH3VyIfx26l6FIwqHO1ed U8naTg7f8wenHRd6ZelBlUgrpWo9EapGnFHYw723g4L/M3r03AXCgzf8OkI9aNmNB4JG DZyhkWswv0J6Wv3gCu5M2VnZiUVOQ+dmfn1JiUuyXexyDZwT9+b6p9fRxeKkGxS2TtHa TFX7lYSlGT6i7ngp4lpkE1Aqv1Nxfxq0zLZiigXM8ZEaikfvi2aJIQC1dnRQaGOVE0UE Jv4A== X-Received: by 10.60.27.161 with SMTP id u1mr6489406oeg.1.1361216021522; Mon, 18 Feb 2013 11:33:41 -0800 (PST) Original-Received: by 10.76.122.138 with HTTP; Mon, 18 Feb 2013 11:33:11 -0800 (PST) In-Reply-To: <87wqu5jv1l.fsf@gmail.com> X-Gm-Message-State: ALoCoQnCbQTjtSdVIkm5pC6cvywtS0D4mNPWVQyTmuTJC4Dh3H+63SlKoT+dOVExEXtNfOBV13ue X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.214.173 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:89157 Archived-At: Thanks for the suggestion; it actually led to an interesting discovery: With the keybinding set to (kbd "C-x "), running "C-x C-h" (in a terminal session, since in a GUI one it quits Emacs) shows the following: Global Bindings Starting With C-x ESC: key binding --- ------- C-x ESC ESC repeat-complex-command This got me thinking about the fact that the help system is calling it "ESC", not "", and wondering about whether that is significant. I then tried changing the binding to (kbd "C-x ESC"), which actually works in both graphical and terminal sessions! In conclusion, it looks as though there is a difference between "ESC" and "", at least as far as the "kbd" macro is concerned. I don't know enough about the topic to be sure, but I would speculate that "" is some sort of special meta-character being sent by the X window system, while "ESC" is the lower-level key value. Very interesting stuff; and it now lets me use the more readable form, too! I'm still quite curious about the discrepancy, but at least the original problem is solved. Thank you! Felix C. On Mon, Feb 18, 2013 at 2:12 PM, Jambunathan K wrote: > > May be C-x ESC C-h will tell you what is behind the curtain. Forgive > me, if it doesn't help, for I know not what I am talking. Just a > suggestion. > > > Felix Crux writes: > >> Hello, >> >> I recently ran across a perplexing problem that I can't find the answer >> to in the documentation. >> >> The following snippet in my init file works just as one would expect in >> both graphical (GTK+) and terminal instances of Emacs: >> >> (global-set-key [?\C-x ?\e] 'save-buffers-kill-emacs) >> >> However, this version, which I thought to be identical (but more readable), >> only works in graphical sessions: >> >> (global-set-key (kbd "C-x ") 'save-buffers-kill-emacs) >> >> When attempting to use it in a terminal, the status line simply displays >> "C-x ESC-", as though waiting for more input. >> >> Invoking emacs-version gives me "GNU Emacs 23.4.1 (x86_64-pc-linux-gnu, >> GTK+ Version 2.24.10) of 2012-09-08 on trouble, modified by Debian". >> >> I'd be most grateful if someone would point me in the right direction to >> understand this. Thank you, >> >> Felix C. >> >> > > --