aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoris Goldowsky1994-10-25 14:16:02 +0000
committerBoris Goldowsky1994-10-25 14:16:02 +0000
commit60d15bc7d07c2feffd6f12a490d33d8234dc3aa8 (patch)
tree4383abee9160aa19f1920ebe96462ca52a8a34eb
parent866fc66add404962ae163b06dcdf3ce342a4a536 (diff)
downloademacs-60d15bc7d07c2feffd6f12a490d33d8234dc3aa8.tar.gz
emacs-60d15bc7d07c2feffd6f12a490d33d8234dc3aa8.zip
(enriched-mode): Add autoload cookie.
(enriched-decode-foreground, -background): Create faces even if no window system, to prevent multiple warnings.
-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."
421 421
422(defun enriched-decode-foreground (from to color) 422(defun enriched-decode-foreground (from to color)
423 (let ((face (intern (concat "fg:" color)))) 423 (let ((face (intern (concat "fg:" color))))
424 (or (and (fboundp 'facemenu-get-face) (facemenu-get-face face)) 424 (cond ((internal-find-face face))
425 (progn (enriched-warn "Color \"%s\" not defined" color) 425 ((and window-system (facemenu-get-face face)))
426 (if window-system 426 (window-system
427 (enriched-warn 427 (enriched-warn "Color \"%s\" not defined:
428 " Try M-x set-face-foreground RET %s RET some-other-color" face)))) 428 Try M-x set-face-foreground RET %s RET some-other-color" color face))
429 ((make-face face)
430 (enriched-warn "Color \"%s\" can't be displayed." color)))
429 (list from to 'face face))) 431 (list from to 'face face)))
430 432
431(defun enriched-decode-background (from to color) 433(defun enriched-decode-background (from to color)
432 (let ((face (intern (concat "bg:" color)))) 434 (let ((face (intern (concat "bg:" color))))
433 (or (and (fboundp 'facemenu-get-face) (facemenu-get-face face)) 435 (cond ((internal-find-face face))
434 (progn 436 ((and window-system (facemenu-get-face face)))
435 (enriched-warn "Color \"%s\" not defined" color) 437 (window-system
436 (if window-system 438 (enriched-warn "Color \"%s\" not defined:
437 (enriched-warn 439 Try M-x set-face-background RET %s RET some-other-color" color face))
438 " Try M-x set-face-background RET %s RET some-other-color" face)))) 440 ((make-face face)
441 (enriched-warn "Color \"%s\" can't be displayed." color)))
439 (list from to 'face face))) 442 (list from to 'face face)))
440 443
441;;; 444;;;
@@ -447,6 +450,7 @@ One annotation each for foreground color, background color, italic, etc."
447;;; Define the mode 450;;; Define the mode
448;;; 451;;;
449 452
453;;;###autoload
450(defun enriched-mode (&optional arg notrans) 454(defun enriched-mode (&optional arg notrans)
451 "Minor mode for editing text/enriched files. 455 "Minor mode for editing text/enriched files.
452These are files with embedded formatting information in the MIME standard 456These are files with embedded formatting information in the MIME standard