aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann2000-07-25 16:07:46 +0000
committerGerd Moellmann2000-07-25 16:07:46 +0000
commit5dcfb3f41c347f153d522a20421506d3d620a740 (patch)
tree469930e9c6b38ee80d1f1ad205522512dc0c09cd
parent8ad5033be1e1cbbfdd831b37f916be5a6f610c91 (diff)
downloademacs-5dcfb3f41c347f153d522a20421506d3d620a740.tar.gz
emacs-5dcfb3f41c347f153d522a20421506d3d620a740.zip
(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.
-rw-r--r--lisp/ChangeLog12
-rw-r--r--lisp/enriched.el10
2 files changed, 18 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 3aea439ec9b..cc94cc34ce4 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,15 @@
12000-07-25 Gerd Moellmann <gerd@gnu.org>
2
3 * find-dired.el: Update copyright notice.
4 (find-dired): Offer to kill a running `find'.
5
6 * enriched.el (enriched-face-ans): For a `foreground-color'
7 property, return '(("x-color" COLOR))' so that COLOR will be
8 output as a parameter of the x-color annotation. Likewise for the
9 `background-color' property. In the case of normal face
10 properties, don't return annotations for unspecified foreground
11 and background face attributes.
12
12000-07-25 Kenichi Handa <handa@etl.go.jp> 132000-07-25 Kenichi Handa <handa@etl.go.jp>
2 14
3 * language/japan-util.el (japanese-katakana-region): Fix handling 15 * language/japan-util.el (japanese-katakana-region): Fix handling
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."
349(defun enriched-face-ans (face) 349(defun enriched-face-ans (face)
350 "Return annotations specifying FACE." 350 "Return annotations specifying FACE."
351 (cond ((and (consp face) (eq (car face) 'foreground-color)) 351 (cond ((and (consp face) (eq (car face) 'foreground-color))
352 (list "x-color" (cdr face))) 352 (list (list "x-color" (cdr face))))
353 ((and (consp face) (eq (car face) 'background-color)) 353 ((and (consp face) (eq (car face) 'background-color))
354 (list "x-bg-color" (cdr face))) 354 (list (list "x-bg-color" (cdr face))))
355 ((string-match "^fg:" (symbol-name face)) 355 ((string-match "^fg:" (symbol-name face))
356 (list (list "x-color" (substring (symbol-name face) 3)))) 356 (list (list "x-color" (substring (symbol-name face) 3))))
357 ((string-match "^bg:" (symbol-name face)) 357 ((string-match "^bg:" (symbol-name face))
@@ -361,8 +361,10 @@ One annotation each for foreground color, background color, italic, etc."
361 (props (face-font face t)) 361 (props (face-font face t))
362 (ans (cdr (format-annotate-single-property-change 362 (ans (cdr (format-annotate-single-property-change
363 'face nil props enriched-translations)))) 363 'face nil props enriched-translations))))
364 (if fg (setq ans (cons (list "x-color" fg) ans))) 364 (unless (eq fg 'unspecified)
365 (if bg (setq ans (cons (list "x-bg-color" bg) ans))) 365 (setq ans (cons (list "x-color" fg) ans)))
366 (unless (eq bg 'unspecified)
367 (setq ans (cons (list "x-bg-color" bg) ans)))
366 ans)))) 368 ans))))
367 369
368;;; 370;;;