diff options
author | David Ponce <da_vid@orange.fr> | 2025-01-01 08:03:07 -0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2025-01-11 14:04:39 +0200 |
commit | 5060bf6ed64a6e96b4c660e6ad5204a23133b71d (patch) | |
tree | e9812fea931205e924bf5beddd3c0ae917c5767b /lisp | |
parent | d018a26f9cfb29b166199e88ec6ee84d06733851 (diff) | |
download | emacs-5060bf6ed64a6e96b4c660e6ad5204a23133b71d.tar.gz emacs-5060bf6ed64a6e96b4c660e6ad5204a23133b71d.tar.bz2 emacs-5060bf6ed64a6e96b4c660e6ad5204a23133b71d.zip |
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)
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/wid-edit.el | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index bf3a1141baf..26833ce591c 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 |