# HG changeset patch # User Eli Zaretskii # Date 1004378810 0 # Node ID ce83eda9592d5ab03cba6a84f9e48a343df57c92 # Parent bf8760ceda7c5c52d51e9761cb6d93a08fc1d474 (invert-face): Check for 'unspecified, not for nil, when testing whether face colors are not specified. From David.Kastrup@t-online.de (David Kastrup). diff -r bf8760ceda7c -r ce83eda9592d lisp/faces.el --- a/lisp/faces.el Mon Oct 29 17:53:18 2001 +0000 +++ b/lisp/faces.el Mon Oct 29 18:06:50 2001 +0000 @@ -824,14 +824,14 @@ (defun invert-face (face &optional frame) "Swap the foreground and background colors of FACE. -FRAME nil or not specified means change face on all frames. +If FRAME is omitted or nil, it means change face on all frames. If FACE specifies neither foreground nor background color, set its foreground and background to the background and foreground of the default face. Value is FACE." (interactive (list (read-face-name "Invert face "))) (let ((fg (face-attribute face :foreground frame)) (bg (face-attribute face :background frame))) - (if (or fg bg) + (if (not (and (eq fg 'unspecified) (eq bg 'unspecified))) (set-face-attribute face frame :foreground bg :background fg) (set-face-attribute face frame :foreground