(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').
This commit is contained in:
parent
19feb949ce
commit
6bca30057a
1 changed files with 25 additions and 4 deletions
|
@ -109,7 +109,8 @@
|
||||||
(choice :tag "Height"
|
(choice :tag "Height"
|
||||||
:help-echo "Face's font height."
|
:help-echo "Face's font height."
|
||||||
(const :tag "*" nil)
|
(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)
|
(lambda (face value &optional frame)
|
||||||
(set-face-attribute face frame :height (or value 'unspecified)))
|
(set-face-attribute face frame :height (or value 'unspecified)))
|
||||||
(lambda (face &optional frame)
|
(lambda (face &optional frame)
|
||||||
|
@ -278,7 +279,26 @@
|
||||||
(set-face-attribute face frame :stipple (or value 'unspecified)))
|
(set-face-attribute face frame :stipple (or value 'unspecified)))
|
||||||
(lambda (face &optional frame)
|
(lambda (face &optional frame)
|
||||||
(let ((value (face-attribute face :stipple 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.
|
"Alist of face attributes.
|
||||||
|
|
||||||
|
@ -307,7 +327,8 @@ If FRAME is nil, use the global defaults for FACE."
|
||||||
(let* ((attribute (car (car attrs)))
|
(let* ((attribute (car (car attrs)))
|
||||||
(value (face-attribute face attribute frame)))
|
(value (face-attribute face attribute frame)))
|
||||||
(setq attrs (cdr attrs))
|
(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))))))
|
(setq plist (cons attribute (cons value plist))))))
|
||||||
plist))
|
plist))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue