diff options
author | Gerd Moellmann <gerd@gnu.org> | 2000-07-25 16:07:46 +0000 |
---|---|---|
committer | Gerd Moellmann <gerd@gnu.org> | 2000-07-25 16:07:46 +0000 |
commit | 5dcfb3f41c347f153d522a20421506d3d620a740 (patch) | |
tree | 469930e9c6b38ee80d1f1ad205522512dc0c09cd /lisp/enriched.el | |
parent | 8ad5033be1e1cbbfdd831b37f916be5a6f610c91 (diff) | |
download | emacs-5dcfb3f41c347f153d522a20421506d3d620a740.tar.gz |
(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.
Diffstat (limited to 'lisp/enriched.el')
-rw-r--r-- | lisp/enriched.el | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/enriched.el b/lisp/enriched.el index a6c11d1bc6b..5d64b7ee346 100644 --- a/lisp/enriched.el +++ b/lisp/enriched.el @@ -349,9 +349,9 @@ One annotation each for foreground color, background color, italic, etc." (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 @@ One annotation each for foreground color, background color, italic, etc." (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)))) ;;; |