diff options
author | Luc Teirlinck <[email protected]> | 2005-11-22 23:28:28 +0000 |
---|---|---|
committer | Luc Teirlinck <[email protected]> | 2005-11-22 23:28:28 +0000 |
commit | eac1f7d830bf3718849615973b30fc4ba1829fae (patch) | |
tree | f71b7bf5533caec45730e18b676774cf3256f781 /lisp/cus-edit.el | |
parent | 2036ac732c9463a12fa9b224f4d0316f83021bc3 (diff) |
(Custom-reset-standard): Make it handle Custom group
buffers correctly. (It used to throw an error in such buffers.)
Make it ask for confirmation in group buffers and other Custom
buffers containing more than one customization item.
Diffstat (limited to 'lisp/cus-edit.el')
-rw-r--r-- | lisp/cus-edit.el | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 59a8b341ca..b84568b706 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -800,13 +800,18 @@ This operation eliminates any saved settings for the group members, making them as if they had never been customized at all." (interactive) (let ((children custom-options)) - (mapc (lambda (widget) - (and (widget-get widget :custom-standard-value) - (widget-apply widget :custom-standard-value) - (if (memq (widget-get widget :custom-state) - '(modified set changed saved rogue)) - (widget-apply widget :custom-reset-standard)))) - children))) + (when (or (and (= 1 (length children)) + (memq (widget-type (car children)) + '(custom-variable custom-face))) + (yes-or-no-p "Really erase all customizations in this buffer? ")) + (mapc (lambda (widget) + (and (if (widget-get widget :custom-standard-value) + (widget-apply widget :custom-standard-value) + t) + (memq (widget-get widget :custom-state) + '(modified set changed saved rogue)) + (widget-apply widget :custom-reset-standard))) + children)))) ;;; The Customize Commands |