Mercurial > emacs
changeset 30456:597562b7a8c6
(enriched-face-ans): For a `foreground-color'
property, return '(("x-color" COLOR))' so that COLOR will be
output as a parameter of the x-color annotation. Likewise for the
`background-color' property. In the case of normal face
properties, don't return annotations for unspecified foreground
and background face attributes.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Tue, 25 Jul 2000 16:05:25 +0000 |
parents | 1130a792b2f7 |
children | 07c7a241f418 |
files | lisp/enriched.el |
diffstat | 1 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/enriched.el Tue Jul 25 16:05:09 2000 +0000 +++ b/lisp/enriched.el Tue Jul 25 16:05:25 2000 +0000 @@ -349,9 +349,9 @@ (defun enriched-face-ans (face) "Return annotations specifying FACE." (cond ((and (consp face) (eq (car face) 'foreground-color)) - (list "x-color" (cdr face))) + (list (list "x-color" (cdr face)))) ((and (consp face) (eq (car face) 'background-color)) - (list "x-bg-color" (cdr face))) + (list (list "x-bg-color" (cdr face)))) ((string-match "^fg:" (symbol-name face)) (list (list "x-color" (substring (symbol-name face) 3)))) ((string-match "^bg:" (symbol-name face)) @@ -361,8 +361,10 @@ (props (face-font face t)) (ans (cdr (format-annotate-single-property-change 'face nil props enriched-translations)))) - (if fg (setq ans (cons (list "x-color" fg) ans))) - (if bg (setq ans (cons (list "x-bg-color" bg) ans))) + (unless (eq fg 'unspecified) + (setq ans (cons (list "x-color" fg) ans))) + (unless (eq bg 'unspecified) + (setq ans (cons (list "x-bg-color" bg) ans))) ans)))) ;;;