Subject: bug#56816: Missing documentation of function-key-map

From: Alan Mackenzie <[email-masked]>
Date: Fri, 29 Jul 2022 19:50:35 +0000

Hello, Eli.

On Fri, Jul 29, 2022 at 10:19:59 +0300, Eli Zaretskii wrote:
> > Date: Thu, 28 Jul 2022 19:30:36 +0000
> > From: Alan Mackenzie <[email-masked]>

> > function-key-map is not defined in the Elisp manual.

> > It is mentioned, in passing, on the page "Translation Keymaps" thusly:

> >      `local-function-key-map' inherits from `function-key-map'.  The
> >      latter should only be altered if you want the binding to apply in
> >      all terminals, so using the former is almost always preferred.

> > So, all we know about function-key-map is when to alter it (and even
> > here, it is unclear what the "all" in "all terminals" means).  Not what
> > it's for, not when it's looked up and used, not what its contents are.

> > #########################################################################

> > The doc string for function-key-map is a little better.  It, at least,
> > attempts to give a context for the variable ("The parent keymap of all
> > `local-function-key-map' instances.").

> > The doc string gives an example of what belongs in the variable
> > ("Function key definitions that apply to all terminal devices should go
> > here."), but this doesn't define its contents.  It contains more than
> > function key definitions - for example, function keys with modifier keys,
> > and modifier keys on their own (for example, a binding for
> > event-apply-control-modifier).

> > These are all documentation bugs.

> Would you please state clearly what exactly is a bug here?

That there is a reference to function-key-map in that manual page, but
there is no description of function-key-map whatsoever in the manual.  If
things are to stay that way, perhaps we could add something like "(not
documented in this manual.  See the variable's doc string for details.)"
as a footnote. 

> Specifically, what is missing from the doc string of this variable?
> Would saying something like "Keymap for bindings of function keys." be
> enough, or is some other information missing in your opinion, and if
> so, what?

That description would be a big improvement.  Perhaps it could also say
"including modifiers for some keys" or something like that; The
modifiers, all 7 combinations, are included for each keypad key, but not
for the other function keys.

> Once we are done with the doc string, we can discuss whether the
> manual needs any changes in this respect; in general, not every
> variable must be in the manual, and as long as the doc string is
> sufficient, we are fine.

I'll tell you what gave rise to this.  On a proprietary system in my day
job, typing C-M-a is giving the result M-á, and similarly for the other
four vowels with C-M-.  This should be relatively straightforward to
remedy, but I've been struggling with that manual page for two evenings,
now.  The manual page ("Translation Keymaps") seems to have most of the
information, but there is little clarity and little redundancy.  I think
I need to add a binding for M-á to convert it to C-M-a, but in which
keymap?  There are three keymaps described on the page, but their
purposes are not entirely clear.  One of them is the one I need, I think.

It surely shouldn't take several hours to digest the information on a
single moderately sized info page.

> Thanks.

-- 
Alan Mackenzie (Nuremberg, Germany).