diff options
| author | Richard M. Stallman | 1995-01-10 17:43:59 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-01-10 17:43:59 +0000 |
| commit | 93d6fcef188ddd8a2293dedd8a16bbad67cc714a (patch) | |
| tree | 6b6f5cfef63a11c274098dff9407792c6aeaf51f | |
| parent | cdc1f6a71f63ed426af4384f0de8de8b5228d6ee (diff) | |
| download | emacs-93d6fcef188ddd8a2293dedd8a16bbad67cc714a.tar.gz emacs-93d6fcef188ddd8a2293dedd8a16bbad67cc714a.zip | |
(face-nontrivial-p): New function.
| -rw-r--r-- | lisp/faces.el | 18 |
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." | |||
| 425 | A face is considered to be ``the same'' as the default face if it is | 425 | A face is considered to be ``the same'' as the default face if it is |
| 426 | actually specified in the same way (equivalent fonts, etc) or if it is | 426 | actually specified in the same way (equivalent fonts, etc) or if it is |
| 427 | fully unspecified, and thus inherits the attributes of any face it | 427 | fully unspecified, and thus inherits the attributes of any face it |
| 428 | is displayed on top of." | 428 | is displayed on top of. |
| 429 | |||
| 430 | The optional argument FRAME specifies which frame to test; | ||
| 431 | if FRAME is t, test the default for new frames. | ||
| 432 | If 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. | ||
| 452 | The optional argument FRAME specifies which frame to test; | ||
| 453 | if FRAME is t, test the default for new frames. | ||
| 454 | If 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. |