summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/wid-edit.el10
1 files 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.