From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: Fixing key bindings on some terminals Date: Mon, 26 May 2014 11:32:41 -0700 (PDT) Message-ID: <0606347e-794d-4d5f-9b57-897a14e41fc1@default> References: <49ec1c18-35a6-4b0b-b5ae-74184a21d89c@default> <1356362528.658159.1401119418980.JavaMail.root@insa-lyon.fr> 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 1401129208 16448 80.91.229.3 (26 May 2014 18:33:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 26 May 2014 18:33:28 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Kevin Le Gouguec Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon May 26 20:33:21 2014 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 1Wozi2-0007JR-Hy for geh-help-gnu-emacs@m.gmane.org; Mon, 26 May 2014 20:33:18 +0200 Original-Received: from localhost ([::1]:58070 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wozi1-00087X-PM for geh-help-gnu-emacs@m.gmane.org; Mon, 26 May 2014 14:33:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39963) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wozhi-000853-1I for help-gnu-emacs@gnu.org; Mon, 26 May 2014 14:33:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WozhZ-0003yK-6f for help-gnu-emacs@gnu.org; Mon, 26 May 2014 14:32:57 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:22155) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WozhZ-0003y7-1G for help-gnu-emacs@gnu.org; Mon, 26 May 2014 14:32:49 -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 s4QIWk1N005001 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 26 May 2014 18:32:47 GMT Original-Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s4QIWi4a012093 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 26 May 2014 18:32:46 GMT Original-Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s4QIWiIU007394; Mon, 26 May 2014 18:32:44 GMT In-Reply-To: <1356362528.658159.1401119418980.JavaMail.root@insa-lyon.fr> 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: 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:97884 Archived-At: > > See option `normal-erase-is-backspace' for this part, at least. > > Thanks, didn't know about that one! >=20 > This leaves getting C-? to work has "help-command" with Terminator. Right > now it behaves like DEL or BACKSPACE, i.e. it deletes forward, since I se= t > "normal-erase-is-backspace" to t. Actually, the *character* `CONTROL ?' (aka ^?, an ASCII control char) *is* `DEL' (old name `DELETE'). And it is not the key `', the key `', or the key `C-?'. That is (for the last part), it might be (and probably is) the case that when you hold Control and hit `?', you keyboard does not send a CONTROL ? character but something else. Yes, this is confusing. If you do `C-h k C-i', that is, hold Control and hit `i', Emacs always writes `TAB'. But the same does not happen for `C-?' (holding Control and hitting `?'). Emacs distinguishes the character ^? (aka `DEL') from the key that is sent from your keyboard when you hold Control and hit `?'. So `C-h k C-?' (holding Control and hitting `?') typically tells you that "C-? is undefined". It does not tell you that `DELL' is bound to... If you want `DEL') to invoke `help-command' then bind it to `help-command': (global-set-key (kbd "DEL") 'help-command) (define-key help-map (kbd "DEL") 'help-for-help) ; for `DEL DEL' Then you can use, for example, `DEL f' for `describe-function' and `DEL DEL' for `help-for-help'. You might need to bind `DEL' in additional keymaps also, as some modes bind `DEL' to other commands. For example, in Emacs Lisp mode `DEL' is bound to `backward-delete-char-untabify'. > To sum up, with "normal-erase-is-backspace" on: > - With Terminator, "describe-key" "C-?" returns "C-d". > - With XTerm, "describe-key" "C-?" prints "C-?-" and waits for completion= . >=20 > I tried to dig some more and apparently this has to do with Terminator be= ing > an ASCII-based terminal, like gnome-terminal. I haven't read enough to kn= ow > for sure, so right now I guess my options are: Sorry, I know nothing about Terminator.=20 An ASCII-based terminal should be able to handle `DEL'. But it might not be able to handle the key that your keyboard sends when you hold down Control and hit `?'. If your teminal can handle Control + `?' then you can bind it just as you did: (global-set-key (kbd "C-?") 'help-command) (define-key help-map (kbd "C-?") 'help-for-help) The fact that this does not work for you tells me that your terminal does not recognize the key combination Control + `?'. (That would be the case for any ASCII terminal.)