# HG changeset patch # User Richard M. Stallman # Date 1199031892 0 # Node ID 26eb0118cbc694abd1a70884f3e9a22e2c9c283f # Parent 42bd8395731333e86a03b842481414510f7ce7db (face-all-attributes): New function. (face-differs-from-default-p): Compute list of attr names from face-attribute-name-alist. diff -r 42bd83957313 -r 26eb0118cbc6 lisp/faces.el --- a/lisp/faces.el Sun Dec 30 15:55:29 2007 +0000 +++ b/lisp/faces.el Sun Dec 30 16:24:52 2007 +0000 @@ -249,9 +249,7 @@ If FRAME is t, report on the defaults for face FACE (for new frames). If FRAME is omitted or nil, use the selected frame." (let ((attrs - '(:family :width :height :weight :slant :foreground - :background :underline :overline :strike-through - :box :inverse-video)) + (delq :inherit (mapcar 'car face-attribute-name-alist))) (differs nil)) (while (and attrs (not differs)) (let* ((attr (pop attrs)) @@ -353,6 +351,16 @@ (symbol-name (check-face face))) +(defun face-all-attributes (face &optional frame) + "Return an alist stating the attributes of FACE. +Each element of the result has the form (ATTR-NAME . ATTR-VALUE). +Normally the value describes the default attributes, +but if you specify FRAME, the value describes the attributes +of FACE on FRAME." + (mapcar (lambda (pair) (let ((attr (car pair))) + (cons attr (face-attribute face attr frame)))) + face-attribute-name-alist)) + (defun face-attribute (face attribute &optional frame inherit) "Return the value of FACE's ATTRIBUTE on FRAME. If the optional argument FRAME is given, report on face FACE in that frame.