diff options
| author | Eli Zaretskii | 2001-10-29 18:06:50 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2001-10-29 18:06:50 +0000 |
| commit | e458cb49974feb8ff06615165a002e08f3b96c4e (patch) | |
| tree | 1eca7ac16aa57c1f9356e733c21cbd75f59a53cf | |
| parent | 74e79967f5c5dfec288a3683c134d59485cbe357 (diff) | |
| download | emacs-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.el | 4 |
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. |
| 827 | FRAME nil or not specified means change face on all frames. | 827 | If FRAME is omitted or nil, it means change face on all frames. |
| 828 | If FACE specifies neither foreground nor background color, | 828 | If FACE specifies neither foreground nor background color, |
| 829 | set its foreground and background to the background and foreground | 829 | set its foreground and background to the background and foreground |
| 830 | of the default face. Value is FACE." | 830 | of 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 |