From bc05b186569a4226abdcb705fa363230be9453d5 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 29 Oct 2001 18:32:37 +0000 Subject: [PATCH] (invert-face): Check for 'unspecified, not for nil, when testing whether face colors are not specified. From David.Kastrup@t-online.de (David Kastrup). --- lisp/faces.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/faces.el b/lisp/faces.el index 822a7bbf686..02a458bcb99 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -744,14 +744,14 @@ Use `set-face-attribute' or `modify-face' for finer control." (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 -- 2.39.2