;;; ;;; $Id: mime-setup.el,v 5.1 1994/11/29 16:10:15 morioka Exp $ ;;; (provide 'mime-setup) (require 'tm-setup) ;;; @ variables ;;; (defvar mime-setup-use-sc nil) ;;; @ for Edit MIME mode ;;; (autoload 'mime-mode "mime" "Edit MIME message." t) (autoload 'mime-convert-buffer "mime" "convert to MIME." t) (autoload 'mime/encode-message-header "tiny-mime" "convert message header to MIME style." t) (autoload 'insert-signature "signature" "Insert signature" t) (add-hook 'mime-mode-hook (function (lambda () (define-key (current-local-map) "\C-c\C-s" (function insert-signature)) ))) (setq mime-translate-hook (function mime/encode-message-header)) (if (boundp 'MULE) (progn (defun mime-header-charset-chooser-for-mule-no-encode-ISO-2022-JP (begin end) (let ((lclist (find-charset-region begin end))) (cond ((null lclist) nil) ;US-ASCII requres no encoding. ((memq lc-ltn1 lclist) '("ISO-8859-1" . "Q")) ((memq lc-ltn2 lclist) '("ISO-8859-2" . "Q")) ((memq lc-ltn3 lclist) '("ISO-8859-3" . "Q")) ((memq lc-ltn4 lclist) '("ISO-8859-4" . "Q")) ((memq lc-crl lclist) '("ISO-8859-5" . "Q")) ;;((memq lc-arb lclist) ;; '("ISO-8859-6" . "Q")) ((memq lc-grk lclist) '("ISO-8859-7" . "Q")) ((memq lc-hbw lclist) '("ISO-8859-8" . "Q")) ((memq lc-ltn5 lclist) '("ISO-8859-9" . "Q")) ((memq lc-jp lclist) nil) (t ;Unknown charset. It must be Mule! '("ISO-2022-JP-2" . "B")) ))) (setq mime-header-charset-chooser 'mime-header-charset-chooser-for-mule-no-encode-ISO-2022-JP) ) (progn (defun mime-header-charset-chooser-for-nemacs-no-encode-ISO-2022-JP (begin end)) (setq mime-header-charset-chooser 'mime-header-charset-chooser-for-nemacs-no-encode-ISO-2022-JP) )) (setq mime-content-types '(("text" ;; Charset parameter need not to be specified, since it is ;; defined automatically while translation. ("plain" ;;("charset" "" "ISO-2022-JP" "US-ASCII" "ISO-8859-1" "ISO-8859-8") ) ("richtext" ;;("charset" "" "ISO-2022-JP" "US-ASCII" "ISO-8859-1" "ISO-8859-8") ) ("enriched" ;;("charset" "" "ISO-2022-JP" "US-ASCII" "ISO-8859-1" "ISO-8859-8") ) ("x-latex" ("x-name") ;;("charset" "" "ISO-2022-JP" "US-ASCII" "ISO-8859-1" "ISO-8859-8") )) ("message" ("external-body" ("access-type" ("anon-ftp" ("site" "wnoc-fuk.wide.ad.jp" "nic.karrn.ad.jp") ("directory") ("name") ("mode" "binary" "ascii")) ("ftp" ("site") ("directory") ("name") ("mode" "binary" "ascii")) ("tftp" ("site") ("name")) ("afs" ("site") ("name")) ("local-file" ("site") ("name")) ("mail-server" ("server")))) ("rfc822")) ("application" ("octet-stream" ("name") ("type" "" "tar" "shar") ("conversions")) ("postscript") ("x-kiss" ("x-name") ("x-cnf"))) ("image" ("gif" ("x-name")) ("jpeg" ("x-name")) ("x-pic" ("x-name")) ("x-xwd") ("x-xbm")) ("audio" ("basic")) ("video" ("mpeg"))) ) (setq mime-file-types '(("\\.rtf$" "text" "richtext" nil nil) ("\\.ps$" "application" "postscript" nil "quoted-printable") ("\\.gif$" "image" "gif" nil "base64") ("\\.jpg$" "image" "jpeg" nil "base64") ("\\.xwd$" "image" "x-xwd" nil "base64") ("\\.xbm$" "image" "x-xbm" nil "base64") ("\\.PIC$" "image" "x-pic" nil "base64") ("\\.pic$" "image" "x-pic" nil "base64") ("\\.tiff$" "image" "tiff" nil "base64") ("\\.au$" "audio" "basic" nil "base64") ("\\.mpg$" "video" "mpeg" nil "base64") ("\\.el$" "application" "octet-stream" nil "7bit") ("\\.signature" "text" "plain" nil nil) (".*" nil nil nil nil)) ) ;;; @ about SuperCite ;;; (if mime-setup-use-sc (require 'sc-setup) ) ;;; @ for mh-e ;;; (add-hook 'mh-letter-mode-hook (function (lambda () (mime/decode-message-header) (mime-mode) (make-local-variable 'mail-header-separator) (setq mail-header-separator "--------")) )) ;;; @ for GNUS ;;; (add-hook 'news-reply-mode-hook (function (lambda () (mime/decode-message-header) (mime-mode) ))) (setq gnus-signature-file nil) ;;; @ for Mail mode (includes VM mode) ;;; (add-hook 'mail-mode-hook (function mime-mode)) (add-hook 'mail-setup-hook (function mime/decode-message-header)) ;;; @@ In VM, the following definitions may be requried: ;;; (if (boundp 'vm-visible-headers) (progn (setq vm-preview-lines nil) (setq vm-invisible-header-regexp nil) (setq vm-visible-headers (append vm-visible-headers '("Mime-Version:" "Content-Type:" "Content-Transfer-Encoding:"))) )) ;;; Local Variables: ;;; mode: emacs-lisp ;;; mode: outline-minor ;;; outline-regexp: ";;; @+\\|(......" ;;; End: