Eli Zaretskii writes: >> From: Thierry Volpiatto >> Cc: Eli Zaretskii , Stefan Monnier >> , 70163@debbugs.gnu.org >> Date: Wed, 03 Apr 2024 17:04:04 +0000 >> >> >> Andreas Schwab writes: >> >> > On Apr 03 2024, Eli Zaretskii wrote: >> > >> >>> From: Thierry Volpiatto >> >>> Date: Wed, 03 Apr 2024 15:02:52 +0000 >> >>> >> >>> >> >>> Hexl-mode docstring specify "\" in its first line, this >> >>> to specify some keybinding related to this map at end, as a result the >> >>> documentation command returns a three line string, the first line beeing >> >>> a blank line until hexl.el is loaded. I think docstrings generally >> >>> should not have this specification in their first line. >> >>> >> >>> (defun hexl-mode (&optional arg) >> >>> "\\A mode for editing binary files in hex dump format. >> >>> [...] >> >>> Most cursor movement bindings are the same: use \\[hexl-backward-char], >> >>> [...] >> >> >> >> What do you suggest to do instead? >> > >> > Customary is to put it directly before the (first) keymap reference. >> >> Exactly. > > So we don't want an empty line at the beginning of a doc string, but > are okay with having it farther into the doc string? Yes, this would avoid loading the whole file just for having the first line of the documentation. Actually, (documentation 'hexl-mode) returns: "\nUses keymap `hexl-mode-map', which is not currently defined.\nA mode for editing binary files in hex dump format..." But once it is loaded: "A mode for editing binary files in hex dump format..." I think it is a good practice to specify keymap just when needed as specified in the manual: • In documentation strings for a major mode, you will want to refer to the key bindings of that mode’s local map, rather than global ones. Therefore, use the construct ‘\\<...>’ once in the documentation string to specify which key map to use. Do this before the first use of ‘\\[...]’. The text inside the ‘\\<...>’ should be the name of the variable containing the local keymap for the major mode. -- Thierry