]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix widget buttons when button prefix includes space
authorDavid Ponce <da_vid@orange.fr>
Wed, 1 Jan 2025 11:03:07 +0000 (08:03 -0300)
committerEshel Yaron <me@eshelyaron.com>
Sun, 12 Jan 2025 10:59:00 +0000 (11:59 +0100)
* lisp/wid-edit.el (widget-specify-button): Give the invisible
space the same 'face' property as the rest of the button.
(Bug#73911)

(cherry picked from commit 5060bf6ed64a6e96b4c660e6ad5204a23133b71d)

lisp/wid-edit.el

index 5f5d0151163d810cbc0afbb64800653ed94e021c..d8539ae5ed09aee19fb1fdf106be0f16b1a51a41 100644 (file)
@@ -459,17 +459,20 @@ the :notify function can't know the new value.")
   "Specify button for WIDGET between FROM and TO."
   (let ((overlay (make-overlay from to nil t nil))
        (follow-link (widget-get widget :follow-link))
-       (help-echo (widget-get widget :help-echo)))
+       (help-echo (widget-get widget :help-echo))
+       (face (unless (widget-get widget :suppress-face)
+               (widget-apply widget :button-face-get))))
     (widget-put widget :button-overlay overlay)
     (when (functionp help-echo)
       (setq help-echo 'widget-mouse-help))
-    (overlay-put overlay 'before-string #(" " 0 1 (invisible t)))
+    (overlay-put overlay 'before-string
+                 (propertize " " 'invisible t 'face face))
     (overlay-put overlay 'button widget)
     (overlay-put overlay 'keymap (widget-get widget :keymap))
     (overlay-put overlay 'evaporate t)
     ;; We want to avoid the face with image buttons.
-    (unless (widget-get widget :suppress-face)
-      (overlay-put overlay 'face (widget-apply widget :button-face-get))
+    (when face
+      (overlay-put overlay 'face face)
       (overlay-put overlay 'mouse-face
                   ;; Make new list structure for the mouse-face value
                   ;; so that different widgets will have