comparison lisp/cus-edit.el @ 18430:a8ae9c653696

(custom-group-visibility): Widget type moved from wid-edit.el and renamed from group-visibility. (custom-group-visibility-create): Function renamed and moved from wid-edit.el. (custom-state-buffer-message): New function. (custom-mode): Add custom-state-buffer-message to widget-edit-hook.
author Richard M. Stallman <rms@gnu.org>
date Tue, 24 Jun 1997 03:17:58 +0000
parents 45ef45c34aa4
children 2f906938425b
comparison
equal deleted inserted replaced
18429:8326843eefd9 18430:a8ae9c653696
2395 2395
2396 (defun custom-group-sample-face-get (widget) 2396 (defun custom-group-sample-face-get (widget)
2397 ;; Use :sample-face. 2397 ;; Use :sample-face.
2398 (or (nth (1- (widget-get widget :custom-level)) custom-group-tag-faces) 2398 (or (nth (1- (widget-get widget :custom-level)) custom-group-tag-faces)
2399 'custom-group-tag-face)) 2399 'custom-group-tag-face))
2400
2401 (define-widget 'custom-group-visibility 'visibility
2402 "An indicator and manipulator for hidden group contents."
2403 :create 'custom-group-visibility-create)
2404
2405 (defun custom-group-visibility-create (widget)
2406 (let ((visible (widget-value widget)))
2407 (if visible
2408 (insert "--------")))
2409 (widget-default-create widget))
2400 2410
2401 (defun custom-group-value-create (widget) 2411 (defun custom-group-value-create (widget)
2402 "Insert a customize group for WIDGET in the current buffer." 2412 "Insert a customize group for WIDGET in the current buffer."
2403 (let ((state (widget-get widget :custom-state)) 2413 (let ((state (widget-get widget :custom-state))
2404 (level (widget-get widget :custom-level)) 2414 (level (widget-get widget :custom-level))
2977 (defcustom custom-mode-hook nil 2987 (defcustom custom-mode-hook nil
2978 "Hook called when entering custom-mode." 2988 "Hook called when entering custom-mode."
2979 :type 'hook 2989 :type 'hook
2980 :group 'custom-buffer ) 2990 :group 'custom-buffer )
2981 2991
2992 (defun custom-state-buffer-message ()
2993 (message "To set the value, invoke [State] and choose the Set operation"))
2994
2982 (defun custom-mode () 2995 (defun custom-mode ()
2983 "Major mode for editing customization buffers. 2996 "Major mode for editing customization buffers.
2984 2997
2985 The following commands are available: 2998 The following commands are available:
2986 2999
3000 (setq major-mode 'custom-mode 3013 (setq major-mode 'custom-mode
3001 mode-name "Custom") 3014 mode-name "Custom")
3002 (use-local-map custom-mode-map) 3015 (use-local-map custom-mode-map)
3003 (easy-menu-add custom-mode-menu) 3016 (easy-menu-add custom-mode-menu)
3004 (make-local-variable 'custom-options) 3017 (make-local-variable 'custom-options)
3018 (make-local-hook 'widget-edit-hook)
3019 (add-hook 'widget-edit-hook 'custom-state-buffer-message nil t)
3005 (run-hooks 'custom-mode-hook)) 3020 (run-hooks 'custom-mode-hook))
3006 3021
3007 ;;; The End. 3022 ;;; The End.
3008 3023
3009 (provide 'cus-edit) 3024 (provide 'cus-edit)