diff options
| author | Richard M. Stallman | 1997-07-03 07:09:29 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-07-03 07:09:29 +0000 |
| commit | 3aec85bf553bd5ce6d513a963e95305df383849d (patch) | |
| tree | 21795aae8a9c7c62ac0432e8c0599ee4fe40f21b | |
| parent | 2f5ee43fcf91d16051f78d79bf4a9cff73baa38e (diff) | |
| download | emacs-3aec85bf553bd5ce6d513a963e95305df383849d.tar.gz emacs-3aec85bf553bd5ce6d513a963e95305df383849d.zip | |
(custom-buffer-create-internal): New arg DESCRIPTION
is inserted in the buffer to describe it.
(custom-buffer-create-other-window, custom-buffer-create):
New arg DESCRIBE; pass it along.
(customize-group): Pass DESCRIBE argument.
(custom-face-menu): Improve Set and Save item strings.
(custom-group-menu): Likewise.
(custom): Don't set :button-face.
(custom-mode): Use custom-button-face here
as buffer-local value of widget-button-face.
| -rw-r--r-- | lisp/cus-edit.el | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 156b78b793f..eb80e462a24 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el | |||
| @@ -795,7 +795,9 @@ are shown; the contents of those subgroups are initially hidden." | |||
| 795 | (if (get-buffer name) | 795 | (if (get-buffer name) |
| 796 | (switch-to-buffer name) | 796 | (switch-to-buffer name) |
| 797 | (custom-buffer-create (list (list group 'custom-group)) | 797 | (custom-buffer-create (list (list group 'custom-group)) |
| 798 | name)))) | 798 | name |
| 799 | (concat " for group " | ||
| 800 | (custom-unlispify-tag-name group)))))) | ||
| 799 | 801 | ||
| 800 | ;;;###autoload | 802 | ;;;###autoload |
| 801 | (defun customize-group-other-window (symbol) | 803 | (defun customize-group-other-window (symbol) |
| @@ -976,7 +978,7 @@ links: groups have links to subgroups." | |||
| 976 | :group 'custom-buffer) | 978 | :group 'custom-buffer) |
| 977 | 979 | ||
| 978 | ;;;###autoload | 980 | ;;;###autoload |
| 979 | (defun custom-buffer-create (options &optional name) | 981 | (defun custom-buffer-create (options &optional name description) |
| 980 | "Create a buffer containing OPTIONS. | 982 | "Create a buffer containing OPTIONS. |
| 981 | Optional NAME is the name of the buffer. | 983 | Optional NAME is the name of the buffer. |
| 982 | OPTIONS should be an alist of the form ((SYMBOL WIDGET)...), where | 984 | OPTIONS should be an alist of the form ((SYMBOL WIDGET)...), where |
| @@ -985,10 +987,10 @@ that option." | |||
| 985 | (unless name (setq name "*Customization*")) | 987 | (unless name (setq name "*Customization*")) |
| 986 | (kill-buffer (get-buffer-create name)) | 988 | (kill-buffer (get-buffer-create name)) |
| 987 | (switch-to-buffer (get-buffer-create name)) | 989 | (switch-to-buffer (get-buffer-create name)) |
| 988 | (custom-buffer-create-internal options)) | 990 | (custom-buffer-create-internal options description)) |
| 989 | 991 | ||
| 990 | ;;;###autoload | 992 | ;;;###autoload |
| 991 | (defun custom-buffer-create-other-window (options &optional name) | 993 | (defun custom-buffer-create-other-window (options &optional name description) |
| 992 | "Create a buffer containing OPTIONS. | 994 | "Create a buffer containing OPTIONS. |
| 993 | Optional NAME is the name of the buffer. | 995 | Optional NAME is the name of the buffer. |
| 994 | OPTIONS should be an alist of the form ((SYMBOL WIDGET)...), where | 996 | OPTIONS should be an alist of the form ((SYMBOL WIDGET)...), where |
| @@ -998,7 +1000,7 @@ that option." | |||
| 998 | (kill-buffer (get-buffer-create name)) | 1000 | (kill-buffer (get-buffer-create name)) |
| 999 | (let ((window (selected-window))) | 1001 | (let ((window (selected-window))) |
| 1000 | (switch-to-buffer-other-window (get-buffer-create name)) | 1002 | (switch-to-buffer-other-window (get-buffer-create name)) |
| 1001 | (custom-buffer-create-internal options) | 1003 | (custom-buffer-create-internal options description) |
| 1002 | (select-window window))) | 1004 | (select-window window))) |
| 1003 | 1005 | ||
| 1004 | (defcustom custom-reset-button-menu nil | 1006 | (defcustom custom-reset-button-menu nil |
| @@ -1007,12 +1009,18 @@ This button will have a menu with all three reset operations." | |||
| 1007 | :type 'boolean | 1009 | :type 'boolean |
| 1008 | :group 'custom-buffer) | 1010 | :group 'custom-buffer) |
| 1009 | 1011 | ||
| 1010 | (defun custom-buffer-create-internal (options) | 1012 | (defun custom-buffer-create-internal (options &optional description) |
| 1011 | (message "Creating customization buffer...") | 1013 | (message "Creating customization buffer...") |
| 1012 | (custom-mode) | 1014 | (custom-mode) |
| 1013 | (widget-insert "This is a customization buffer. | 1015 | (widget-insert "This is a customization buffer") |
| 1016 | (if description | ||
| 1017 | (widget-insert description)) | ||
| 1018 | (widget-insert ". | ||
| 1014 | Square brackets show active fields; type RET or click mouse-1 | 1019 | Square brackets show active fields; type RET or click mouse-1 |
| 1015 | on an active field to invoke its action. Invoke ") | 1020 | on an active field to invoke its action. Editing an option value |
| 1021 | changes the text in the buffer; invoke the State button and | ||
| 1022 | choose the Set operation to set the option value. | ||
| 1023 | Invoke ") | ||
| 1016 | (widget-create 'info-link | 1024 | (widget-create 'info-link |
| 1017 | :tag "Help" | 1025 | :tag "Help" |
| 1018 | :help-echo "Read the online help." | 1026 | :help-echo "Read the online help." |
| @@ -1495,7 +1503,6 @@ and `face'." | |||
| 1495 | :value-delete 'widget-children-value-delete | 1503 | :value-delete 'widget-children-value-delete |
| 1496 | :value-get 'widget-value-value-get | 1504 | :value-get 'widget-value-value-get |
| 1497 | :validate 'widget-children-validate | 1505 | :validate 'widget-children-validate |
| 1498 | :button-face 'custom-button-face | ||
| 1499 | :match (lambda (widget value) (symbolp value))) | 1506 | :match (lambda (widget value) (symbolp value))) |
| 1500 | 1507 | ||
| 1501 | (defun custom-convert-widget (widget) | 1508 | (defun custom-convert-widget (widget) |
| @@ -2277,8 +2284,8 @@ Match frames with dark backgrounds.") | |||
| 2277 | (message "Creating face editor...done")))))) | 2284 | (message "Creating face editor...done")))))) |
| 2278 | 2285 | ||
| 2279 | (defvar custom-face-menu | 2286 | (defvar custom-face-menu |
| 2280 | '(("Set" custom-face-set) | 2287 | '(("Set for Current Session" custom-face-set) |
| 2281 | ("Save" custom-face-save) | 2288 | ("Save for Future Sessions" custom-face-save) |
| 2282 | ("Reset to Saved" custom-face-reset-saved | 2289 | ("Reset to Saved" custom-face-reset-saved |
| 2283 | (lambda (widget) | 2290 | (lambda (widget) |
| 2284 | (get (widget-value widget) 'saved-face))) | 2291 | (get (widget-value widget) 'saved-face))) |
| @@ -2764,10 +2771,10 @@ Creating group members... %2d%%" | |||
| 2764 | (insert "/\n"))))) | 2771 | (insert "/\n"))))) |
| 2765 | 2772 | ||
| 2766 | (defvar custom-group-menu | 2773 | (defvar custom-group-menu |
| 2767 | '(("Set" custom-group-set | 2774 | '(("Set for Current Session" custom-group-set |
| 2768 | (lambda (widget) | 2775 | (lambda (widget) |
| 2769 | (eq (widget-get widget :custom-state) 'modified))) | 2776 | (eq (widget-get widget :custom-state) 'modified))) |
| 2770 | ("Save" custom-group-save | 2777 | ("Save for Future Sessions" custom-group-save |
| 2771 | (lambda (widget) | 2778 | (lambda (widget) |
| 2772 | (memq (widget-get widget :custom-state) '(modified set)))) | 2779 | (memq (widget-get widget :custom-state) '(modified set)))) |
| 2773 | ("Reset to Current" custom-group-reset-current | 2780 | ("Reset to Current" custom-group-reset-current |
| @@ -3195,6 +3202,8 @@ if that value is non-nil." | |||
| 3195 | (make-local-variable 'custom-options) | 3202 | (make-local-variable 'custom-options) |
| 3196 | (make-local-variable 'widget-documentation-face) | 3203 | (make-local-variable 'widget-documentation-face) |
| 3197 | (setq widget-documentation-face 'custom-documentation-face) | 3204 | (setq widget-documentation-face 'custom-documentation-face) |
| 3205 | (make-local-variable 'widget-button-face) | ||
| 3206 | (setq widget-button-face 'custom-button-face) | ||
| 3198 | (make-local-hook 'widget-edit-functions) | 3207 | (make-local-hook 'widget-edit-functions) |
| 3199 | (add-hook 'widget-edit-functions 'custom-state-buffer-message nil t) | 3208 | (add-hook 'widget-edit-functions 'custom-state-buffer-message nil t) |
| 3200 | (run-hooks 'custom-mode-hook)) | 3209 | (run-hooks 'custom-mode-hook)) |