Commit 647f9993 authored by Chong Yidong's avatar Chong Yidong

Improvements to the Custom interface.

* cus-edit.el: Resort topmost custom groups.
(custom-buffer-sort-alphabetically): Default to t.
(customize-apropos): Use apropos-parse-pattern.
(custom-search-field): New var.
(custom-buffer-create-internal): Add custom-apropos search field.
(custom-add-parent-links): Don't display parent doc.
(custom-group-value-create): Don't sort top-level custom group.
(custom-magic-value-create): Show visibility button before option
name.

(custom-variable-state): New fun, from custom-variable-state-set.
(custom-variable-state-set): Use it.
(custom-group-value-create): Hide options with standard values
using the :hidden-states property.  Use progress reporter.

(custom-show): Simplify.
(custom-visibility): Disable images by default.
(custom-variable): New property :hidden-states.
(custom-variable-value-create): Enable images for
custom-visibility widgets.  Use :hidden-states property to
determine initial visibility.

* wid-edit.el (widget-image-find): Give images center ascent.
(visibility): Add :on-image and :off-image properties.
(widget-visibility-value-create): Use them.
parent e3c5dd11
2010-03-12 Chong Yidong <cyd@stupidchicken.com>
* cus-edit.el: Resort topmost custom groups.
(custom-buffer-sort-alphabetically): Default to t.
(customize-apropos): Use apropos-parse-pattern.
(custom-search-field): New var.
(custom-buffer-create-internal): Add custom-apropos search field.
(custom-add-parent-links): Don't display parent doc.
(custom-group-value-create): Don't sort top-level custom group.
(custom-magic-value-create): Show visibility button before option
name.
(custom-variable-state): New fun, from custom-variable-state-set.
(custom-variable-state-set): Use it.
(custom-group-value-create): Hide options with standard values
using the :hidden-states property. Use progress reporter.
(custom-show): Simplify.
(custom-visibility): Disable images by default.
(custom-variable): New property :hidden-states.
(custom-variable-value-create): Enable images for
custom-visibility widgets. Use :hidden-states property to
determine initial visibility.
* wid-edit.el (widget-image-find): Give images center ascent.
(visibility): Add :on-image and :off-image properties.
(widget-visibility-value-create): Use them.
2010-03-12 Chong Yidong <cyd@stupidchicken.com>
* cus-edit.el (processes): Remove from development group.
......
This diff is collapsed.
......@@ -639,8 +639,7 @@ extension (xpm, xbm, gif, jpg, or png) located in
(dolist (elt widget-image-conversion)
(dolist (ext (cdr elt))
(push (list :type (car elt) :file (concat image ext)) specs)))
(setq specs (nreverse specs))
(find-image specs)))
(find-image (nreverse specs))))
(t
;; Oh well.
nil)))
......@@ -2806,11 +2805,19 @@ Return an alist of (TYPE MATCH)."
;;; The `visibility' Widget.
(define-widget 'visibility 'item
"An indicator and manipulator for hidden items."
"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 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 Text shown if the \"off\" image is nil cannot be displayed."
:format "%[%v%]"
:button-prefix ""
:button-suffix ""
:on-image "down"
:on "Hide"
:off-image "right"
:off "Show"
:value-create 'widget-visibility-value-create
:action 'widget-toggle-action
......@@ -2818,21 +2825,17 @@ Return an alist of (TYPE MATCH)."
(defun widget-visibility-value-create (widget)
;; Insert text representing the `on' and `off' states.
(let ((on (widget-get widget :on))
(off (widget-get widget :off)))
(if on
(setq on (concat widget-push-button-prefix
on
widget-push-button-suffix))
(setq on ""))
(if off
(setq off (concat widget-push-button-prefix
off
widget-push-button-suffix))
(setq off ""))
(if (widget-value widget)
(widget-image-insert widget on "down" "down-pushed")
(widget-image-insert widget off "right" "right-pushed"))))
(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))))))
;;; The `documentation-link' Widget.
;;
......@@ -2935,7 +2938,7 @@ link for that string."
(widget-create-child-and-convert
widget (widget-get widget :visibility-widget)
:help-echo "Show or hide rest of the documentation."
:on "Hide Rest"
:on "Hide"
:off "More"
:always-active t
:action 'widget-parent-action
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment