From e6e79b1e090df382ccc25c01305035b16cf3b8b6 Mon Sep 17 00:00:00 2001 From: David Ponce Date: Mon, 1 Jun 2026 11:35:15 +0200 Subject: [PATCH] Don't unconditionally append the :ascent property in wid-edit * lisp/wid-edit.el (widget-toggle-value-create): Don't duplicate the :ascent property if already set. (Bug#81167) --- lisp/wid-edit.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 3871d0f64c4..b81adc49a54 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -2546,9 +2546,13 @@ when he invoked the menu." (widget-get widget (if val :on :off)))) (img (widget-image-find (widget-get widget (if val :on-glyph :off-glyph))))) - (widget-image-insert widget (or text "") - (if img - (append img '(:ascent center)))))) + (and img (null (image-property img :ascent)) + ;; Unlike (setf (image-property img :ascent) 'center), a simple + ;; `append' will not modify img as a side effect, and is safe + ;; to use here because the :ascent property is guaranteed to be + ;; absent. + (setq img (append img '(:ascent center)))) + (widget-image-insert widget (or text "") img))) (defun widget-toggle-action (widget &optional event) ;; Toggle value.