Subject: bug#78905: 31.0.50; Extra dot in C-h k output

From: Eli Zaretskii <[email-masked]>
Date: Thu, 26 Jun 2025 15:15:47 +0300

> Date: Thu, 26 Jun 2025 11:51:45 +0200
> From:  Eshel Yaron via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> 
> Hi,
> 
> On the current master, I see:
> 
> 1. emacs -Q
> 2. C-x C-j
> 3. C-h k d
> 
> This produces a *Help* buffer saying:
> 
>   d runs the command dired-flag-file-deletion (found in dired-mode-map),
>   which is an interactive byte-code-function in ‘dired.el’.
> 
>   It is bound to d.
>   .
> 
>   (dired-flag-file-deletion ARG &optional INTERACTIVE)
>   ...
> 
> 
> Note the extra, unexpected dot and newline after "It is bound to d."

Thanks.  Does the patch below fix the problem?

diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 481360b..e56433e 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -632,7 +632,7 @@ help-fns--key-bindings
                              (format-message "`%s'" remapped)
 		           "an anonymous command"))
                   (princ "as well.\n"))
-                (or remapped (princ "."))
+                (or remapped menus (princ "."))
                 (fill-region-as-paragraph start (point))))
             (ensure-empty-lines)))))))