From 515c9d0d0876ba4b51809e16f3a0dd80fd822bea Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 21 Jun 1997 18:32:42 +0000 Subject: [PATCH] (group-visibility): New widget type. (widget-group-visibility-create): New function. --- lisp/wid-edit.el | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 898ad25924d..504eda3d8bd 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -2621,6 +2621,24 @@ when he invoked the menu." (widget-glyph-insert widget on "down" "down-pushed") (widget-glyph-insert widget off "right" "right-pushed")))) +(define-widget 'group-visibility 'item + "An indicator and manipulator for hidden group contents." + :format "%[%v%]" + :create 'widget-group-visibility-create + :button-prefix "" + :button-suffix "" + :on "Hide" + :off "Show" + :value-create 'widget-visibility-value-create + :action 'widget-toggle-action + :match (lambda (widget value) t)) + +(defun widget-group-visibility-create (widget) + (let ((visible (widget-value widget))) + (if visible + (insert "--------"))) + (widget-default-create widget)) + ;;; The `documentation-link' Widget. ;; ;; This is a helper widget for `documentation-string'. -- 2.39.5