Commit ae8f9257 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(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.
parent ee8107c0
...@@ -347,10 +347,6 @@ which can be the value of the `face' text property." ...@@ -347,10 +347,6 @@ which can be the value of the `face' text property."
(list (list "x-bg-color" (cadr face)))) (list (list "x-bg-color" (cadr face))))
((listp face) ((listp face)
(apply 'append (mapcar 'enriched-face-ans face))) (apply 'append (mapcar 'enriched-face-ans face)))
((string-match "^fg:" (symbol-name face))
(list (list "x-color" (substring (symbol-name face) 3))))
((string-match "^bg:" (symbol-name face))
(list (list "x-bg-color" (substring (symbol-name face) 3))))
((let* ((fg (face-attribute face :foreground)) ((let* ((fg (face-attribute face :foreground))
(bg (face-attribute face :background)) (bg (face-attribute face :background))
(props (face-font face t)) (props (face-font face t))
...@@ -436,28 +432,20 @@ Return value is \(begin end name positive-p), or nil if none was found." ...@@ -436,28 +432,20 @@ Return value is \(begin end name positive-p), or nil if none was found."
(delete-char 1))) (delete-char 1)))
(defun enriched-decode-foreground (from to &optional color) (defun enriched-decode-foreground (from to &optional color)
(let ((face (intern (concat "fg:" color)))) (if (and color (display-color-p) (facemenu-get-face face))
(cond ((null color) (list from to 'face (cons ':foreground color))
(message "Warning: no color specified for <x-color>")) (if (null color)
((facep face)) (message "Warning: no color specified for <x-color>")
((and (display-color-p) (facemenu-get-face face)) (message "Warning: color `%s' can't be displayed" color))
(set-face-foreground face color)) nil))
((make-face face)
(message "Warning: color `%s' can't be displayed" color)))
(list from to 'face face)))
(defun enriched-decode-background (from to &optional color) (defun enriched-decode-background (from to &optional color)
(let ((face (intern (concat "bg:" color)))) (if (and color (display-color-p) (facemenu-get-face face))
(cond ((null color) (list from to 'face (cons ':background color))
(message "Warning: no color specified for <x-bg-color>")) (if (null color)
((facep face)) (message "Warning: no color specified for <x-bg-color>")
((and (display-color-p) (facemenu-get-face face)) (message "Warning: color `%s' can't be displayed" color))
(set-face-background face color)) nil))
((make-face face)
(message "Warning: color `%s' can't be displayed" color)))
(list from to 'face face)))
;;; Handling the `display' property. ;;; Handling the `display' property.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment