617 |
;; `defface' is macroexpanded to `custom-declare-face'. |
;; `defface' is macroexpanded to `custom-declare-face'. |
618 |
((eq (car form) 'custom-declare-face) |
((eq (car form) 'custom-declare-face) |
619 |
;; Reset the face. |
;; Reset the face. |
|
(put (eval (nth 1 form)) 'face-defface-spec nil) |
|
620 |
(setq face-new-frame-defaults |
(setq face-new-frame-defaults |
621 |
(assq-delete-all (eval (nth 1 form)) face-new-frame-defaults)) |
(assq-delete-all (eval (nth 1 form)) face-new-frame-defaults)) |
622 |
form) |
(put (eval (nth 1 form)) 'face-defface-spec nil) |
623 |
|
;; Setting `customized-face' to the new spec after calling |
624 |
|
;; the form, but preserving the old saved spec in `saved-face', |
625 |
|
;; imitates the situation when the new face spec is set |
626 |
|
;; temporarily for the current session in the customize |
627 |
|
;; buffer, thus allowing `face-user-default-spec' to use the |
628 |
|
;; new customized spec instead of the saved spec. |
629 |
|
;; Resetting `saved-face' temporarily to nil is needed to let |
630 |
|
;; `defface' change the spec, regardless of a saved spec. |
631 |
|
(prog1 `(prog1 ,form |
632 |
|
(put ',(eval (nth 1 form)) 'saved-face |
633 |
|
',(get (eval (nth 1 form)) 'saved-face)) |
634 |
|
(put ',(eval (nth 1 form)) 'customized-face |
635 |
|
',(eval (nth 2 form)))) |
636 |
|
(put (eval (nth 1 form)) 'saved-face nil))) |
637 |
((eq (car form) 'progn) |
((eq (car form) 'progn) |
638 |
(cons 'progn (mapcar 'eval-defun-1 (cdr form)))) |
(cons 'progn (mapcar 'eval-defun-1 (cdr form)))) |
639 |
(t form))) |
(t form))) |