emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r102804: Fix r99654 change -- rename


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r102804: Fix r99654 change -- rename :on/off-image widget props to :on/off-glyph.
Date: Sun, 09 Jan 2011 16:05:53 -0500
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 102804
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Sun 2011-01-09 16:05:53 -0500
message:
  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.
modified:
  lisp/ChangeLog
  lisp/cus-edit.el
  lisp/wid-edit.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-01-09 19:34:19 +0000
+++ b/lisp/ChangeLog    2011-01-09 21:05:53 +0000
@@ -1,3 +1,16 @@
+2011-01-09  Chong Yidong  <address@hidden>
+
+       * 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  <address@hidden>
 
        * net/ldap.el (ldap-search-internal): Don't use eval.

=== modified file 'lisp/cus-edit.el'
--- a/lisp/cus-edit.el  2010-12-13 15:27:36 +0000
+++ b/lisp/cus-edit.el  2011-01-09 21:05:53 +0000
@@ -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)

=== modified file 'lisp/wid-edit.el'
--- a/lisp/wid-edit.el  2010-12-21 02:36:48 +0000
+++ b/lisp/wid-edit.el  2011-01-09 21:05:53 +0000
@@ -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.
 ;;


reply via email to

[Prev in Thread] Current Thread [Next in Thread]