GNU bug report logs - #70163
29.3; hexl-mode incorrect docstring

Previous Next

Package: emacs;

Reported by: Thierry Volpiatto <thievol <at> posteo.net>

Date: Wed, 3 Apr 2024 15:02:01 UTC

Severity: normal

Found in version 29.3

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: thievol <at> posteo.net, 70163 <at> debbugs.gnu.org, schwab <at> linux-m68k.org
Subject: bug#70163: 29.3; hexl-mode incorrect docstring
Date: Sat, 06 Apr 2024 16:21:44 -0400
>> What is "the more appropriate place", and how will you find it, given
>> that some doc strings are auto-generated, either in part or in full?
> Right after the next \n ?

As in the patch below.


        Stefan


diff --git a/lisp/help.el b/lisp/help.el
index 1ef46e394f3..c2a278bc0a0 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -1380,6 +1380,7 @@ substitute-command-keys
     ;; itself.
     (let ((keymap overriding-local-map)
           (inhibit-modification-hooks t)
+          (delayed ())
           (orig-buf (current-buffer)))
       (with-temp-buffer
         (insert string)
@@ -1496,11 +1497,17 @@ substitute-command-keys
                                              (symbol-value name)))))
                   (cond
                    ((null this-keymap)
-                    (insert "\nUses keymap "
-                            (substitute-quotes "`")
-                            (symbol-name name)
-                            (substitute-quotes "'")
-                            ", which is not currently defined.\n")
+                    ;; Insert a warning on the next line (bug#70163).
+                    (let ((pos (copy-marker (line-beginning-position 2))))
+                      (push (lambda ()
+                              (goto-char pos)
+                              (unless (bolp) (insert "\n"))
+                              (insert "Uses keymap "
+                                      (substitute-quotes "`")
+                                      (symbol-name name)
+                                      (substitute-quotes "'")
+                                      ", which is not currently defined.\n"))
+                            delayed))
                     (unless generate-summary
                       (setq keymap nil)))
                    ((not generate-summary)
@@ -1527,6 +1534,7 @@ substitute-command-keys
               (delete-char 1))
              ;; 3. Nothing to do -- next character.
              (t (forward-char 1)))))
+        (mapc #'funcall delayed)
         (buffer-string)))))
 
 (defun substitute-quotes (string)





This bug report was last modified 1 year and 43 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.