Function: custom-face-reset-saved

custom-face-reset-saved is a byte-compiled function defined in cus-edit.el.gz.

Signature

(custom-face-reset-saved WIDGET)

Documentation

Restore WIDGET to the face's default attributes.

If there is a saved face, restore it; otherwise reset to the uncustomized (themed or standard) face.

Source Code

;; Defined in /usr/src/emacs/lisp/cus-edit.el.gz
(defun custom-face-reset-saved (widget)
  "Restore WIDGET to the face's default attributes.
If there is a saved face, restore it; otherwise reset to the
uncustomized (themed or standard) face."
  (let* ((face (widget-value widget))
	 (child (car (widget-get widget :children)))
	 (saved-face (get face 'saved-face))
	 (comment (get face 'saved-face-comment))
	 (comment-widget (widget-get widget :comment-widget)))
    ;; If resetting the default face and there isn't a saved value,
    ;; push a fake user setting, so that reverting to the default
    ;; attributes works.
    (custom-push-theme 'theme-face face 'user
                       (if (or saved-face (eq face 'default)) 'set 'reset)
                       (or saved-face
                           ;; If this is t, then MODE is 'reset,
                           ;; and `custom-push-theme' ignores this argument.
                           (not (eq face 'default))
                           (get face 'custom-face-default-attrs)))
    (face-spec-set face saved-face 'saved-face)
    (when (and (not saved-face) (eq face 'default))
      ;; Remove the fake user setting.
      (custom-push-theme 'theme-face face 'user 'reset))
    (put face 'face-comment comment)
    (put face 'customized-face-comment nil)
    (widget-value-set child saved-face)
    ;; This call manages the comment visibility
    (widget-value-set comment-widget (or comment ""))
    (custom-face-state-set widget)
    (custom-redraw widget)))