summaryrefslogtreecommitdiff
path: root/lisp/enriched.el
diff options
context:
space:
mode:
authorBoris Goldowsky <boris@gnu.org>1994-10-25 14:16:02 +0000
committerBoris Goldowsky <boris@gnu.org>1994-10-25 14:16:02 +0000
commit60d15bc7d07c2feffd6f12a490d33d8234dc3aa8 (patch)
tree4383abee9160aa19f1920ebe96462ca52a8a34eb /lisp/enriched.el
parent866fc66add404962ae163b06dcdf3ce342a4a536 (diff)
downloademacs-60d15bc7d07c2feffd6f12a490d33d8234dc3aa8.tar.gz
(enriched-mode): Add autoload cookie.
(enriched-decode-foreground, -background): Create faces even if no window system, to prevent multiple warnings.
Diffstat (limited to 'lisp/enriched.el')
-rw-r--r--lisp/enriched.el26
1 files changed, 15 insertions, 11 deletions
diff --git a/lisp/enriched.el b/lisp/enriched.el
index 8a4d32501f2..fb2084a1d78 100644
--- a/lisp/enriched.el
+++ b/lisp/enriched.el
@@ -421,21 +421,24 @@ One annotation each for foreground color, background color, italic, etc."
(defun enriched-decode-foreground (from to color)
(let ((face (intern (concat "fg:" color))))
- (or (and (fboundp 'facemenu-get-face) (facemenu-get-face face))
- (progn (enriched-warn "Color \"%s\" not defined" color)
- (if window-system
- (enriched-warn
- " Try M-x set-face-foreground RET %s RET some-other-color" face))))
+ (cond ((internal-find-face face))
+ ((and window-system (facemenu-get-face face)))
+ (window-system
+ (enriched-warn "Color \"%s\" not defined:
+ Try M-x set-face-foreground RET %s RET some-other-color" color face))
+ ((make-face face)
+ (enriched-warn "Color \"%s\" can't be displayed." color)))
(list from to 'face face)))
(defun enriched-decode-background (from to color)
(let ((face (intern (concat "bg:" color))))
- (or (and (fboundp 'facemenu-get-face) (facemenu-get-face face))
- (progn
- (enriched-warn "Color \"%s\" not defined" color)
- (if window-system
- (enriched-warn
- " Try M-x set-face-background RET %s RET some-other-color" face))))
+ (cond ((internal-find-face face))
+ ((and window-system (facemenu-get-face face)))
+ (window-system
+ (enriched-warn "Color \"%s\" not defined:
+ Try M-x set-face-background RET %s RET some-other-color" color face))
+ ((make-face face)
+ (enriched-warn "Color \"%s\" can't be displayed." color)))
(list from to 'face face)))
;;;
@@ -447,6 +450,7 @@ One annotation each for foreground color, background color, italic, etc."
;;; Define the mode
;;;
+;;;###autoload
(defun enriched-mode (&optional arg notrans)
"Minor mode for editing text/enriched files.
These are files with embedded formatting information in the MIME standard