summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1997-01-07 09:05:31 +0000
committerRichard M. Stallman <rms@gnu.org>1997-01-07 09:05:31 +0000
commit00324439f83c6e8bff8a6a7d041e41122b60e99f (patch)
tree62f21acaec543dc494bcbbd22bd9651b26c570c2
parent2e6b42a046da8fa601674a4dbd200c94d924fe24 (diff)
downloademacs-00324439f83c6e8bff8a6a7d041e41122b60e99f.tar.gz
(invert-face): Handle inverting the default face better.
-rw-r--r--lisp/faces.el14
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/faces.el b/lisp/faces.el
index 797581318d2..6d1e195b140 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -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)