1 ;;; emh-setup.el --- setup file for emh.
3 ;; Copyright (C) 1994,1995,1996,1997,1998 Free Software Foundation, Inc.
5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
6 ;; Keywords: mh-e, mail, news, MIME, multimedia, multilingual
8 ;; This file is part of emh.
10 ;; This program is free software; you can redistribute it and/or
11 ;; modify it under the terms of the GNU General Public License as
12 ;; published by the Free Software Foundation; either version 2, or (at
13 ;; your option) any later version.
15 ;; This program is distributed in the hope that it will be useful, but
16 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ;; General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
33 (eval-after-load "mh-e" '(require 'emh))
39 (autoload 'turn-on-mime-edit "mime-edit"
40 "Unconditionally turn on MIME-Edit minor mode." t)
42 (defun emh-setup-mh-draft-setting ()
43 (make-local-variable 'mail-header-separator)
44 (setq mail-header-separator "--------")
45 (mime-decode-header-in-buffer nil mail-header-separator)
46 (let ((ua mime-edit-user-agent-value))
47 (make-local-variable 'mime-edit-user-agent-value)
48 (setq mime-edit-user-agent-value (concat "EMH/" emh-version " " ua))
52 (goto-char (point-min))
53 (setq buffer-read-only nil)
54 (if (re-search-forward "^-*$" nil t)
56 (replace-match mail-header-separator)
57 (set-buffer-modified-p (buffer-modified-p))
61 (add-hook 'mh-letter-mode-hook 'emh-setup-mh-draft-setting t)
62 (add-hook 'mh-before-send-letter-hook 'mime-edit-maybe-translate)
65 ;;; @@ for emh-comp.el
68 (autoload 'emh-edit-again "emh-comp"
69 "Clean-up a draft or a message previously sent and make it resendable." t)
70 (autoload 'emh-extract-rejected-mail "emh-comp"
71 "Extract a letter returned by the mail system and make it re-editable." t)
72 (autoload 'emh-forward "emh-comp"
73 "Forward a message or message sequence by MIME style." t)
78 (substitute-key-definition
79 'mh-edit-again 'emh-edit-again
81 (substitute-key-definition
82 'mh-extract-rejected-mail 'emh-extract-rejected-mail
84 (substitute-key-definition
85 'mh-forward 'emh-forward
89 (eval-after-load "mh-comp" '(require 'emh-comp))
97 ;;; emh-setup.el ends here