changeset 16841:5c964321c440

(invert-face): Handle inverting the default face better.
author Richard M. Stallman <rms@gnu.org>
date Tue, 07 Jan 1997 09:05:31 +0000
parents 299b0e0f0a93
children 72276b334084
files lisp/faces.el
diffstat 1 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/faces.el	Tue Jan 07 09:03:23 1997 +0000
+++ b/lisp/faces.el	Tue Jan 07 09:05:31 1997 +0000
@@ -598,12 +598,14 @@
 	(progn
 	  (set-face-foreground face bg frame)
 	  (set-face-background face fg frame))
-      (set-face-foreground face (or (face-background 'default frame)
-				    (cdr (assq 'background-color (frame-parameters frame))))
-			   frame)
-      (set-face-background face (or (face-foreground 'default frame)
-				    (cdr (assq 'foreground-color (frame-parameters frame))))
-			   frame)))
+      (let* ((frame-bg (cdr (assq 'background-color (frame-parameters frame))))
+	     (default-bg (or (face-background 'default frame)
+			     frame-bg))
+	     (frame-fg (cdr (assq 'foreground-color (frame-parameters frame))))
+	     (default-fg (or (face-foreground 'default frame)
+			     frame-fg)))
+	(set-face-foreground face default-bg frame)
+	(set-face-background face default-fg frame))))
   face)