1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-23 07:19:15 +00:00

(face-all-attributes): New function.

(face-differs-from-default-p): Compute list of attr names
from face-attribute-name-alist.
This commit is contained in:
Richard M. Stallman 2007-12-30 16:26:54 +00:00
parent 80f9d13bff
commit 833547aacb
3 changed files with 19 additions and 3 deletions

View File

@ -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.

View File

@ -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.

View File

@ -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.