changeset 9694:f8aa9230c3fa

(enriched-mode): Add autoload cookie. (enriched-decode-foreground, -background): Create faces even if no window system, to prevent multiple warnings.
author Boris Goldowsky <boris@gnu.org>
date Tue, 25 Oct 1994 14:16:02 +0000
parents b6ce6e2ccd15
children 7afe28f7af59
files lisp/enriched.el
diffstat 1 files changed, 15 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/enriched.el	Tue Oct 25 10:52:58 1994 +0000
+++ b/lisp/enriched.el	Tue Oct 25 14:16:02 1994 +0000
@@ -421,21 +421,24 @@
 
 (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 @@
 ;;; 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