]> git.eshelyaron.com Git - emacs.git/commitdiff
(invert-face): Handle inverting the default face better.
authorRichard M. Stallman <rms@gnu.org>
Tue, 7 Jan 1997 09:05:31 +0000 (09:05 +0000)
committerRichard M. Stallman <rms@gnu.org>
Tue, 7 Jan 1997 09:05:31 +0000 (09:05 +0000)
lisp/faces.el

index 797581318d2290fc208d700a57e68405316275e5..6d1e195b1401d2f8a1c9b2d8e8419fa726858516 100644 (file)
@@ -598,12 +598,14 @@ set its foreground and background to the default background and foreground."
        (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)