From: Stefan Monnier <monnier@iro.umontreal.ca>
To: rms@gnu.org
Cc: emacs-devel@gnu.org
Subject: Re: function-key-map
Date: Fri, 12 Oct 2007 11:19:25 -0400 [thread overview]
Message-ID: <jwvlka874zb.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <E1IgAXM-0004ZF-PD@fencepost.gnu.org> (Richard Stallman's message of "Thu\, 11 Oct 2007 22\:46\:04 -0400")
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
next prev parent reply other threads:[~2007-10-12 15:19 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-10 13:00 function-key-map Richard Stallman
2007-10-10 14:31 ` function-key-map Stefan Monnier
2007-10-11 4:23 ` function-key-map T. V. Raman
2007-10-11 13:55 ` function-key-map Stefan Monnier
2007-10-12 1:17 ` function-key-map T. V. Raman
2007-10-12 2:46 ` function-key-map Richard Stallman
2007-10-12 15:19 ` Stefan Monnier [this message]
2007-10-13 0:18 ` function-key-map Richard Stallman
2007-10-13 3:46 ` function-key-map Stefan Monnier
2007-10-13 14:14 ` function-key-map Richard Stallman
2007-10-14 18:58 ` function-key-map Stefan Monnier
2007-10-15 16:03 ` function-key-map Richard Stallman
2007-10-16 20:31 ` function-key-map Stefan Monnier
2007-10-11 5:19 ` function-key-map Richard Stallman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvlka874zb.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
--cc=rms@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.