e30830cc3cd9a2d66731ae597fb59f898776d3aa
[elisp/emh.git] / emh-setup.el
1 ;;; emh-setup.el --- setup file for emh.
2
3 ;; Copyright (C) 1994,1995,1996,1997 Free Software Foundation, Inc.
4
5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
6 ;; Version: $Id: emh-setup.el,v 0.2.4.1 1998-10-16 05:59:48 morioka Exp $
7 ;; Keywords: mail, news, MIME, multimedia, multilingual, encoded-word
8
9 ;; This file is part of SEMI (SEMI is Emacs MIME Interfaces).
10
11 ;; This program is free software; you can redistribute it and/or
12 ;; modify it under the terms of the GNU General Public License as
13 ;; published by the Free Software Foundation; either version 2, or (at
14 ;; your option) any later version.
15
16 ;; This program is distributed in the hope that it will be useful, but
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19 ;; General Public License for more details.
20
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 ;; Boston, MA 02111-1307, USA.
25
26 ;;; Code:
27
28 (require 'semi-setup)
29
30
31 ;;; @ for emh
32 ;;;
33
34 (eval-after-load "mh-e" '(require 'emh))
35
36
37 ;;; @ for mime-edit
38 ;;;
39
40 (autoload 'turn-on-mime-edit "mime-edit"
41   "Unconditionally turn on MIME-Edit minor mode." t)
42
43 (defun emh-setup-mh-draft-setting ()
44   (eword-decode-header 'code-conversion mail-header-separator)
45   (turn-on-mime-edit)
46   (make-local-variable 'mail-header-separator)
47   (setq mail-header-separator "--------")
48   (save-excursion
49     (goto-char (point-min))
50     (setq buffer-read-only nil)
51     (if (re-search-forward "^-*$" nil t)
52         (progn
53           (replace-match mail-header-separator)
54           (set-buffer-modified-p (buffer-modified-p))
55           ))
56     ))
57
58 (add-hook 'mh-letter-mode-hook 'emh-setup-mh-draft-setting t)
59 (add-hook 'mh-before-send-letter-hook 'mime-edit-maybe-translate)
60
61
62 ;;; @@ for emh-comp.el
63 ;;;
64
65 (autoload 'emh-edit-again "emh-comp"
66   "Clean-up a draft or a message previously sent and make it resendable." t)
67 (autoload 'emh-extract-rejected-mail "emh-comp"
68   "Extract a letter returned by the mail system and make it re-editable." t)
69 (autoload 'emh-forward "emh-comp"
70   "Forward a message or message sequence by MIME style." t)
71
72 (eval-after-load
73     "mh-e"
74   '(progn
75      (substitute-key-definition
76       'mh-edit-again 'emh-edit-again
77       mh-folder-mode-map)
78      (substitute-key-definition
79       'mh-extract-rejected-mail 'emh-extract-rejected-mail
80       mh-folder-mode-map)
81      (substitute-key-definition
82       'mh-forward 'emh-forward
83       mh-folder-mode-map)
84      ))
85
86 (eval-after-load "mh-comp" '(require 'emh-comp))
87
88
89 ;;; @ end
90 ;;;
91
92 (provide 'emh-setup)
93
94 ;;; emh-setup.el ends here