tm 7.31.
[elisp/tm.git] / tm-mail.el
1 ;;;
2 ;;; tm-mail.el --- mail-mode extension.
3 ;;;
4 ;;; Copyright (C) 1995 KOBAYASHI Shuhei
5 ;;; 
6 ;;; Author: KOBAYASHI Shuhei <shuhei@cmpt01.phys.tohoku.ac.jp>
7 ;;; modified by MORIOKA Tomohiko <morioka@jaist.ac.jp>
8 ;;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp>
9 ;;; Created: 1995/11/27
10 ;;; Version: $Id: tm-mail.el,v 1.2 1995/12/07 10:22:31 morioka Exp $
11 ;;; Keywords: mail, MIME, multimedia
12 ;;;
13 ;;; This file is part of tm (Tools for MIME).
14 ;;;
15 ;;; This program is free software; you can redistribute it and/or
16 ;;; modify it under the terms of the GNU General Public License as
17 ;;; published by the Free Software Foundation; either version 2, or
18 ;;; (at your option) any later version.
19 ;;;
20 ;;; This program is distributed in the hope that it will be useful,
21 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
23 ;;; General Public License for more details.
24 ;;;
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with This program.  If not, write to the Free Software
27 ;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
28 ;;;
29 ;;; Code:
30
31 (require 'tm-edit)
32
33 (defun tm-mail/insert-message (&optional message)
34   (interactive)
35   (let* (mail-yank-hooks
36          (mail-citation-hook '(mime-editor/inserted-message-filter))
37          )
38     (cond
39      ((and (boundp 'vm-mail-buffer) vm-mail-buffer)
40       ;; called from VM.
41       (let ((mail-reply-buffer vm-mail-buffer))
42         (if (null message)
43             (call-interactively 'vm-yank-message)
44           (vm-yank-message message)))
45       )
46      ((boundp 'rmail-send-actions-rmail-buffer)
47       ;; called from RMAIL, emacs-19.29 or later.
48       (mail-yank-original nil)
49       )
50      ((and (boundp 'gnus-article-buffer) (get-buffer gnus-article-buffer))
51       ;; maybe called from Gnus.
52       (tm-gnus/insert-article)
53       )
54      ((and (boundp 'mail-reply-buffer) mail-reply-buffer)
55       ;; maybe called from RMAIL.
56       (mail-yank-original nil)
57       )
58      (t
59       (message "Sorry, I don't have message inserter for your MUA.")
60       ))
61     ))
62
63 (if (string-match "XEmacs\\|Lucid" emacs-version)
64     (setq mail-mode-menu
65           (append mail-mode-menu
66                   '("---")
67                   mime-editor/popup-menu-for-xemacs))
68   )
69
70
71 ;;; @ end
72 ;;;
73
74 (provide 'tm-mail)