From eed0b1f96f1adaa6108b7505b8dffb7b166b0173 Mon Sep 17 00:00:00 2001 From: David Ponce Date: Wed, 1 Jan 2025 08:03:07 -0300 Subject: [PATCH] Fix widget buttons when button prefix includes space * 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 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 5f5d0151163..d8539ae5ed0 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -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 -- 2.39.5