Mercurial > emacs
comparison lisp/cus-edit.el @ 26625:faf989c7a28e
(Custom-reset-standard): Doc fix.
(custom-variable-reset-standard): Doc fix.
(custom-face-reset-standard): Doc fix.
(custom-face-menu): "Reset to Standard" => "Erase Customization".
(custom-variable-menu): Likewise.
(custom-reset-menu): Likewise.
(custom-buffer-create-internal): Likewise.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 26 Nov 1999 19:46:14 +0000 |
parents | 91e697e38599 |
children | ea8ae3c8fad5 |
comparison
equal
deleted
inserted
replaced
26624:61bb2707437b | 26625:faf989c7a28e |
---|---|
655 (custom-save-all)) | 655 (custom-save-all)) |
656 | 656 |
657 (defvar custom-reset-menu | 657 (defvar custom-reset-menu |
658 '(("Current" . Custom-reset-current) | 658 '(("Current" . Custom-reset-current) |
659 ("Saved" . Custom-reset-saved) | 659 ("Saved" . Custom-reset-saved) |
660 ("Standard Settings" . Custom-reset-standard)) | 660 ("Erase Customization (use standard settings)" . Custom-reset-standard)) |
661 "Alist of actions for the `Reset' button. | 661 "Alist of actions for the `Reset' button. |
662 The key is a string containing the name of the action, the value is a | 662 The key is a string containing the name of the action, the value is a |
663 lisp function taking the widget as an element which will be called | 663 lisp function taking the widget as an element which will be called |
664 when the action is chosen.") | 664 when the action is chosen.") |
665 | 665 |
693 '(modified set changed rogue)) | 693 '(modified set changed rogue)) |
694 (widget-apply widget :custom-reset-saved)))) | 694 (widget-apply widget :custom-reset-saved)))) |
695 children))) | 695 children))) |
696 | 696 |
697 (defun Custom-reset-standard (&rest ignore) | 697 (defun Custom-reset-standard (&rest ignore) |
698 "Reset all modified, set, or saved group members to their standard settings." | 698 "Erase all customization (either current or saved) for the group members. |
699 The immediate result is to restore them to their standard settings. | |
700 This operation eliminates any saved settings for the group members, | |
701 making them as if they had never been customized at all." | |
699 (interactive) | 702 (interactive) |
700 (let ((children custom-options)) | 703 (let ((children custom-options)) |
701 (mapcar (lambda (widget) | 704 (mapcar (lambda (widget) |
702 (and (get (widget-value widget) 'standard-value) | 705 (and (get (widget-value widget) 'standard-value) |
703 (if (memq (widget-get widget :custom-state) | 706 (if (memq (widget-get widget :custom-state) |
1277 :help-echo "\ | 1280 :help-echo "\ |
1278 Reset all values in this buffer to their saved settings." | 1281 Reset all values in this buffer to their saved settings." |
1279 :action 'Custom-reset-saved) | 1282 :action 'Custom-reset-saved) |
1280 (widget-insert " ") | 1283 (widget-insert " ") |
1281 (widget-create 'push-button | 1284 (widget-create 'push-button |
1282 :tag "Reset to Standard" | 1285 :tag "Erase Customization" |
1283 :help-echo "\ | 1286 :help-echo "\ |
1284 Reset all values in this buffer to their standard settings." | 1287 Un-customize all values in this buffer. They get their standard settings." |
1285 :action 'Custom-reset-standard)) | 1288 :action 'Custom-reset-standard)) |
1286 (widget-insert " ") | 1289 (widget-insert " ") |
1287 (widget-create 'push-button | 1290 (widget-create 'push-button |
1288 :tag "Finish" | 1291 :tag "Finish" |
1289 :help-echo "Bury or kill the buffer." | 1292 :help-echo "Bury or kill the buffer." |
2251 (lambda (widget) | 2254 (lambda (widget) |
2252 (and (or (get (widget-value widget) 'saved-value) | 2255 (and (or (get (widget-value widget) 'saved-value) |
2253 (get (widget-value widget) 'saved-variable-comment)) | 2256 (get (widget-value widget) 'saved-variable-comment)) |
2254 (memq (widget-get widget :custom-state) | 2257 (memq (widget-get widget :custom-state) |
2255 '(modified set changed rogue))))) | 2258 '(modified set changed rogue))))) |
2256 ("Reset to Standard Settings" custom-variable-reset-standard | 2259 ("Erase Customization" custom-variable-reset-standard |
2257 (lambda (widget) | 2260 (lambda (widget) |
2258 (and (get (widget-value widget) 'standard-value) | 2261 (and (get (widget-value widget) 'standard-value) |
2259 (memq (widget-get widget :custom-state) | 2262 (memq (widget-get widget :custom-state) |
2260 '(modified set changed saved rogue))))) | 2263 '(modified set changed saved rogue))))) |
2261 ("---" ignore ignore) | 2264 ("---" ignore ignore) |
2270 "Alist of actions for the `custom-variable' widget. | 2273 "Alist of actions for the `custom-variable' widget. |
2271 Each entry has the form (NAME ACTION FILTER) where NAME is the name of | 2274 Each entry has the form (NAME ACTION FILTER) where NAME is the name of |
2272 the menu entry, ACTION is the function to call on the widget when the | 2275 the menu entry, ACTION is the function to call on the widget when the |
2273 menu is selected, and FILTER is a predicate which takes a `custom-variable' | 2276 menu is selected, and FILTER is a predicate which takes a `custom-variable' |
2274 widget as an argument, and returns non-nil if ACTION is valid on that | 2277 widget as an argument, and returns non-nil if ACTION is valid on that |
2275 widget. If FILTER is nil, ACTION is always valid.") | 2278 widget. If FILTER is nil, ACTION is always valid.") |
2276 | 2279 |
2277 (defun custom-variable-action (widget &optional event) | 2280 (defun custom-variable-action (widget &optional event) |
2278 "Show the menu for `custom-variable' WIDGET. | 2281 "Show the menu for `custom-variable' WIDGET. |
2279 Optional EVENT is the location for the menu." | 2282 Optional EVENT is the location for the menu." |
2280 (if (eq (widget-get widget :custom-state) 'hidden) | 2283 (if (eq (widget-get widget :custom-state) 'hidden) |
2399 (widget-put widget :custom-state 'unknown) | 2402 (widget-put widget :custom-state 'unknown) |
2400 ;; This call will possibly make the comment invisible | 2403 ;; This call will possibly make the comment invisible |
2401 (custom-redraw widget))) | 2404 (custom-redraw widget))) |
2402 | 2405 |
2403 (defun custom-variable-reset-standard (widget) | 2406 (defun custom-variable-reset-standard (widget) |
2404 "Restore the standard setting for the variable being edited by WIDGET." | 2407 "Restore the standard setting for the variable being edited by WIDGET. |
2408 This operation eliminates any saved setting for the variable, | |
2409 restoring it to the state of a variable that has never been customized." | |
2405 (let* ((symbol (widget-value widget)) | 2410 (let* ((symbol (widget-value widget)) |
2406 (set (or (get symbol 'custom-set) 'set-default)) | 2411 (set (or (get symbol 'custom-set) 'set-default)) |
2407 (comment-widget (widget-get widget :comment-widget))) | 2412 (comment-widget (widget-get widget :comment-widget))) |
2408 (if (get symbol 'standard-value) | 2413 (if (get symbol 'standard-value) |
2409 (funcall set symbol (eval (car (get symbol 'standard-value)))) | 2414 (funcall set symbol (eval (car (get symbol 'standard-value)))) |
2680 ("Save for Future Sessions" custom-face-save-command) | 2685 ("Save for Future Sessions" custom-face-save-command) |
2681 ("Reset to Saved" custom-face-reset-saved | 2686 ("Reset to Saved" custom-face-reset-saved |
2682 (lambda (widget) | 2687 (lambda (widget) |
2683 (or (get (widget-value widget) 'saved-face) | 2688 (or (get (widget-value widget) 'saved-face) |
2684 (get (widget-value widget) 'saved-face-comment)))) | 2689 (get (widget-value widget) 'saved-face-comment)))) |
2685 ("Reset to Standard Setting" custom-face-reset-standard | 2690 ("Erase Customization" custom-face-reset-standard |
2686 (lambda (widget) | 2691 (lambda (widget) |
2687 (get (widget-value widget) 'face-defface-spec))) | 2692 (get (widget-value widget) 'face-defface-spec))) |
2688 ("---" ignore ignore) | 2693 ("---" ignore ignore) |
2689 ("Add Comment" custom-comment-show custom-comment-invisible-p) | 2694 ("Add Comment" custom-comment-show custom-comment-invisible-p) |
2690 ("---" ignore ignore) | 2695 ("---" ignore ignore) |
2700 "Alist of actions for the `custom-face' widget. | 2705 "Alist of actions for the `custom-face' widget. |
2701 Each entry has the form (NAME ACTION FILTER) where NAME is the name of | 2706 Each entry has the form (NAME ACTION FILTER) where NAME is the name of |
2702 the menu entry, ACTION is the function to call on the widget when the | 2707 the menu entry, ACTION is the function to call on the widget when the |
2703 menu is selected, and FILTER is a predicate which takes a `custom-face' | 2708 menu is selected, and FILTER is a predicate which takes a `custom-face' |
2704 widget as an argument, and returns non-nil if ACTION is valid on that | 2709 widget as an argument, and returns non-nil if ACTION is valid on that |
2705 widget. If FILTER is nil, ACTION is always valid.") | 2710 widget. If FILTER is nil, ACTION is always valid.") |
2706 | 2711 |
2707 (defun custom-face-edit-selected (widget) | 2712 (defun custom-face-edit-selected (widget) |
2708 "Edit selected attributes of the value of WIDGET." | 2713 "Edit selected attributes of the value of WIDGET." |
2709 (widget-put widget :custom-state 'unknown) | 2714 (widget-put widget :custom-state 'unknown) |
2710 (widget-put widget :custom-form 'selected) | 2715 (widget-put widget :custom-form 'selected) |
2826 (widget-value-set comment-widget (or comment "")) | 2831 (widget-value-set comment-widget (or comment "")) |
2827 (custom-face-state-set widget) | 2832 (custom-face-state-set widget) |
2828 (custom-redraw-magic widget))) | 2833 (custom-redraw-magic widget))) |
2829 | 2834 |
2830 (defun custom-face-reset-standard (widget) | 2835 (defun custom-face-reset-standard (widget) |
2831 "Restore WIDGET to the face's standard settings." | 2836 "Restore WIDGET to the face's standard settings. |
2837 This operation eliminates any saved setting for the face, | |
2838 restoring it to the state of a face that has never been customized." | |
2832 (let* ((symbol (widget-value widget)) | 2839 (let* ((symbol (widget-value widget)) |
2833 (child (car (widget-get widget :children))) | 2840 (child (car (widget-get widget :children))) |
2834 (value (get symbol 'face-defface-spec)) | 2841 (value (get symbol 'face-defface-spec)) |
2835 (comment-widget (widget-get widget :comment-widget))) | 2842 (comment-widget (widget-get widget :comment-widget))) |
2836 (unless value | 2843 (unless value |