aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman2007-12-30 16:26:54 +0000
committerRichard M. Stallman2007-12-30 16:26:54 +0000
commit833547aacbfbf3269619341d8bec9ec6d2282230 (patch)
treed37f3cfb0772aa86b84cf4b3904b61c1093e3eff /lisp
parent80f9d13bfff89c026469d172128a3ea58ce31627 (diff)
downloademacs-833547aacbfbf3269619341d8bec9ec6d2282230.tar.gz
emacs-833547aacbfbf3269619341d8bec9ec6d2282230.zip
(face-all-attributes): New function.
(face-differs-from-default-p): Compute list of attr names from face-attribute-name-alist.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/faces.el14
2 files changed, 16 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5126ebe2d10..35163804e3a 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -6,6 +6,11 @@
6 6
72007-12-30 Richard Stallman <rms@gnu.org> 72007-12-30 Richard Stallman <rms@gnu.org>
8 8
9 * faces.el (face-all-attributes): New function.
10
11 * faces.el (face-differs-from-default-p): Compute list of attr names
12 from face-attribute-name-alist.
13
9 * cus-edit.el (custom-face-set): Call `face-spec-set' with FOR-DEFFACE. 14 * cus-edit.el (custom-face-set): Call `face-spec-set' with FOR-DEFFACE.
10 (custom-face-save): Likewise. 15 (custom-face-save): Likewise.
11 (custom-face-reset-saved, custom-face-reset-standard): Likewise. 16 (custom-face-reset-saved, custom-face-reset-standard): Likewise.
diff --git a/lisp/faces.el b/lisp/faces.el
index 74d1a4e4f25..5f8f6d58522 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -249,9 +249,7 @@ If the optional argument FRAME is given, report on face FACE in that frame.
249If FRAME is t, report on the defaults for face FACE (for new frames). 249If FRAME is t, report on the defaults for face FACE (for new frames).
250If FRAME is omitted or nil, use the selected frame." 250If FRAME is omitted or nil, use the selected frame."
251 (let ((attrs 251 (let ((attrs
252 '(:family :width :height :weight :slant :foreground 252 (delq :inherit (mapcar 'car face-attribute-name-alist)))
253 :background :underline :overline :strike-through
254 :box :inverse-video))
255 (differs nil)) 253 (differs nil))
256 (while (and attrs (not differs)) 254 (while (and attrs (not differs))
257 (let* ((attr (pop attrs)) 255 (let* ((attr (pop attrs))
@@ -353,6 +351,16 @@ FRAME nil or not specified means do it for all frames."
353 (symbol-name (check-face face))) 351 (symbol-name (check-face face)))
354 352
355 353
354(defun face-all-attributes (face &optional frame)
355 "Return an alist stating the attributes of FACE.
356Each element of the result has the form (ATTR-NAME . ATTR-VALUE).
357Normally the value describes the default attributes,
358but if you specify FRAME, the value describes the attributes
359of FACE on FRAME."
360 (mapcar (lambda (pair) (let ((attr (car pair)))
361 (cons attr (face-attribute face attr frame))))
362 face-attribute-name-alist))
363
356(defun face-attribute (face attribute &optional frame inherit) 364(defun face-attribute (face attribute &optional frame inherit)
357 "Return the value of FACE's ATTRIBUTE on FRAME. 365 "Return the value of FACE's ATTRIBUTE on FRAME.
358If the optional argument FRAME is given, report on face FACE in that frame. 366If the optional argument FRAME is given, report on face FACE in that frame.