aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2006-01-02 03:38:43 +0000
committerRichard M. Stallman2006-01-02 03:38:43 +0000
commit107736a270f800eb8cf383dfd677922002c235eb (patch)
treeee651355eef362f90671642c5b28e512a36882e5
parentd49ed7d4bc39227447297f960f497f1b51552cec (diff)
downloademacs-107736a270f800eb8cf383dfd677922002c235eb.tar.gz
emacs-107736a270f800eb8cf383dfd677922002c235eb.zip
(Custom-set, Custom-save): Ask for confirmation.
(Custom-reset-current, Custom-reset-saved): Likewise. (Custom-reset-standard): Likewise. (custom-mode): Doc fix, describing those commands.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/cus-edit.el95
2 files changed, 58 insertions, 42 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 2e187fed24b..b254c481a12 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,10 @@
12006-01-01 Richard M. Stallman <rms@gnu.org> 12006-01-01 Richard M. Stallman <rms@gnu.org>
2 2
3 * cus-edit.el (Custom-set, Custom-save): Ask for confirmation.
4 (Custom-reset-current, Custom-reset-saved): Likewise.
5 (Custom-reset-standard): Likewise.
6 (custom-mode): Doc fix, describing those commands.
7
3 * mouse.el (mouse-drag-region-1): When following link via mouse-2, 8 * mouse.el (mouse-drag-region-1): When following link via mouse-2,
4 put on event-kind property. 9 put on event-kind property.
5 10
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 6beaa5f65ec..55b739b9b4b 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -746,22 +746,26 @@ groups after non-groups, if nil do not order groups at all."
746(defun Custom-set () 746(defun Custom-set ()
747 "Set changes in all modified options." 747 "Set changes in all modified options."
748 (interactive) 748 (interactive)
749 (let ((children custom-options)) 749 (if (y-or-n-p "Set all values according to this buffer? ")
750 (mapc (lambda (child) 750 (let ((children custom-options))
751 (when (eq (widget-get child :custom-state) 'modified) 751 (mapc (lambda (child)
752 (widget-apply child :custom-set))) 752 (when (eq (widget-get child :custom-state) 'modified)
753 children))) 753 (widget-apply child :custom-set)))
754 children))
755 (message "Aborted")))
754 756
755(defun Custom-save () 757(defun Custom-save ()
756 "Set all modified group members and save them." 758 "Set all modified group members and save them."
757 (interactive) 759 (interactive)
758 (let ((children custom-options)) 760 (if (yes-or-no-p "Save all settings in this buffer? ")
759 (mapc (lambda (child) 761 (let ((children custom-options))
760 (when (memq (widget-get child :custom-state) 762 (mapc (lambda (child)
761 '(modified set changed rogue)) 763 (when (memq (widget-get child :custom-state)
762 (widget-apply child :custom-save))) 764 '(modified set changed rogue))
763 children)) 765 (widget-apply child :custom-save)))
764 (custom-save-all)) 766 children)
767 (custom-save-all))
768 (message "Aborted")))
765 769
766(defvar custom-reset-menu 770(defvar custom-reset-menu
767 '(("Current" . Custom-reset-current) 771 '(("Current" . Custom-reset-current)
@@ -784,22 +788,26 @@ when the action is chosen.")
784(defun Custom-reset-current (&rest ignore) 788(defun Custom-reset-current (&rest ignore)
785 "Reset all modified group members to their current value." 789 "Reset all modified group members to their current value."
786 (interactive) 790 (interactive)
787 (let ((children custom-options)) 791 (if (y-or-n-p "Update buffer text to show all current settings? ")
788 (mapc (lambda (widget) 792 (let ((children custom-options))
789 (if (memq (widget-get widget :custom-state) 793 (mapc (lambda (widget)
790 '(modified changed)) 794 (if (memq (widget-get widget :custom-state)
791 (widget-apply widget :custom-reset-current))) 795 '(modified changed))
792 children))) 796 (widget-apply widget :custom-reset-current)))
797 children))
798 (message "Aborted")))
793 799
794(defun Custom-reset-saved (&rest ignore) 800(defun Custom-reset-saved (&rest ignore)
795 "Reset all modified or set group members to their saved value." 801 "Reset all modified or set group members to their saved value."
796 (interactive) 802 (interactive)
797 (let ((children custom-options)) 803 (if (y-or-n-p "Update buffer text to show all saved settings? ")
798 (mapc (lambda (widget) 804 (let ((children custom-options))
799 (if (memq (widget-get widget :custom-state) 805 (mapc (lambda (widget)
800 '(modified set changed rogue)) 806 (if (memq (widget-get widget :custom-state)
801 (widget-apply widget :custom-reset-saved))) 807 '(modified set changed rogue))
802 children))) 808 (widget-apply widget :custom-reset-saved)))
809 children))
810 (message "Aborted")))
803 811
804(defun Custom-reset-standard (&rest ignore) 812(defun Custom-reset-standard (&rest ignore)
805 "Erase all customization (either current or saved) for the group members. 813 "Erase all customization (either current or saved) for the group members.
@@ -807,19 +815,21 @@ The immediate result is to restore them to their standard values.
807This operation eliminates any saved values for the group members, 815This operation eliminates any saved values for the group members,
808making them as if they had never been customized at all." 816making them as if they had never been customized at all."
809 (interactive) 817 (interactive)
810 (let ((children custom-options)) 818 (if (yes-or-no-p "Eliminate saved values for all settings in this buffer? ")
811 (when (or (and (= 1 (length children)) 819 (let ((children custom-options))
812 (memq (widget-type (car children)) 820 (when (or (and (= 1 (length children))
813 '(custom-variable custom-face))) 821 (memq (widget-type (car children))
814 (yes-or-no-p "Really erase all customizations in this buffer? ")) 822 '(custom-variable custom-face)))
815 (mapc (lambda (widget) 823 (yes-or-no-p "Really erase all customizations in this buffer? "))
816 (and (if (widget-get widget :custom-standard-value) 824 (mapc (lambda (widget)
817 (widget-apply widget :custom-standard-value) 825 (and (if (widget-get widget :custom-standard-value)
818 t) 826 (widget-apply widget :custom-standard-value)
819 (memq (widget-get widget :custom-state) 827 t)
820 '(modified set changed saved rogue)) 828 (memq (widget-get widget :custom-state)
821 (widget-apply widget :custom-reset-standard))) 829 '(modified set changed saved rogue))
822 children)))) 830 (widget-apply widget :custom-reset-standard)))
831 children)))
832 (message "Aborted")))
823 833
824;;; The Customize Commands 834;;; The Customize Commands
825 835
@@ -4405,11 +4415,12 @@ Complete content of editable text field. \\[widget-complete]
4405\\<custom-mode-map>\ 4415\\<custom-mode-map>\
4406Invoke button under the mouse pointer. \\[Custom-move-and-invoke] 4416Invoke button under the mouse pointer. \\[Custom-move-and-invoke]
4407Invoke button under point. \\[widget-button-press] 4417Invoke button under point. \\[widget-button-press]
4408Set all modifications. \\[Custom-set] 4418Set all options from current text. \\[Custom-set]
4409Make all modifications default. \\[Custom-save] 4419Make values in current text permanent. \\[Custom-save]
4410Reset all modified options. \\[Custom-reset-current] 4420Make text match actual option values. \\[Custom-reset-current]
4411Reset all modified or set options. \\[Custom-reset-saved] 4421Reset options to permanent settings. \\[Custom-reset-saved]
4412Reset all options. \\[Custom-reset-standard] 4422Erase customizations; set options
4423 and buffer text to the standard values. \\[Custom-reset-standard]
4413 4424
4414Entry to this mode calls the value of `custom-mode-hook' 4425Entry to this mode calls the value of `custom-mode-hook'
4415if that value is non-nil." 4426if that value is non-nil."