** The new function `read-color' reads a color name using the minibuffer.
+** The new function `face-all-attributes' returns an alist
+describing all the basic attributes of a given face.
+
** `interprogram-paste-function' can now return one string or a list
of strings. In the latter case, Emacs puts the second and following
strings on the kill ring.
2007-12-30 Richard Stallman <rms@gnu.org>
+ * faces.el (face-all-attributes): New function.
+
+ * faces.el (face-differs-from-default-p): Compute list of attr names
+ from face-attribute-name-alist.
+
* cus-edit.el (custom-face-set): Call `face-spec-set' with FOR-DEFFACE.
(custom-face-save): Likewise.
(custom-face-reset-saved, custom-face-reset-standard): Likewise.
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))
(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.