chiark / gitweb /
el/dot-emacs.el: More assertive zapping of faces.
authorMark Wooding <mwooding@good.com>
Tue, 22 Mar 2016 13:39:22 +0000 (13:39 +0000)
committerMark Wooding <mwooding@good.com>
Tue, 22 Mar 2016 13:47:37 +0000 (13:47 +0000)
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.

el/dot-emacs.el

index d25415445de53939b4b712ed881a143dd4b5f574..a1cba54a035846c58334e45e870dcef0e0e1529a 100644 (file)
@@ -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)))