From dbd7a811cc300ef71728614eb379cb3545d5c29b Mon Sep 17 00:00:00 2001 From: Karl Heuer Date: Thu, 10 Sep 1998 15:43:50 +0000 Subject: [PATCH] (Custom-save, Custom-reset-current, Custom-reset-saved) (Custom-reset-standard): Fix menu inconsistency. --- lisp/cus-edit.el | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 77b946ece1a..5678b05431a 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -659,7 +659,8 @@ groups after non-groups, if nil do not order groups at all." (interactive) (let ((children custom-options)) (mapcar (lambda (child) - (when (memq (widget-get child :custom-state) '(modified set)) + (when (memq (widget-get child :custom-state) + '(modified set changed rogue)) (widget-apply child :custom-save))) children)) (custom-save-all)) @@ -686,27 +687,33 @@ when the action is chosen.") "Reset all modified group members to their current value." (interactive) (let ((children custom-options)) - (mapcar (lambda (child) - (when (eq (widget-get child :custom-state) 'modified) - (widget-apply child :custom-reset-current))) + (mapcar (lambda (widget) + (and (default-boundp (widget-value widget)) + (if (memq (widget-get widget :custom-state) + '(modified changed)) + (widget-apply widget :custom-reset-current)))) children))) (defun Custom-reset-saved (&rest ignore) "Reset all modified or set group members to their saved value." (interactive) (let ((children custom-options)) - (mapcar (lambda (child) - (when (eq (widget-get child :custom-state) 'modified) - (widget-apply child :custom-reset-saved))) + (mapcar (lambda (widget) + (and (get (widget-value widget) 'saved-value) + (if (memq (widget-get widget :custom-state) + '(modified set changed rogue)) + (widget-apply widget :custom-reset-saved)))) children))) (defun Custom-reset-standard (&rest ignore) "Reset all modified, set, or saved group members to their standard settings." (interactive) (let ((children custom-options)) - (mapcar (lambda (child) - (when (eq (widget-get child :custom-state) 'modified) - (widget-apply child :custom-reset-standard))) + (mapcar (lambda (widget) + (and (get (widget-value widget) 'standard-value) + (if (memq (widget-get widget :custom-state) + '(modified set changed saved rogue)) + (widget-apply widget :custom-reset-standard)))) children))) ;;; The Customize Commands -- 2.39.2