Subject: Re: bug#70163: 29.3; hexl-mode incorrect docstring

From: Thierry Volpiatto <[email-masked]>
Date: Wed, 03 Apr 2024 17:04:58 +0000

Eli Zaretskii <[email-masked]> writes:

>> From: Thierry Volpiatto <[email-masked]>
>> Date: Wed, 03 Apr 2024 15:02:52 +0000
>> 
>> 
>> Hexl-mode docstring specify "\<hexl-mode-map>" 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)
>>       "\\<hexl-mode-map>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?

Something like this?

diff --git a/lisp/hexl.el b/lisp/hexl.el
index 1288cf4d7fb..a10c1b35536 100644
--- a/lisp/hexl.el
+++ b/lisp/hexl.el
@@ -256,7 +256,7 @@ as that will override any bit grouping options set here."
 
 ;;;###autoload
 (defun hexl-mode (&optional arg)
-  "\\<hexl-mode-map>A mode for editing binary files in hex dump format.
+  "A mode for editing binary files in hex dump format.
 This is not an ordinary major mode; it alters some aspects
 of the current mode's behavior, but not all; also, you can exit
 Hexl mode and return to the previous mode using `hexl-mode-exit'.
@@ -295,7 +295,7 @@ A sample format:
   000000c0: 7265 6769 6f6e 2e0a                      region..
 
 Movement is as simple as movement in a normal Emacs text buffer.
-Most cursor movement bindings are the same: use \\[hexl-backward-char], \\[hexl-forward-char], \\[hexl-next-line], and \\[hexl-previous-line]
+Most cursor movement bindings are the same: use \\<hexl-mode-map>\\[hexl-backward-char], \\[hexl-forward-char], \\[hexl-next-line], and \\[hexl-previous-line]
 to move the cursor left, right, down, and up.
 
 Advanced cursor movement commands (ala \\[hexl-beginning-of-line], \\[hexl-end-of-line], \\[hexl-beginning-of-buffer], and \\[hexl-end-of-buffer]) are

-- 
Thierry