1 ;;; mime-setup.el --- setup file for tm viewer and composer.
3 ;; Copyright (C) 1995,1996,1997 Free Software Foundation, Inc.
5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
7 ;; $Id: mime-setup.el,v 0.8 1997-02-28 02:22:38 tmorioka Exp $
8 ;; Keywords: MIME, multimedia, multilingual, mail, news
10 ;; This file is part of SEMI (SEMI is Emacs MIME Interfaces).
12 ;; This program is free software; you can redistribute it and/or
13 ;; modify it under the terms of the GNU General Public License as
14 ;; published by the Free Software Foundation; either version 2, or (at
15 ;; your option) any later version.
17 ;; This program is distributed in the hope that it will be useful, but
18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 ;; General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
24 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
25 ;; Boston, MA 02111-1307, USA.
32 (autoload 'mime-edit-mode "mime-edit"
33 "Minor mode for editing MIME message." t)
34 (autoload 'eword-decode-header "eword-decode"
35 "Decode MIME encoded-words in header fields." t)
37 (defun mime-setup-decode-message-header ()
40 (goto-char (point-min))
43 (if (re-search-forward
44 (concat "^" (regexp-quote mail-header-separator) "$")
50 (set-buffer-modified-p nil)
53 (add-hook 'mime-edit-mode-hook 'mime-setup-decode-message-header)
59 (defvar mime-setup-use-signature t
60 "If it is not nil, mime-setup sets up to use signature.el.
63 (defvar mime-setup-default-signature-key "\C-c\C-s"
64 "*Key to insert signature. [mime-setup.el]")
66 (defvar mime-setup-signature-key-alist '((mail-mode . "\C-c\C-w"))
67 "Alist of major-mode vs. key to insert signature. [mime-setup.el]")
73 (defun mime-setup-set-signature-key ()
74 (let ((key (or (cdr (assq major-mode mime-setup-signature-key-alist))
75 mime-setup-default-signature-key)))
76 (define-key (current-local-map) key (function insert-signature))
79 (if mime-setup-use-signature
81 (autoload 'insert-signature "signature" "Insert signature" t)
82 (add-hook 'mime-edit-mode-hook 'mime-setup-set-signature-key)
83 (setq gnus-signature-file nil)
84 (setq mail-signature nil)
85 (setq message-signature nil)
92 (add-hook 'mu-cite/pre-cite-hook 'eword-decode-header)
95 ;;; @ for mail-mode, RMAIL and VM
98 (add-hook 'mail-setup-hook 'eword-decode-header)
99 (add-hook 'mail-setup-hook 'mime-edit-mode 'append)
100 (add-hook 'mail-send-hook 'mime-edit-maybe-translate)
101 (set-alist 'mime-edit-split-message-sender-alist
105 (funcall send-mail-function)
111 (defun mime-setup-mh-draft-setting ()
113 (make-local-variable 'mail-header-separator)
114 (setq mail-header-separator "--------")
116 (goto-char (point-min))
117 (setq buffer-read-only nil)
118 (if (re-search-forward "^-*$" nil t)
120 (replace-match mail-header-separator)
121 (set-buffer-modified-p (buffer-modified-p))
125 (add-hook 'mh-letter-mode-hook 'mime-setup-mh-draft-setting t)
126 (add-hook 'mh-before-send-letter-hook 'mime-edit-maybe-translate)
129 ;;; @ for message (September Gnus 0.58 or later)
132 (defun message-maybe-setup-default-charset ()
134 (and (boundp 'gnus-summary-buffer)
135 (buffer-live-p gnus-summary-buffer)
137 (set-buffer gnus-summary-buffer)
138 default-mime-charset))))
141 (make-local-variable 'default-mime-charset)
142 (setq default-mime-charset charset)
145 (or (boundp 'epoch::version)
147 (add-hook 'message-setup-hook 'mime-edit-mode)
148 (add-hook 'message-setup-hook 'message-maybe-setup-default-charset)
149 (add-hook 'message-send-hook 'mime-edit-maybe-translate)
150 (add-hook 'message-header-hook 'eword-encode-header)
156 (require 'message-mime)
164 (provide 'mime-setup)
166 (run-hooks 'mime-setup-load-hook)
168 ;;; mime-setup.el ends here