# HG changeset patch # User Miles Bader # Date 1009465641 0 # Node ID 6a1a8da1ad470eb5034e3f4c9e6ae2a380e1bb9b # Parent 97b1dcf7ef6042cb6d247d79f2eadd51e2ff49c5 (widget-toggle-value-create): Don't eval actual images (which are lists too). diff -r 97b1dcf7ef60 -r 6a1a8da1ad47 lisp/wid-edit.el --- a/lisp/wid-edit.el Thu Dec 27 11:27:27 2001 +0000 +++ b/lisp/wid-edit.el Thu Dec 27 15:07:21 2001 +0000 @@ -2001,21 +2001,20 @@ (defun widget-toggle-value-create (widget) "Insert text representing the `on' and `off' states." (if (widget-value widget) - (progn + (let ((image (widget-get widget :on-glyph))) (and (display-graphic-p) - (listp (widget-get widget :on-glyph)) - (widget-put widget :on-glyph - (eval (widget-get widget :on-glyph)))) + (listp image) + (not (eq (car image) 'image)) + (widget-put widget :on-glyph (setq image (eval image)))) (widget-image-insert widget (widget-get widget :on) - (widget-get widget :on-glyph))) - (and (display-graphic-p) - (listp (widget-get widget :off-glyph)) - (widget-put widget :off-glyph - (eval (widget-get widget :off-glyph)))) - (widget-image-insert widget - (widget-get widget :off) - (widget-get widget :off-glyph)))) + image)) + (let ((image (widget-get widget :off-glyph))) + (and (display-graphic-p) + (listp image) + (not (eq (car image) 'image)) + (widget-put widget :off-glyph (setq image (eval image)))) + (widget-image-insert widget (widget-get widget :off) image)))) (defun widget-toggle-action (widget &optional event) ;; Toggle value.