From: Richard M. Stallman Date: Sat, 21 Jun 1997 18:32:42 +0000 (+0000) Subject: (group-visibility): New widget type. X-Git-Tag: emacs-20.1~1577 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=515c9d0d0876ba4b51809e16f3a0dd80fd822bea;p=emacs.git (group-visibility): New widget type. (widget-group-visibility-create): New function. --- 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'.