aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/cus-edit.el84
1 files changed, 43 insertions, 41 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 129886b67cd..c698ea220d1 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -636,19 +636,19 @@ groups after non-groups, if nil do not order groups at all."
636 "Set changes in all modified options." 636 "Set changes in all modified options."
637 (interactive) 637 (interactive)
638 (let ((children custom-options)) 638 (let ((children custom-options))
639 (mapcar (lambda (child) 639 (mapc (lambda (child)
640 (when (eq (widget-get child :custom-state) 'modified) 640 (when (eq (widget-get child :custom-state) 'modified)
641 (widget-apply child :custom-set))) 641 (widget-apply child :custom-set)))
642 children))) 642 children)))
643 643
644(defun Custom-save () 644(defun Custom-save ()
645 "Set all modified group members and save them." 645 "Set all modified group members and save them."
646 (interactive) 646 (interactive)
647 (let ((children custom-options)) 647 (let ((children custom-options))
648 (mapcar (lambda (child) 648 (mapc (lambda (child)
649 (when (memq (widget-get child :custom-state) 649 (when (memq (widget-get child :custom-state)
650 '(modified set changed rogue)) 650 '(modified set changed rogue))
651 (widget-apply child :custom-save))) 651 (widget-apply child :custom-save)))
652 children)) 652 children))
653 (custom-save-all)) 653 (custom-save-all))
654 654
@@ -674,22 +674,22 @@ when the action is chosen.")
674 "Reset all modified group members to their current value." 674 "Reset all modified group members to their current value."
675 (interactive) 675 (interactive)
676 (let ((children custom-options)) 676 (let ((children custom-options))
677 (mapcar (lambda (widget) 677 (mapc (lambda (widget)
678 (and (default-boundp (widget-value widget)) 678 (and (default-boundp (widget-value widget))
679 (if (memq (widget-get widget :custom-state) 679 (if (memq (widget-get widget :custom-state)
680 '(modified changed)) 680 '(modified changed))
681 (widget-apply widget :custom-reset-current)))) 681 (widget-apply widget :custom-reset-current))))
682 children))) 682 children)))
683 683
684(defun Custom-reset-saved (&rest ignore) 684(defun Custom-reset-saved (&rest ignore)
685 "Reset all modified or set group members to their saved value." 685 "Reset all modified or set group members to their saved value."
686 (interactive) 686 (interactive)
687 (let ((children custom-options)) 687 (let ((children custom-options))
688 (mapcar (lambda (widget) 688 (mapc (lambda (widget)
689 (and (get (widget-value widget) 'saved-value) 689 (and (get (widget-value widget) 'saved-value)
690 (if (memq (widget-get widget :custom-state) 690 (if (memq (widget-get widget :custom-state)
691 '(modified set changed rogue)) 691 '(modified set changed rogue))
692 (widget-apply widget :custom-reset-saved)))) 692 (widget-apply widget :custom-reset-saved))))
693 children))) 693 children)))
694 694
695(defun Custom-reset-standard (&rest ignore) 695(defun Custom-reset-standard (&rest ignore)
@@ -699,11 +699,11 @@ This operation eliminates any saved settings for the group members,
699making them as if they had never been customized at all." 699making them as if they had never been customized at all."
700 (interactive) 700 (interactive)
701 (let ((children custom-options)) 701 (let ((children custom-options))
702 (mapcar (lambda (widget) 702 (mapc (lambda (widget)
703 (and (get (widget-value widget) 'standard-value) 703 (and (get (widget-value widget) 'standard-value)
704 (if (memq (widget-get widget :custom-state) 704 (if (memq (widget-get widget :custom-state)
705 '(modified set changed saved rogue)) 705 '(modified set changed saved rogue))
706 (widget-apply widget :custom-reset-standard)))) 706 (widget-apply widget :custom-reset-standard))))
707 children))) 707 children)))
708 708
709;;; The Customize Commands 709;;; The Customize Commands
@@ -1291,6 +1291,7 @@ Un-customize all values in this buffer. They get their standard settings."
1291 :action #'Custom-buffer-done) 1291 :action #'Custom-buffer-done)
1292 (widget-insert "\n\n") 1292 (widget-insert "\n\n")
1293 (message "Creating customization items...") 1293 (message "Creating customization items...")
1294 (buffer-disable-undo)
1294 (setq custom-options 1295 (setq custom-options
1295 (if (= (length options) 1) 1296 (if (= (length options) 1)
1296 (mapcar (lambda (entry) 1297 (mapcar (lambda (entry)
@@ -1320,9 +1321,10 @@ Un-customize all values in this buffer. They get their standard settings."
1320 (widget-insert "\n")) 1321 (widget-insert "\n"))
1321 (message "Creating customization items ...%2d%%done" 100) 1322 (message "Creating customization items ...%2d%%done" 100)
1322 (unless (eq custom-buffer-style 'tree) 1323 (unless (eq custom-buffer-style 'tree)
1323 (mapcar 'custom-magic-reset custom-options)) 1324 (mapc 'custom-magic-reset custom-options))
1324 (message "Creating customization setup...") 1325 (message "Creating customization setup...")
1325 (widget-setup) 1326 (widget-setup)
1327 (buffer-enable-undo)
1326 (goto-char (point-min)) 1328 (goto-char (point-min))
1327 (message "Creating customization buffer...done")) 1329 (message "Creating customization buffer...done"))
1328 1330
@@ -2547,7 +2549,7 @@ Match frames with dark backgrounds.")
2547 "Customize face." 2549 "Customize face."
2548 :sample-face 'custom-face-tag-face 2550 :sample-face 'custom-face-tag-face
2549 :help-echo "Set or reset this face." 2551 :help-echo "Set or reset this face."
2550 :documentation-property (lambda (face) (face-doc-string face)) 2552 :documentation-property #'face-doc-string)
2551 :value-create 'custom-face-value-create 2553 :value-create 'custom-face-value-create
2552 :action 'custom-face-action 2554 :action 'custom-face-action
2553 :custom-category 'face 2555 :custom-category 'face
@@ -3273,7 +3275,7 @@ Creating group members... %2d%%"
3273 (widget-insert "\n")))) 3275 (widget-insert "\n"))))
3274 members))) 3276 members)))
3275 (message "Creating group magic...") 3277 (message "Creating group magic...")
3276 (mapcar 'custom-magic-reset children) 3278 (mapc 'custom-magic-reset children)
3277 (message "Creating group state...") 3279 (message "Creating group state...")
3278 (widget-put widget :children children) 3280 (widget-put widget :children children)
3279 (custom-group-state-update widget) 3281 (custom-group-state-update widget)
@@ -3326,42 +3328,42 @@ Optional EVENT is the location for the menu."
3326(defun custom-group-set (widget) 3328(defun custom-group-set (widget)
3327 "Set changes in all modified group members." 3329 "Set changes in all modified group members."
3328 (let ((children (widget-get widget :children))) 3330 (let ((children (widget-get widget :children)))
3329 (mapcar (lambda (child) 3331 (mapc (lambda (child)
3330 (when (eq (widget-get child :custom-state) 'modified) 3332 (when (eq (widget-get child :custom-state) 'modified)
3331 (widget-apply child :custom-set))) 3333 (widget-apply child :custom-set)))
3332 children ))) 3334 children )))
3333 3335
3334(defun custom-group-save (widget) 3336(defun custom-group-save (widget)
3335 "Save all modified group members." 3337 "Save all modified group members."
3336 (let ((children (widget-get widget :children))) 3338 (let ((children (widget-get widget :children)))
3337 (mapcar (lambda (child) 3339 (mapc (lambda (child)
3338 (when (memq (widget-get child :custom-state) '(modified set)) 3340 (when (memq (widget-get child :custom-state) '(modified set))
3339 (widget-apply child :custom-save))) 3341 (widget-apply child :custom-save)))
3340 children ))) 3342 children )))
3341 3343
3342(defun custom-group-reset-current (widget) 3344(defun custom-group-reset-current (widget)
3343 "Reset all modified group members." 3345 "Reset all modified group members."
3344 (let ((children (widget-get widget :children))) 3346 (let ((children (widget-get widget :children)))
3345 (mapcar (lambda (child) 3347 (mapc (lambda (child)
3346 (when (eq (widget-get child :custom-state) 'modified) 3348 (when (eq (widget-get child :custom-state) 'modified)
3347 (widget-apply child :custom-reset-current))) 3349 (widget-apply child :custom-reset-current)))
3348 children ))) 3350 children )))
3349 3351
3350(defun custom-group-reset-saved (widget) 3352(defun custom-group-reset-saved (widget)
3351 "Reset all modified or set group members." 3353 "Reset all modified or set group members."
3352 (let ((children (widget-get widget :children))) 3354 (let ((children (widget-get widget :children)))
3353 (mapcar (lambda (child) 3355 (mapc (lambda (child)
3354 (when (memq (widget-get child :custom-state) '(modified set)) 3356 (when (memq (widget-get child :custom-state) '(modified set))
3355 (widget-apply child :custom-reset-saved))) 3357 (widget-apply child :custom-reset-saved)))
3356 children ))) 3358 children )))
3357 3359
3358(defun custom-group-reset-standard (widget) 3360(defun custom-group-reset-standard (widget)
3359 "Reset all modified, set, or saved group members." 3361 "Reset all modified, set, or saved group members."
3360 (let ((children (widget-get widget :children))) 3362 (let ((children (widget-get widget :children)))
3361 (mapcar (lambda (child) 3363 (mapc (lambda (child)
3362 (when (memq (widget-get child :custom-state) 3364 (when (memq (widget-get child :custom-state)
3363 '(modified set saved)) 3365 '(modified set saved))
3364 (widget-apply child :custom-reset-standard))) 3366 (widget-apply child :custom-reset-standard)))
3365 children ))) 3367 children )))
3366 3368
3367(defun custom-group-state-update (widget) 3369(defun custom-group-state-update (widget)