From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: Ctrl-[ ? Date: Fri, 14 Jun 2019 02:51:45 -0400 Message-ID: References: <08AC8151-5911-40FA-8B20-818B839D00AB@traduction-libre.org> <86h892nk2g.fsf@zoho.eu> <9379C01B-80E3-49DD-B830-46CED773DC2C@traduction-libre.org> <83lfydrkde.fsf@gnu.org> <874l51q0s4.fsf@telefonica.net> <83ef45rdij.fsf@gnu.org> <87zhmto6fa.fsf@telefonica.net> <20190607163017.GA32029@tuxteam.de> <96B116FC-8007-4C42-9AE6-585530D0C76E@comcast.net> <87muisor2h.fsf@telefonica.net> <63F9D100-CD25-445B-8184-93A25DB0FC38@comcast.net> <874l4zoiz6.fsf@telefonica.net> <8A953A06-0B89-4026-8801-602C0D8B2CA1@comcast.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="14221"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jun 14 08:52:17 2019 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hbg4P-0003OR-FD for geh-help-gnu-emacs@m.gmane.org; Fri, 14 Jun 2019 08:52:17 +0200 Original-Received: from localhost ([::1]:48850 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbg4O-0006sp-EG for geh-help-gnu-emacs@m.gmane.org; Fri, 14 Jun 2019 02:52:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58883) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbg45-0006sf-Rb for help-gnu-emacs@gnu.org; Fri, 14 Jun 2019 02:52:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hbg44-0000oo-C0 for help-gnu-emacs@gnu.org; Fri, 14 Jun 2019 02:51:57 -0400 Original-Received: from [195.159.176.226] (port=39350 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hbg44-0000n2-55 for help-gnu-emacs@gnu.org; Fri, 14 Jun 2019 02:51:56 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.89) (envelope-from ) id 1hbg40-0002qL-22 for help-gnu-emacs@gnu.org; Fri, 14 Jun 2019 08:51:52 +0200 X-Injected-Via-Gmane: http://gmane.org/ Cancel-Lock: sha1:kFilslF0F6wY2ttzoRtGpuLjPnE= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.org gmane.emacs.help:120944 Archived-At: > Thank you Stefan for the enlightenment. I did say that I have never > looked into the source code. Given what you say, I am curious why C-h > is not known as Backspace. There are always 3 entities at play here: ASCII-control | GUI key | GUI control-modified-key --------------------------------------------------- TAB | tab | control i ESC | escape | control [ RET | return | control m LF | linefeed | control j ... And in Emacs, the mapping from the 3rd column to the 1st is hardcoded in make_ctrl_char while the mapping from the 2nd to the first is implemented in function-key-map, which can be easily overridden by the end-user. for "backspace" the situation is affected by the fact that some text-terminal sent "EFF" (aka C-h) for the backspace key while others sent DEL (aka C-? but it is really the code 127). Overtime, the C-? camp won, so Emacs kind of uses: DEL | backspace | control ? except that it seems the mapping from "control ?" to DEL is not hardcoded in the same way so `C-h k C-?` doesn't bring you to the key binding of DEL. > Another possibility is that since your patch was applied to all keys, maybe > it should only check for "special" keys, like these two. That would > certainly reduce side effects like you mention. Indeed. > Either way the next step would be to make people like me happy and provide > a default binding that undoes the patch. > Since this discussion began, I started taking notice of how often I use > these short-cuts. I actually caught myself using the sequence C-pC-i today > to fix indentation on a couple of lines. I also seem to use C-[C-\ a lot > because it eliminates the need for me to change modifier-fingering. If we ever implement a change similar to the proof-of-concept patch I sent, then of course it would strive to not modify the default behavior, except maybe in some hard-to-cover corner cases. Stefan