mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-10 09:43:26 -08:00
(face-nontrivial-p): New function.
This commit is contained in:
parent
cdc1f6a71f
commit
93d6fcef18
1 changed files with 17 additions and 1 deletions
|
|
@ -425,7 +425,11 @@ to NEW-FACE on frame NEW-FRAME."
|
|||
A face is considered to be ``the same'' as the default face if it is
|
||||
actually specified in the same way (equivalent fonts, etc) or if it is
|
||||
fully unspecified, and thus inherits the attributes of any face it
|
||||
is displayed on top of."
|
||||
is displayed on top of.
|
||||
|
||||
The optional argument FRAME specifies which frame to test;
|
||||
if FRAME is t, test the default for new frames.
|
||||
If FRAME is nil or omitted, test the selected frame."
|
||||
(let ((default (internal-get-face 'default frame)))
|
||||
(setq face (internal-get-face face frame))
|
||||
(not (and (or (equal (face-foreground default frame)
|
||||
|
|
@ -443,6 +447,18 @@ is displayed on top of."
|
|||
(face-underline-p face frame))
|
||||
))))
|
||||
|
||||
(defun face-nontrivial-p (face &optional frame)
|
||||
"True if face FACE has some non-nil attribute.
|
||||
The optional argument FRAME specifies which frame to test;
|
||||
if FRAME is t, test the default for new frames.
|
||||
If FRAME is nil or omitted, test the selected frame."
|
||||
(setq face (internal-get-face face frame))
|
||||
(or (face-foreground face frame)
|
||||
(face-background face frame)
|
||||
(face-font face frame)
|
||||
(face-stipple face frame)
|
||||
(face-underline-p face frame)))
|
||||
|
||||
|
||||
(defun invert-face (face &optional frame)
|
||||
"Swap the foreground and background colors of face FACE.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue