2 ;;; mime-setup.el --- setup file for tm viewer and composer.
4 ;;; Copyright (C) 1995 Free Software Foundation, Inc.
5 ;;; Copyright (C) 1994 .. 1996 MORIOKA Tomohiko
7 ;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
8 ;;; Maintainer: Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp>
9 ;;; and MORIOKA Tomohiko <morioka@jaist.ac.jp>
11 ;;; $Id: mime-setup.el.in,v 7.23 1996/08/10 12:04:21 morioka Exp $
12 ;;; Keywords: mail, news, MIME, multimedia, multilingual, encoded-word
14 ;;; This file is part of tm (Tools for MIME).
16 ;;; This program is free software; you can redistribute it and/or
17 ;;; modify it under the terms of the GNU General Public License as
18 ;;; published by the Free Software Foundation; either version 2, or
19 ;;; (at your option) any later version.
21 ;;; This program is distributed in the hope that it will be useful,
22 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
23 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 ;;; General Public License for more details.
26 ;;; You should have received a copy of the GNU General Public License
27 ;;; along with This program. If not, write to the Free Software
28 ;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
34 (autoload 'mime/editor-mode "tm-edit"
35 "Minor mode for editing MIME message." t)
36 (autoload 'mime/decode-message-header "tm-ew-d"
37 "Decode MIME encoded-words in message header." t)
39 (defun mime-setup-decode-message-header ()
42 (goto-char (point-min))
45 (if (re-search-forward
46 (concat "^" (regexp-quote mail-header-separator) "$")
51 (mime/decode-message-header)
52 (set-buffer-modified-p nil)
55 (add-hook 'mime/editor-mode-hook 'mime-setup-decode-message-header)
61 (defvar mime-setup-use-sc nil)
62 (defvar mime-setup-use-signature t)
63 (defvar mime-setup-default-signature-key "\C-c\C-s")
64 (defvar mime-setup-signature-key-alist '((mail-mode . "\C-c\C-w")))
70 (defun mime-setup-set-signature-key ()
71 (let ((key (or (cdr (assq major-mode mime-setup-signature-key-alist))
72 mime-setup-default-signature-key)))
73 (define-key (current-local-map) key (function insert-signature))
76 (if mime-setup-use-signature
78 (autoload 'insert-signature "signature" "Insert signature" t)
79 (add-hook 'mime/editor-mode-hook 'mime-setup-set-signature-key)
80 (setq gnus-signature-file nil)
81 (setq mail-signature nil)
82 (setq message-signature nil)
97 (add-hook 'mu-cite/pre-cite-hook 'mime/decode-message-header)
100 ;;; @ for RMAIL and VM
103 (add-hook 'mail-setup-hook 'mime/decode-message-header)
104 (add-hook 'mail-setup-hook 'mime/editor-mode 'append)
105 (add-hook 'mail-send-hook 'mime-editor/maybe-translate)
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-editor/maybe-translate)
132 (add-hook 'news-reply-mode-hook 'mime/editor-mode)
133 (add-hook 'news-inews-hook 'mime-editor/maybe-translate)
136 ;;; @ for message (September Gnus 0.58 or later)
139 (add-hook 'message-setup-hook 'mime/editor-mode)
140 (add-hook 'message-send-hook 'mime-editor/maybe-translate)
141 (add-hook 'message-header-hook 'mime/encode-message-header)
147 (require 'message-mime)
154 (provide 'mime-setup)
156 (run-hooks 'mime-setup-load-hook)
158 ;;; mime-setup.el ends here