summaryrefslogtreecommitdiff
path: root/lisp/help.el
diff options
context:
space:
mode:
authorPhilip Kaludercic <philipk@posteo.net>2023-10-09 10:23:36 +0200
committerPhilip Kaludercic <philipk@posteo.net>2023-10-09 10:24:34 +0200
commit63a6fb2a7a02ca88835c3fd473894d3b7d39ff15 (patch)
tree7adcd17ea56218746c5bf41aeb3f22d475b372d0 /lisp/help.el
parent5528bea8d6a0a4d4fdab9cb830b09cb5445bea89 (diff)
downloademacs-63a6fb2a7a02ca88835c3fd473894d3b7d39ff15.tar.gz
Improve formatting of bindings in 'help-quick'
* lisp/help.el (help-quick): Prevent format's padding from extending text properties beyond the initial string containing the key binding.
Diffstat (limited to 'lisp/help.el')
-rw-r--r--lisp/help.el12
1 files changed, 7 insertions, 5 deletions
diff --git a/lisp/help.el b/lisp/help.el
index 3a641ccc1be..41c43c356a4 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -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)))))