f97680c422e6c2ed97bc5ca033c2e7c4dd0e52c5
[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.7 1995/10/26 11:12:49 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-default-signature-key "\C-c\C-s")
24 (defvar mime-setup-signature-key-alist '((mail-mode . "\C-c\C-w")))
25
26
27 ;;; @ for Edit MIME mode
28 ;;;
29
30 (autoload 'mime-mode "tm-edit" "Edit MIME message." t)
31
32
33 ;;; @ for signature
34 ;;;
35
36 (if mime-setup-use-signature
37     (progn
38       (autoload 'insert-signature "signature" "Insert signature" t)
39       (add-hook 'mime-mode-hook
40                 (function
41                  (lambda ()
42                    (let ((key (or (cdr
43                                    (assq major-mode
44                                          mime-setup-signature-key-alist)
45                                    )
46                                   mime-setup-default-signature-key)))
47                      (define-key (current-local-map)
48                        key (function insert-signature))
49                      ))))
50       (setq gnus-signature-file nil)
51       ))
52
53
54 ;;; @ about SuperCite
55 ;;;
56
57 (if mime-setup-use-sc
58     (require 'sc-setup)
59   )
60
61
62 ;;; @ for mh-e
63 ;;;
64
65 (add-hook 'mh-letter-mode-hook
66           (function
67            (lambda ()
68              (mime/decode-message-header)
69              (mime-mode)
70              (make-local-variable 'mail-header-separator)
71              (setq mail-header-separator "--------")
72              (save-excursion
73                (goto-char (point-min))
74                (if (re-search-forward "^-*$" nil t)
75                    (progn
76                      (replace-match mail-header-separator)
77                      (set-buffer-modified-p (buffer-modified-p))
78                      ))
79                )
80              )))
81
82
83 ;;; @ for GNUS
84 ;;;
85
86 (add-hook 'news-reply-mode-hook
87           (function
88            (lambda ()
89              (mime/decode-message-header)
90              (set-buffer-modified-p nil)
91              (mime-mode)
92              )))
93
94 ;;; for Gnus 5.* and September Gnus
95 ;;;
96 (add-hook 'news-inews-hook
97           (function
98            (lambda ()
99              (if mime-mode-flag
100                  (mime-mode-exit)
101                ))))
102 (add-hook 'mail-send-hook
103           (function
104            (lambda ()
105              (if mime-mode-flag
106                  (mime-mode-exit)
107                ))))
108
109
110 ;;; @ for Mail mode (includes VM mode)
111 ;;;
112
113 (add-hook 'mail-mode-hook (function mime-mode))
114 (add-hook 'mail-setup-hook (function mime/decode-message-header))
115
116 ;;; @@ In VM, the following definitions may be requried:
117 ;;; 
118
119 ;;; (if (boundp 'vm-visible-headers)
120 ;;;     (progn
121 ;;;       (setq vm-preview-lines nil)
122 ;;;       (setq vm-invisible-header-regexp nil)
123 ;;;       (setq vm-visible-headers
124 ;;;             (append vm-visible-headers
125 ;;;                     '("Mime-Version:"
126 ;;;                       "Content-Type:"
127 ;;;                       "Content-Transfer-Encoding:")))
128 ;;;       ))
129
130
131 ;;; @ end
132 ;;;
133
134 (provide 'mime-setup)