From: Mark Wooding Date: Tue, 22 Mar 2016 13:39:22 +0000 (+0000) Subject: el/dot-emacs.el: More assertive zapping of faces. X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/profile/commitdiff_plain/bc149706bc4815de68df7401987e75999ae4dcd7 el/dot-emacs.el: More assertive zapping of faces. If someone fiddles with a face using `set-face-attribute' or similar, then things seem to work in the initial frame but then look wrong in frames opened later. There isn't an obvious way to reset a face to its initial bare state. So do it the not-obvious way: make a face which is guaranteed to be in its initial, unsullied state and copy that over the top of the target face. --- diff --git a/el/dot-emacs.el b/el/dot-emacs.el index d254154..a1cba54 100644 --- a/el/dot-emacs.el +++ b/el/dot-emacs.el @@ -1098,12 +1098,14 @@ (defun mdw-toggle-full-screen (&optional frame) ;;;-------------------------------------------------------------------------- ;;; General fontification. +(make-face 'mdw-virgin-face) + (defmacro mdw-define-face (name &rest body) "Define a face, and make sure it's actually set as the definition." (declare (indent 1) (debug 0)) `(progn - (make-face ',name) + (copy-face 'mdw-virgin-face ',name) (defvar ,name ',name) (put ',name 'face-defface-spec ',body) (face-spec-set ',name ',body nil)))