aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2001-10-29 18:06:50 +0000
committerEli Zaretskii2001-10-29 18:06:50 +0000
commite458cb49974feb8ff06615165a002e08f3b96c4e (patch)
tree1eca7ac16aa57c1f9356e733c21cbd75f59a53cf
parent74e79967f5c5dfec288a3683c134d59485cbe357 (diff)
downloademacs-e458cb49974feb8ff06615165a002e08f3b96c4e.tar.gz
emacs-e458cb49974feb8ff06615165a002e08f3b96c4e.zip
(invert-face): Check for 'unspecified, not for nil,
when testing whether face colors are not specified. From David.Kastrup@t-online.de (David Kastrup).
-rw-r--r--lisp/faces.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/faces.el b/lisp/faces.el
index bb9d4471da3..ac9b6645ae0 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -824,14 +824,14 @@ Use `set-face-attribute' or `modify-face' for finer control."
824 824
825(defun invert-face (face &optional frame) 825(defun invert-face (face &optional frame)
826 "Swap the foreground and background colors of FACE. 826 "Swap the foreground and background colors of FACE.
827FRAME nil or not specified means change face on all frames. 827If FRAME is omitted or nil, it means change face on all frames.
828If FACE specifies neither foreground nor background color, 828If FACE specifies neither foreground nor background color,
829set its foreground and background to the background and foreground 829set its foreground and background to the background and foreground
830of the default face. Value is FACE." 830of the default face. Value is FACE."
831 (interactive (list (read-face-name "Invert face "))) 831 (interactive (list (read-face-name "Invert face ")))
832 (let ((fg (face-attribute face :foreground frame)) 832 (let ((fg (face-attribute face :foreground frame))
833 (bg (face-attribute face :background frame))) 833 (bg (face-attribute face :background frame)))
834 (if (or fg bg) 834 (if (not (and (eq fg 'unspecified) (eq bg 'unspecified)))
835 (set-face-attribute face frame :foreground bg :background fg) 835 (set-face-attribute face frame :foreground bg :background fg)
836 (set-face-attribute face frame 836 (set-face-attribute face frame
837 :foreground 837 :foreground