From: Richard M. Stallman Date: Tue, 7 Jan 1997 09:05:31 +0000 (+0000) Subject: (invert-face): Handle inverting the default face better. X-Git-Tag: emacs-20.1~3103 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c5f0b2d42dd572e21d44480007e621097ed14b8c;p=emacs.git (invert-face): Handle inverting the default face better. --- 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)