summaryrefslogtreecommitdiff
path: root/lisp/cus-face.el
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2000-08-26 11:47:02 +0000
committerMiles Bader <miles@gnu.org>2000-08-26 11:47:02 +0000
commit6bca30057a98a81757525c4fe52aa6610314a57c (patch)
treedb30069dfa06dd38dadd82b08e24a8c6252fd58a /lisp/cus-face.el
parent19feb949cea546fbc21e9efd65ad4cd69d097c29 (diff)
downloademacs-6bca30057a98a81757525c4fe52aa6610314a57c.tar.gz
(custom-face-attributes):
Add support for :inherit attribute. Add support for relative face heights. (custom-face-attributes-get): Treat `nil' as being a default value for :inherit (as well as `unspecified').
Diffstat (limited to 'lisp/cus-face.el')
-rw-r--r--lisp/cus-face.el29
1 files changed, 25 insertions, 4 deletions
diff --git a/lisp/cus-face.el b/lisp/cus-face.el
index bfe2d39b3e2..a9290eb7294 100644
--- a/lisp/cus-face.el
+++ b/lisp/cus-face.el
@@ -109,13 +109,14 @@
(choice :tag "Height"
:help-echo "Face's font height."
(const :tag "*" nil)
- (integer :tag "Height in 1/10 pt"))
+ (integer :tag "Height in 1/10 pt")
+ (number :tag "Scale" 1.0))
(lambda (face value &optional frame)
(set-face-attribute face frame :height (or value 'unspecified)))
(lambda (face &optional frame)
(let ((height (face-attribute face :height frame)))
(if (eq height 'unspecified) nil height))))
-
+
(:weight
(choice :tag "Weight"
:help-echo "Font weight."
@@ -278,7 +279,26 @@
(set-face-attribute face frame :stipple (or value 'unspecified)))
(lambda (face &optional frame)
(let ((value (face-attribute face :stipple frame)))
- (if (eq value 'unspecified) nil value)))))
+ (if (eq value 'unspecified) nil value))))
+
+ (:inherit
+ (repeat :tag "Inherit"
+ :help-echo "List of faces to inherit attributes from."
+ (face :Tag "Face" default))
+ (lambda (face value &optional frame)
+ (message "Setting to: <%s>" value)
+ (set-face-attribute face frame :inherit
+ (if (and (consp value) (null (cdr value)))
+ (car value)
+ value)))
+ (lambda (face &optional frame)
+ (let ((value (face-attribute face :inherit frame)))
+ (cond ((or (null value) (eq value 'unspecified))
+ nil)
+ ((symbolp value)
+ (list value))
+ (t
+ value))))))
"Alist of face attributes.
@@ -307,7 +327,8 @@ If FRAME is nil, use the global defaults for FACE."
(let* ((attribute (car (car attrs)))
(value (face-attribute face attribute frame)))
(setq attrs (cdr attrs))
- (unless (eq value 'unspecified)
+ (unless (or (eq value 'unspecified)
+ (and (null value) (memq attribute '(:inherit))))
(setq plist (cons attribute (cons value plist))))))
plist))