]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix *Help* text when a command is bound to a single key
authorEli Zaretskii <eliz@gnu.org>
Thu, 26 Jun 2025 14:39:19 +0000 (17:39 +0300)
committerEshel Yaron <me@eshelyaron.com>
Wed, 23 Jul 2025 19:19:15 +0000 (21:19 +0200)
* lisp/help-fns.el (help-fns--key-bindings): Don't insert
redundant period.  (Bug#78905)

(cherry picked from commit 80cb688b04b11a0f2291a3dfb26c16febfdea4cd)

lisp/help-fns.el

index 2ef7be9256e1c5570f8acaa2fe36137712570b74..91ca25401f88e0fd5aae0b819a9e54de1d80dcf0 100644 (file)
@@ -650,7 +650,11 @@ the C sources, too."
                              (format-message "`%s'" remapped)
                           "an anonymous command"))
                   (princ "as well.\n"))
-                (or remapped (princ "."))
+                ;; The (= (point) start) condition tests whether
+                ;; 'help-fns--insert-menu-bindings' inserted anything;
+                ;; if it didn't, we already have a period from the
+                ;; previous 'princ' call.
+                (or remapped (= (point) start) (princ "."))
                 (fill-region-as-paragraph start (point))))
             (ensure-empty-lines)))))))