From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: function-key-map Date: Fri, 12 Oct 2007 11:19:25 -0400 Message-ID: References: <18189.42302.211705.594331@gargle.gargle.HOWL> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1192202923 4125 80.91.229.12 (12 Oct 2007 15:28:43 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 12 Oct 2007 15:28:43 +0000 (UTC) Cc: emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 12 17:28:38 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IgMJC-0000gH-9K for ged-emacs-devel@m.gmane.org; Fri, 12 Oct 2007 17:20:14 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IgMJ6-0007sh-1p for ged-emacs-devel@m.gmane.org; Fri, 12 Oct 2007 11:20:08 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IgMIw-0007o1-UK for emacs-devel@gnu.org; Fri, 12 Oct 2007 11:19:59 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IgMIw-0007nO-2M for emacs-devel@gnu.org; Fri, 12 Oct 2007 11:19:58 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IgMIv-0007nJ-OA for emacs-devel@gnu.org; Fri, 12 Oct 2007 11:19:57 -0400 Original-Received: from x-132-204-252-255.xtpr.umontreal.ca ([132.204.252.255] helo=ceviche.home) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IgMIl-0006xy-B5; Fri, 12 Oct 2007 11:19:55 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 5C9CCB41BB; Fri, 12 Oct 2007 11:19:24 -0400 (EDT) In-Reply-To: (Richard Stallman's message of "Thu\, 11 Oct 2007 22\:46\:04 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:80713 Archived-At: Stefan> Yes, it's still very useful. See for example how Stefan> term/xterm.el uses both. Or term/x-win.el. Stefan> I.e. it's useful to give optional remapping Stefan> corresponding to alternative key-names. > Is there a reason to use `function-key-map' for this, > rather than `key-translation-map'? Is it so that they won't > be translated if they have bindings? Yes. Those mappings are "tentative". E.g. mapping [f23] to [S-f11] is not guaranteed to be correct, and even less so for [f13] -> [S-f1] if your keyboard does have an key f13. So it's a bit like giving those events several names rather than rewrite one name to another. function-key-map under X11 should also contain mappings from mouse-4 to wheel-up, and here again this mapping is tentative: mouse-4 often is the button that corresponds to the up movement of a mouse wheel, but sometimes it is just a plain extra mouse button, so the reampping of mouse-4 to wheel-up should only be done if mouse-4 has no binding. > In any case, the name `function-key-map' doesn't fit this kind of > usage. I gave it that name because its main purpose was to map escape > sequences into function keys, but that job is now done by > `input-decode-map'. > So perhaps we should rename the current `function-key-map' to > `default-key-translation-map', then rename the current > `input-decode-map' to `function-key-map'. > What do you think? I agree that function-key-map is a misnomer now. The choice of `input-decode-map' was somewhat arbitrary. It was based on the fact that it is used by encoded-kb.el and also that the tty escape sequences for function keys are a form of "encoding" of non-ascii events onto an ascii stream. I'm not wedded to this name, tho I think the name makes sense and describes well what it does. Renaming input-decode-map to function-key-map would be a bad idea because it would introduce an incompatibility: the behavior of input-decode-map is different, so while some uses of function-key-map are better moved to input-decode-map, others (such as the ones mentioned at the beginning of this message) need to stay on function-key-map. Actually the name function-key-map would also be bad because it would fail to describe what the map does (and instead describes what it was meant for). Renaming function-key-map to `default-key-translation-map' would also seem like a bad idea: - the name seems to imply that it's the global binding of "the buffer-local key-translation-map". - the name suggests the behavior of that map will be the same as the behavior of `key-translation-map' although in reality it is different. Right now, in the term/*.el files that I've changed to take advantage of input-decode-map, I've used "foo-alternative-maps" for the keymaps that hold bindings that need to be added to function-key-map, so maybe we could rename function-key-map to alternative-input-names-map or fallback-input-rename-map? Stefan