Mercurial > emacs
changeset 112175:e09ac5ef1fe4
Fix r99654 change -- rename :on/off-image widget props to :on/off-glyph.
* wid-edit.el (visibility): Replace :on-image and :off-image
widget properties with :on-glyph and :off-glyph, for consistency
with the `visibility' widget.
(widget-toggle-value-create, widget-visibility-value-create):
Merge into a single function `widget-toggle-value-create'.
* cus-edit.el (custom-variable-value-create, custom-visibility)
(custom-face-edit-value-create, custom-face-value-create): Replace
:on-image and :off-image widget properties with :on-glyph and
:off-glyph, for consistency with the `visibility' widget.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Sun, 09 Jan 2011 16:05:53 -0500 |
parents | efdf56b1332d |
children | 60bee8db359c |
files | lisp/ChangeLog lisp/cus-edit.el lisp/wid-edit.el |
diffstat | 3 files changed, 35 insertions(+), 42 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ChangeLog Sun Jan 09 20:34:20 2011 +0100 +++ b/lisp/ChangeLog Sun Jan 09 16:05:53 2011 -0500 @@ -1,3 +1,16 @@ +2011-01-09 Chong Yidong <cyd@stupidchicken.com> + + * wid-edit.el (visibility): Replace :on-image and :off-image + widget properties with :on-glyph and :off-glyph, for consistency + with the `visibility' widget. + (widget-toggle-value-create, widget-visibility-value-create): + Merge into a single function `widget-toggle-value-create'. + + * cus-edit.el (custom-variable-value-create, custom-visibility) + (custom-face-edit-value-create, custom-face-value-create): Replace + :on-image and :off-image widget properties with :on-glyph and + :off-glyph, for consistency with the `visibility' widget. + 2011-01-09 Andreas Schwab <schwab@linux-m68k.org> * net/ldap.el (ldap-search-internal): Don't use eval.
--- a/lisp/cus-edit.el Sun Jan 09 20:34:20 2011 +0100 +++ b/lisp/cus-edit.el Sun Jan 09 16:05:53 2011 -0500 @@ -2551,9 +2551,9 @@ (push (widget-create-child-and-convert widget 'custom-visibility :help-echo "Show the value of this option." - :on-image "down" + :on-glyph "down" :on "Hide" - :off-image "right" + :off-glyph "right" :off "Show Value" :action 'custom-toggle-hide-variable nil) @@ -2573,8 +2573,8 @@ :help-echo "Hide the value of this option." :on "Hide" :off "Show" - :on-image "down" - :off-image "right" + :on-glyph "down" + :off-glyph "right" :action 'custom-toggle-hide-variable t) buttons) @@ -2603,8 +2603,8 @@ :help-echo "Hide or show this option." :on "Hide" :off "Show" - :on-image "down" - :off-image "right" + :on-glyph "down" + :off-glyph "right" :action 'custom-toggle-hide-variable t) buttons) @@ -3056,8 +3056,8 @@ :pressed-face 'custom-visibility :mouse-face 'highlight :pressed-face 'highlight - :on-image nil - :off-image nil) + :on-glyph nil + :off-glyph nil) (defface custom-visibility '((t :height 0.8 :inherit link)) @@ -3120,7 +3120,7 @@ :pressed-face 'custom-visibility :mouse-face 'highlight :on "Hide Unused Attributes" :off "Show All Attributes" - :on-image nil :off-image nil + :on-glyph nil :off-glyph nil :always-active t :action 'custom-face-edit-value-visibility-action show-all) @@ -3475,7 +3475,7 @@ widget 'custom-visibility :help-echo "Hide or show this face." :on "Hide" :off "Show" - :on-image "down" :off-image "right" + :on-glyph "down" :off-glyph "right" :action 'custom-toggle-hide-face (not hiddenp)) buttons)
--- a/lisp/wid-edit.el Sun Jan 09 20:34:20 2011 +0100 +++ b/lisp/wid-edit.el Sun Jan 09 16:05:53 2011 -0500 @@ -2162,21 +2162,13 @@ (defun widget-toggle-value-create (widget) "Insert text representing the `on' and `off' states." - (if (widget-value widget) - (let ((image (widget-get widget :on-glyph))) - (and (display-graphic-p) - (listp image) - (not (eq (car image) 'image)) - (widget-put widget :on-glyph (setq image (eval image)))) - (widget-image-insert widget - (widget-get widget :on) - 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)))) + (let* ((val (widget-value widget)) + (text (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)))))) (defun widget-toggle-action (widget &optional event) ;; Toggle value. @@ -2816,34 +2808,22 @@ "An indicator and manipulator for hidden items. The following properties have special meanings for this widget: -:on-image Image filename or spec to display when the item is visible. +:on-glyph Image filename or spec to display when the item is visible. :on Text shown if the \"on\" image is nil or cannot be displayed. -:off-image Image filename or spec to display when the item is hidden. +:off-glyph Image filename or spec to display when the item is hidden. :off Text shown if the \"off\" image is nil cannot be displayed." :format "%[%v%]" :button-prefix "" :button-suffix "" - :on-image "down" + :on-glyph "down" :on "Hide" - :off-image "right" + :off-glyph "right" :off "Show" :value-create 'widget-visibility-value-create :action 'widget-toggle-action :match (lambda (widget value) t)) -(defun widget-visibility-value-create (widget) - ;; Insert text representing the `on' and `off' states. - (let* ((val (widget-value widget)) - (text (widget-get widget (if val :on :off))) - (img (widget-image-find - (widget-get widget (if val :on-image :off-image))))) - (widget-image-insert widget - (if text - (concat widget-push-button-prefix text - widget-push-button-suffix) - "") - (if img - (append img '(:ascent center)))))) +(defalias 'widget-visibility-value-create 'widget-toggle-value-create) ;;; The `documentation-link' Widget. ;;