mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-06 11:50:51 -08:00
(invert-face): Check for 'unspecified, not for nil,
when testing whether face colors are not specified. From David.Kastrup@t-online.de (David Kastrup).
This commit is contained in:
parent
74e79967f5
commit
e458cb4997
1 changed files with 2 additions and 2 deletions
|
|
@ -824,14 +824,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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue