aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1997-06-24 03:17:34 +0000
committerRichard M. Stallman1997-06-24 03:17:34 +0000
commit211c9fe92068f0ae73a239b23d9c32fe55873cc3 (patch)
treea03bd0d56c4f912941fbd896cc575573a2ca4690
parente863e26439fb8e844e218ce21da41cd748cef904 (diff)
downloademacs-211c9fe92068f0ae73a239b23d9c32fe55873cc3.tar.gz
emacs-211c9fe92068f0ae73a239b23d9c32fe55873cc3.zip
(widget-edit-hook): New variable.
(widget-field-action, widget-choice-action): Run that hook instead of displaying an echo area message. (widget-toggle-action): Likewise. (group-visibility, widget-group-visibility-create): Moved to cus-edit.el and renamed.
-rw-r--r--lisp/wid-edit.el18
1 files changed, 5 insertions, 13 deletions
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index 7750fd74094..1a445d57321 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -1716,10 +1716,12 @@ If END is omitted, it defaults to the length of LIST."
1716 :prompt-internal prompt initial history))) 1716 :prompt-internal prompt initial history)))
1717 (widget-apply widget :value-to-external answer)))) 1717 (widget-apply widget :value-to-external answer))))
1718 1718
1719(defvar widget-edit-hook nil)
1720
1719(defun widget-field-action (widget &optional event) 1721(defun widget-field-action (widget &optional event)
1720 ;; Move to next field. 1722 ;; Move to next field.
1721 (widget-forward 1) 1723 (widget-forward 1)
1722 (message "To set the value, invoke [State] and choose the Set operation")) 1724 (run-hooks 'widget-edit-hook))
1723 1725
1724(defun widget-field-validate (widget) 1726(defun widget-field-validate (widget)
1725 ;; Valid if the content matches `:valid-regexp'. 1727 ;; Valid if the content matches `:valid-regexp'.
@@ -1915,7 +1917,7 @@ when he invoked the menu."
1915 (widget-get current :value))) 1917 (widget-get current :value)))
1916 (widget-setup) 1918 (widget-setup)
1917 (widget-apply widget :notify widget event))) 1919 (widget-apply widget :notify widget event)))
1918 (message "To set the value, invoke [State] and choose the Set operation")) 1920 (run-hooks 'widget-edit-hook))
1919 1921
1920(defun widget-choice-validate (widget) 1922(defun widget-choice-validate (widget)
1921 ;; Valid if we have made a valid choice. 1923 ;; Valid if we have made a valid choice.
@@ -1971,7 +1973,7 @@ when he invoked the menu."
1971 ;; Toggle value. 1973 ;; Toggle value.
1972 (widget-value-set widget (not (widget-value widget))) 1974 (widget-value-set widget (not (widget-value widget)))
1973 (widget-apply widget :notify widget event) 1975 (widget-apply widget :notify widget event)
1974 (message "To set the value, invoke [State] and choose the Set operation")) 1976 (run-hooks 'widget-edit-hook))
1975 1977
1976;;; The `checkbox' Widget. 1978;;; The `checkbox' Widget.
1977 1979
@@ -2631,16 +2633,6 @@ when he invoked the menu."
2631 (widget-glyph-insert widget on "down" "down-pushed") 2633 (widget-glyph-insert widget on "down" "down-pushed")
2632 (widget-glyph-insert widget off "right" "right-pushed")))) 2634 (widget-glyph-insert widget off "right" "right-pushed"))))
2633 2635
2634(define-widget 'group-visibility 'visibility
2635 "An indicator and manipulator for hidden group contents."
2636 :create 'widget-group-visibility-create)
2637
2638(defun widget-group-visibility-create (widget)
2639 (let ((visible (widget-value widget)))
2640 (if visible
2641 (insert "--------")))
2642 (widget-default-create widget))
2643
2644;;; The `documentation-link' Widget. 2636;;; The `documentation-link' Widget.
2645;; 2637;;
2646;; This is a helper widget for `documentation-string'. 2638;; This is a helper widget for `documentation-string'.