diff options
author | Gerd Moellmann <gerd@gnu.org> | 1999-09-25 19:57:48 +0000 |
---|---|---|
committer | Gerd Moellmann <gerd@gnu.org> | 1999-09-25 19:57:48 +0000 |
commit | 6904df7a9cd09b849d52b94014e98e5242fdbe4f (patch) | |
tree | 6791bf1ad808e22642d0cbaf67e7614f89de0be7 | |
parent | d279baa8e7367fdf23af2150b5ff27a70fcb5a8e (diff) | |
download | emacs-6904df7a9cd09b849d52b94014e98e5242fdbe4f.tar.gz |
(face-differs-from-default-p): Compare face
attributes individually.
-rw-r--r-- | lisp/faces.el | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lisp/faces.el b/lisp/faces.el index c3acc061a6d..3edd33ae546 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -219,8 +219,19 @@ A face is considered to be ``the same'' as the default face if it is actually specified in the same way (equal attributes) or if it is fully-unspecified, and thus inherits the attributes of any face it is displayed on top of." - (or (internal-lisp-face-empty-p face frame) - (not (internal-lisp-face-equal-p face 'default frame)))) + (cond ((eq frame t) (setq frame nil)) + ((null frame) (setq frame (selected-frame)))) + (let* ((v1 (internal-lisp-face-p face frame)) + (n (if v1 (length v1) 0)) + (v2 (internal-lisp-face-p 'default frame)) + (i 1)) + (unless v1 + (error "Not a face: %S" face)) + (while (and (< i n) + (or (eq 'unspecified (aref v1 i)) + (equal (aref v1 i) (aref v2 i)))) + (setq i (1+ i))) + (< i n))) (defun face-nontrivial-p (face &optional frame) |