tm 7.9.
[elisp/tm.git] / mime-setup.el
1 ;;;
2 ;;; mime-setup.el --- setup file to use tm and mime.el.
3 ;;;
4 ;;; Copyright (C) 1995 Free Software Foundation, Inc.
5 ;;; Copyright (C) 1994,1995 MORIOKA Tomohiko
6 ;;;
7 ;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
8 ;;; Version:
9 ;;;     $Id: mime-setup.el,v 7.0 1995/10/03 04:27:39 morioka Exp $
10 ;;; Keywords: mail, news, MIME, multimedia, multilingual, encoded-word
11 ;;;
12 ;;; This file is part of tm (Tools for MIME).
13 ;;;
14
15 (require 'tm-setup)
16
17
18 ;;; @ variables
19 ;;;
20
21 (defvar mime-setup-use-sc nil)
22 (defvar mime-setup-use-signature t)
23 (defvar mime-setup-signature-key "\C-c\C-s")
24
25
26 ;;; @ for Edit MIME mode
27 ;;;
28
29 (autoload 'mime-mode "mime" "Edit MIME message." t)
30 (autoload 'mime-convert-buffer "mime" "convert to MIME." t)
31
32 (setq mime-content-types
33       '(("text"
34          ;; Charset parameter need not to be specified, since it is
35          ;; defined automatically while translation.
36          ("plain"
37           ;;("charset" "" "ISO-2022-JP" "US-ASCII" "ISO-8859-1" "ISO-8859-8")
38           )
39          ("richtext"
40           ;;("charset" "" "ISO-2022-JP" "US-ASCII" "ISO-8859-1" "ISO-8859-8")
41           )
42          ("enriched"
43           ;;("charset" "" "ISO-2022-JP" "US-ASCII" "ISO-8859-1" "ISO-8859-8")
44           )
45          ("x-latex"
46           ("x-name")
47           ;;("charset" "" "ISO-2022-JP" "US-ASCII" "ISO-8859-1" "ISO-8859-8")
48           )
49          ("html"
50           ("x-name")
51           ;;("charset" "" "ISO-2022-JP" "US-ASCII" "ISO-8859-1" "ISO-8859-8")
52           ))
53         ("message"
54          ("external-body"
55           ("access-type"
56            ("anon-ftp"
57             ("site" "ftp.jaist.ac.jp" "wnoc-fuk.wide.ad.jp" "nic.karrn.ad.jp")
58             ("directory" "/pub/GNU/elisp/mime")
59             ("name")
60             ("mode" "binary" "ascii"))
61            ("ftp"
62             ("site")
63             ("directory")
64             ("name")
65             ("mode" "binary" "ascii"))
66            ("tftp"
67             ("site")
68             ("name"))
69            ("afs"
70             ("site")
71             ("name"))
72            ("local-file"
73             ("site")
74             ("name"))
75            ("mail-server"
76             ("server"))))
77          ("rfc822"))
78         ("application"
79          ("octet-stream"
80           ("name")
81           ("type" "" "tar" "shar")
82           ("conversions"))
83          ("postscript")
84          ("x-kiss"
85           ("x-name")
86           ("x-cnf")))
87         ("image"
88          ("gif"  ("x-name"))
89          ("jpeg" ("x-name"))
90          ("x-pic"  ("x-name"))
91          ("x-xwd")
92          ("x-xbm"))
93         ("audio"
94          ("basic"))
95         ("video"
96          ("mpeg")))
97       )
98
99
100 ;;; @ for signature
101 ;;;
102
103 (if mime-setup-use-signature
104     (progn
105       (autoload 'insert-signature "signature" "Insert signature" t)
106       
107       (add-hook 'mime-mode-hook
108                 (function
109                  (lambda ()
110                    (define-key (current-local-map)
111                      mime-setup-signature-key
112                      (function insert-signature))
113                    )))
114       
115       (setq gnus-signature-file nil)
116       ))
117
118
119 ;;; @ for encoded-word
120 ;;;
121
122 (autoload 'mime/encode-message-header "tm-eword"
123   "convert message header to MIME style." t)
124
125 (add-hook 'mime-translate-hook (function mime/encode-message-header))
126
127 (setq mime-header-charset-chooser
128       (function
129        (lambda (begin end)
130          )))
131
132
133 ;;; @ for tm-comp
134 ;;;
135
136 (call-after-loaded
137  'tm-comp
138  (function
139   (lambda ()
140     (setq mime-transfer-encoders
141           '(("base64"           "mmencode")
142             ("quoted-printable" "mmencode" "-q")
143             ("7bit"             nil)    ;Default
144             ("8bit"             nil)
145             ("binary"           nil)
146             ("x-uue"            "uuencode" "-")
147             ))
148     
149     (setq mime-file-types
150           '(("\\.rtf$"
151              "text"     "richtext"      nil     nil)
152             ("\\.html$"
153              "text"     "html"          nil     nil)
154             ("\\.ps$"
155              "application" "postscript" nil     "quoted-printable")
156             ("\\.gif$"
157              "image"    "gif"           nil     "base64")
158             ("\\.jpg$"
159              "image"    "jpeg"          nil     "base64")
160             ("\\.xwd$"
161              "image"    "x-xwd"         nil     "base64")
162             ("\\.xbm$"
163              "image"    "x-xbm"         nil     "base64")
164             ("\\.pic$"
165              "image"    "x-pic"         nil     "base64")
166             ("\\.tiff$"
167              "image"    "tiff"          nil     "base64")
168             ("\\.au$"
169              "audio"    "basic"         nil     "base64")
170             ("\\.mpg$"
171              "video"    "mpeg"          nil     "base64")
172             ("\\.el$"
173              "application" "octet-stream" (("name" . file)
174                                            ("type" . "emacs-lisp")) "7bit")
175             ("\\.tar.gz$"
176              "application" "octet-stream" (("name" . file)
177                                            ("type" . "tar")
178                                            ("conversions" . "gzip")) nil)
179             ("\\.signature"
180              "text"     "plain"         nil     nil)
181             (".*"       nil             nil     nil     nil))
182           )
183     )))
184
185
186 ;;; @ about SuperCite
187 ;;;
188
189 (if mime-setup-use-sc
190     (require 'sc-setup)
191   )
192
193
194 ;;; @ for mh-e
195 ;;;
196
197 (add-hook 'mh-letter-mode-hook
198           (function
199            (lambda ()
200              (mime/decode-message-header)
201              (mime-mode)
202              (make-local-variable 'mail-header-separator)
203              (setq mail-header-separator "--------"))
204            ))
205
206
207 ;;; @ for GNUS
208 ;;;
209
210 (add-hook 'news-reply-mode-hook
211           (function
212            (lambda ()
213              (mime/decode-message-header)
214              (set-buffer-modified-p nil)
215              (mime-mode)
216              )))
217
218
219 ;;; @ for Mail mode (includes VM mode)
220 ;;;
221
222 (add-hook 'mail-mode-hook (function mime-mode))
223 (add-hook 'mail-setup-hook (function mime/decode-message-header))
224
225 ;;; @@ In VM, the following definitions may be requried:
226 ;;; 
227
228 (if (boundp 'vm-visible-headers)
229     (progn
230       (setq vm-preview-lines nil)
231       (setq vm-invisible-header-regexp nil)
232       (setq vm-visible-headers
233             (append vm-visible-headers
234                     '("Mime-Version:"
235                       "Content-Type:"
236                       "Content-Transfer-Encoding:")))
237       ))
238
239
240 ;;; @ end
241 ;;;
242
243 (provide 'mime-setup)
244
245 ;;; Local Variables:
246 ;;; mode: emacs-lisp
247 ;;; mode: outline-minor
248 ;;; outline-regexp: ";;; @+\\|(......"
249 ;;; End: