Commit dbd7a811 authored by Karl Heuer's avatar Karl Heuer
Browse files

(Custom-save, Custom-reset-current, Custom-reset-saved)

(Custom-reset-standard): Fix menu inconsistency.
parent 19a2870f
...@@ -659,7 +659,8 @@ groups after non-groups, if nil do not order groups at all." ...@@ -659,7 +659,8 @@ groups after non-groups, if nil do not order groups at all."
(interactive) (interactive)
(let ((children custom-options)) (let ((children custom-options))
(mapcar (lambda (child) (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))) (widget-apply child :custom-save)))
children)) children))
(custom-save-all)) (custom-save-all))
...@@ -686,27 +687,33 @@ when the action is chosen.") ...@@ -686,27 +687,33 @@ when the action is chosen.")
"Reset all modified group members to their current value." "Reset all modified group members to their current value."
(interactive) (interactive)
(let ((children custom-options)) (let ((children custom-options))
(mapcar (lambda (child) (mapcar (lambda (widget)
(when (eq (widget-get child :custom-state) 'modified) (and (default-boundp (widget-value widget))
(widget-apply child :custom-reset-current))) (if (memq (widget-get widget :custom-state)
'(modified changed))
(widget-apply widget :custom-reset-current))))
children))) children)))
(defun Custom-reset-saved (&rest ignore) (defun Custom-reset-saved (&rest ignore)
"Reset all modified or set group members to their saved value." "Reset all modified or set group members to their saved value."
(interactive) (interactive)
(let ((children custom-options)) (let ((children custom-options))
(mapcar (lambda (child) (mapcar (lambda (widget)
(when (eq (widget-get child :custom-state) 'modified) (and (get (widget-value widget) 'saved-value)
(widget-apply child :custom-reset-saved))) (if (memq (widget-get widget :custom-state)
'(modified set changed rogue))
(widget-apply widget :custom-reset-saved))))
children))) children)))
(defun Custom-reset-standard (&rest ignore) (defun Custom-reset-standard (&rest ignore)
"Reset all modified, set, or saved group members to their standard settings." "Reset all modified, set, or saved group members to their standard settings."
(interactive) (interactive)
(let ((children custom-options)) (let ((children custom-options))
(mapcar (lambda (child) (mapcar (lambda (widget)
(when (eq (widget-get child :custom-state) 'modified) (and (get (widget-value widget) 'standard-value)
(widget-apply child :custom-reset-standard))) (if (memq (widget-get widget :custom-state)
'(modified set changed saved rogue))
(widget-apply widget :custom-reset-standard))))
children))) children)))
;;; The Customize Commands ;;; The Customize Commands
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment