aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/faces.el
diff options
context:
space:
mode:
authorRichard M. Stallman1995-01-10 17:43:59 +0000
committerRichard M. Stallman1995-01-10 17:43:59 +0000
commit93d6fcef188ddd8a2293dedd8a16bbad67cc714a (patch)
tree6b6f5cfef63a11c274098dff9407792c6aeaf51f /lisp/faces.el
parentcdc1f6a71f63ed426af4384f0de8de8b5228d6ee (diff)
downloademacs-93d6fcef188ddd8a2293dedd8a16bbad67cc714a.tar.gz
emacs-93d6fcef188ddd8a2293dedd8a16bbad67cc714a.zip
(face-nontrivial-p): New function.
Diffstat (limited to 'lisp/faces.el')
-rw-r--r--lisp/faces.el18
1 files changed, 17 insertions, 1 deletions
diff --git a/lisp/faces.el b/lisp/faces.el
index 7877a26db52..8c928962e73 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -425,7 +425,11 @@ to NEW-FACE on frame NEW-FRAME."
425A face is considered to be ``the same'' as the default face if it is 425A face is considered to be ``the same'' as the default face if it is
426actually specified in the same way (equivalent fonts, etc) or if it is 426actually specified in the same way (equivalent fonts, etc) or if it is
427fully unspecified, and thus inherits the attributes of any face it 427fully unspecified, and thus inherits the attributes of any face it
428is displayed on top of." 428is displayed on top of.
429
430The optional argument FRAME specifies which frame to test;
431if FRAME is t, test the default for new frames.
432If FRAME is nil or omitted, test the selected frame."
429 (let ((default (internal-get-face 'default frame))) 433 (let ((default (internal-get-face 'default frame)))
430 (setq face (internal-get-face face frame)) 434 (setq face (internal-get-face face frame))
431 (not (and (or (equal (face-foreground default frame) 435 (not (and (or (equal (face-foreground default frame)
@@ -443,6 +447,18 @@ is displayed on top of."
443 (face-underline-p face frame)) 447 (face-underline-p face frame))
444 )))) 448 ))))
445 449
450(defun face-nontrivial-p (face &optional frame)
451 "True if face FACE has some non-nil attribute.
452The optional argument FRAME specifies which frame to test;
453if FRAME is t, test the default for new frames.
454If FRAME is nil or omitted, test the selected frame."
455 (setq face (internal-get-face face frame))
456 (or (face-foreground face frame)
457 (face-background face frame)
458 (face-font face frame)
459 (face-stipple face frame)
460 (face-underline-p face frame)))
461
446 462
447(defun invert-face (face &optional frame) 463(defun invert-face (face &optional frame)
448 "Swap the foreground and background colors of face FACE. 464 "Swap the foreground and background colors of face FACE.