Function: Custom-save

Custom-save is an interactive and byte-compiled function defined in cus-edit.el.gz.

Signature

(Custom-save &rest IGNORE)

Documentation

Set all edited settings, then save all settings that have been set.

If a setting was edited and set before, this saves it. If a setting was merely edited before, this sets it then saves it.

View in manual

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/cus-edit.el.gz
(defun Custom-save (&rest _ignore)
  "Set all edited settings, then save all settings that have been set.
If a setting was edited and set before, this saves it.  If a
setting was merely edited before, this sets it then saves it."
  (interactive)
  (let (edited-widgets)
    (when (custom-command-apply
	   (lambda (child)
	     (when (memq (widget-get child :custom-state)
                         '(modified set changed rogue))
               (push child edited-widgets)
	       (widget-apply child :custom-mark-to-save)))
	   "Save all settings in this buffer? " t)
      ;; Save changes to buffer.
      (custom-save-all)
      ;; Redraw and recalculate the state when necessary.
      (dolist (widget edited-widgets)
        (widget-apply widget :custom-state-set-and-redraw)))))