diff options
| author | Richard M. Stallman | 2002-04-03 15:28:45 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2002-04-03 15:28:45 +0000 |
| commit | ae8f92579cbbf873dcbef1fad931cd4f2797ea31 (patch) | |
| tree | 1d267ec9bd0c735c1ed9ae83fa73c25822f6cd64 | |
| parent | ee8107c0ea11f5b2ee4b58c25dd43e227c9665e5 (diff) | |
| download | emacs-ae8f92579cbbf873dcbef1fad931cd4f2797ea31.tar.gz emacs-ae8f92579cbbf873dcbef1fad931cd4f2797ea31.zip | |
(enriched-face-ans): Delete special treatment for fg:... and bg:... faces.
(enriched-decode-foreground): Return a list that specifies
the foreground color, rather than creating a face.
(enriched-decode-background): Likewise.
| -rw-r--r-- | lisp/enriched.el | 36 |
1 files changed, 12 insertions, 24 deletions
diff --git a/lisp/enriched.el b/lisp/enriched.el index 1a15878ab68..6322957df36 100644 --- a/lisp/enriched.el +++ b/lisp/enriched.el | |||
| @@ -347,10 +347,6 @@ which can be the value of the `face' text property." | |||
| 347 | (list (list "x-bg-color" (cadr face)))) | 347 | (list (list "x-bg-color" (cadr face)))) |
| 348 | ((listp face) | 348 | ((listp face) |
| 349 | (apply 'append (mapcar 'enriched-face-ans face))) | 349 | (apply 'append (mapcar 'enriched-face-ans face))) |
| 350 | ((string-match "^fg:" (symbol-name face)) | ||
| 351 | (list (list "x-color" (substring (symbol-name face) 3)))) | ||
| 352 | ((string-match "^bg:" (symbol-name face)) | ||
| 353 | (list (list "x-bg-color" (substring (symbol-name face) 3)))) | ||
| 354 | ((let* ((fg (face-attribute face :foreground)) | 350 | ((let* ((fg (face-attribute face :foreground)) |
| 355 | (bg (face-attribute face :background)) | 351 | (bg (face-attribute face :background)) |
| 356 | (props (face-font face t)) | 352 | (props (face-font face t)) |
| @@ -436,28 +432,20 @@ Return value is \(begin end name positive-p), or nil if none was found." | |||
| 436 | (delete-char 1))) | 432 | (delete-char 1))) |
| 437 | 433 | ||
| 438 | (defun enriched-decode-foreground (from to &optional color) | 434 | (defun enriched-decode-foreground (from to &optional color) |
| 439 | (let ((face (intern (concat "fg:" color)))) | 435 | (if (and color (display-color-p) (facemenu-get-face face)) |
| 440 | (cond ((null color) | 436 | (list from to 'face (cons ':foreground color)) |
| 441 | (message "Warning: no color specified for <x-color>")) | 437 | (if (null color) |
| 442 | ((facep face)) | 438 | (message "Warning: no color specified for <x-color>") |
| 443 | ((and (display-color-p) (facemenu-get-face face)) | 439 | (message "Warning: color `%s' can't be displayed" color)) |
| 444 | (set-face-foreground face color)) | 440 | nil)) |
| 445 | ((make-face face) | ||
| 446 | (message "Warning: color `%s' can't be displayed" color))) | ||
| 447 | (list from to 'face face))) | ||
| 448 | 441 | ||
| 449 | (defun enriched-decode-background (from to &optional color) | 442 | (defun enriched-decode-background (from to &optional color) |
| 450 | (let ((face (intern (concat "bg:" color)))) | 443 | (if (and color (display-color-p) (facemenu-get-face face)) |
| 451 | (cond ((null color) | 444 | (list from to 'face (cons ':background color)) |
| 452 | (message "Warning: no color specified for <x-bg-color>")) | 445 | (if (null color) |
| 453 | ((facep face)) | 446 | (message "Warning: no color specified for <x-bg-color>") |
| 454 | ((and (display-color-p) (facemenu-get-face face)) | 447 | (message "Warning: color `%s' can't be displayed" color)) |
| 455 | (set-face-background face color)) | 448 | nil)) |
| 456 | ((make-face face) | ||
| 457 | (message "Warning: color `%s' can't be displayed" color))) | ||
| 458 | (list from to 'face face))) | ||
| 459 | |||
| 460 | |||
| 461 | 449 | ||
| 462 | ;;; Handling the `display' property. | 450 | ;;; Handling the `display' property. |
| 463 | 451 | ||