Commit 833547aa authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(face-all-attributes): New function.

(face-differs-from-default-p): Compute list of attr names
from face-attribute-name-alist.
parent 80f9d13b
......@@ -470,6 +470,9 @@ the specified files).
** 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.
......
......@@ -6,6 +6,11 @@
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.
......
......@@ -249,9 +249,7 @@ If the optional argument FRAME is given, report on face FACE in that frame.
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 @@ FRAME nil or not specified means do it for all frames."
(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.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment