]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve formatting of bindings in 'help-quick'
authorPhilip Kaludercic <philipk@posteo.net>
Mon, 9 Oct 2023 08:23:36 +0000 (10:23 +0200)
committerPhilip Kaludercic <philipk@posteo.net>
Mon, 9 Oct 2023 08:24:34 +0000 (10:24 +0200)
* lisp/help.el (help-quick): Prevent format's padding from extending
text properties beyond the initial string containing the key binding.

lisp/help.el

index 3a641ccc1be2946c348574108e5abfb9fdbb9125..41c43c356a4571800e9414e2ed28735b456af715 100644 (file)
@@ -192,7 +192,7 @@ buffer.")
                       max-key-len (max (length key) max-key-len))
                 (push (list key (cdr ent) (car ent)) keys))))
           (when keys
-            (let ((fmt (format "%%-%ds %%-%ds%s" max-key-len max-cmd-len
+            (let ((fmt (format "%%s %%-%ds%s" max-cmd-len
                                (make-string padding ?\s)))
                   (width (+ max-key-len 1 max-cmd-len padding)))
               (push `(,width
@@ -203,10 +203,12 @@ buffer.")
                         'face 'bold)
                       ,@(mapcar (lambda (ent)
                                   (format fmt
-                                          (propertize
-                                           (car ent)
-                                           'quick-help-cmd
-                                           (caddr ent))
+                                          (concat
+                                           (propertize
+                                            (car ent)
+                                            'quick-help-cmd
+                                            (caddr ent))
+                                           (make-string (- max-key-len (length (car ent))) ?\s))
                                           (cadr ent)))
                                 keys))
                     blocks)))))