comparison lisp/enriched.el @ 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 8ff145bf72cf
children 66c7e651194d
comparison
equal deleted inserted replaced
9693:b6ce6e2ccd15 9694:f8aa9230c3fa
419 (if bg (enriched-push (list "x-bg-color" bg) ans)) 419 (if bg (enriched-push (list "x-bg-color" bg) ans))
420 ans)))) 420 ans))))
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 ;;;
442 ;;; NOTE: Everything below this point is intended to be independent of the file 445 ;;; NOTE: Everything below this point is intended to be independent of the file
443 ;;; format, which is defined by the variables and functions above. 446 ;;; format, which is defined by the variables and functions above.
445 448
446 ;;; 449 ;;;
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.
452 These are files with embedded formatting information in the MIME standard 456 These are files with embedded formatting information in the MIME standard
453 text/enriched format. 457 text/enriched format.
454 458