unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* \\{foo-mode-map}
@ 2021-10-29 18:43 Lars Ingebrigtsen
  2021-10-29 19:06 ` \\{foo-mode-map} Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Ingebrigtsen @ 2021-10-29 18:43 UTC (permalink / raw)
  To: emacs-devel

`C-h m' displays the doc string of the current major mode.  It does not
output the mode map -- unless the programmer has put \\{foo-mode-map}
into the doc string.  Many modes do not, which means that the user has
to rely on `C-h b' to try to find out what the available commands are.
Which isn't optimal.

I think it might be a good idea to change `C-h m' so that it always
outputs the major mode map.  That is, if the doc string already does so,
it shouldn't output it again, but if the doc string doesn't, then output
the major mode map after the doc string.

And then we could stop encouraging that these doc strings include
\\{foo-mode-map}.

Any opinions?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: \\{foo-mode-map}
  2021-10-29 18:43 \\{foo-mode-map} Lars Ingebrigtsen
@ 2021-10-29 19:06 ` Stefan Monnier
  2021-10-29 19:18   ` \\{foo-mode-map} Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2021-10-29 19:06 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: emacs-devel

> `C-h m' displays the doc string of the current major mode.  It does not
> output the mode map -- unless the programmer has put \\{foo-mode-map}
> into the doc string.  Many modes do not, which means that the user has
> to rely on `C-h b' to try to find out what the available commands are.
> Which isn't optimal.

IIRC `define-derived-mode` adds that `\\{foo-mode-map}` thingy unless
there are already some `\\[...]` in the docstring.

> And then we could stop encouraging that these doc strings include
> \\{foo-mode-map}.

We definitely don't need to do that (better encourage the use of
`define-derived-mode` instead).


        Stefan




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: \\{foo-mode-map}
  2021-10-29 19:06 ` \\{foo-mode-map} Stefan Monnier
@ 2021-10-29 19:18   ` Lars Ingebrigtsen
  0 siblings, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2021-10-29 19:18 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> IIRC `define-derived-mode` adds that `\\{foo-mode-map}` thingy unless
> there are already some `\\[...]` in the docstring.

Oh yeah, so it does.  I wonder why I seem to be encountering so many
major modes without a keymap, then?  I'll have to pay closer attention
the next time it happens.

It could just be from old modes that haven't been converted, though.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-29 19:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-29 18:43 \\{foo-mode-map} Lars Ingebrigtsen
2021-10-29 19:06 ` \\{foo-mode-map} Stefan Monnier
2021-10-29 19:18   ` \\{foo-mode-map} Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).