This commit was generated by cvs2svn to compensate for changes in r434,
[elisp/tm.git] / tm-mail.el
1 ;;;
2 ;;; tm-mail.el --- mail-mode extension.
3 ;;;
4 ;;; Copyright (C) 1995,1996 KOBAYASHI Shuhei
5 ;;; 
6 ;;; Author: KOBAYASHI Shuhei <shuhei-k@jaist.ac.jp>
7 ;;; modified by MORIOKA Tomohiko <morioka@jaist.ac.jp>
8 ;;;         and Neal Becker <neal@neal.ctd.comsat.com>
9 ;;; Maintainer: KOBAYASHI Shuhei <shuhei-k@jaist.ac.jp>
10 ;;; Created: 1995/11/27
11 ;;; Version: $Id: tm-mail.el,v 6.0 1996/04/16 18:24:02 morioka Exp $
12 ;;; Keywords: mail, MIME, multimedia
13 ;;;
14 ;;; This file is part of tm (Tools for MIME).
15 ;;;
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.
20 ;;;
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.
25 ;;;
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.
29 ;;;
30 ;;; Code:
31
32 (require 'tm-edit)
33
34 (defun tm-mail/insert-message (&optional message)
35   (interactive)
36   (let* (mail-yank-hooks
37          (mail-citation-hook '(mime-editor/inserted-message-filter))
38          )
39     (cond
40      ((and (boundp 'vm-mail-buffer) vm-mail-buffer)
41       ;; called from VM.
42       (let ((mail-reply-buffer vm-mail-buffer))
43         (if (null message)
44             (call-interactively 'vm-yank-message)
45           (vm-yank-message message)))
46       )
47      ((boundp 'rmail-send-actions-rmail-buffer)
48       ;; called from RMAIL, emacs-19.29 or later.
49       (mail-yank-original nil)
50       )
51      ((and (boundp 'gnus-article-buffer) (get-buffer gnus-article-buffer))
52       ;; maybe called from Gnus.
53       (tm-gnus/insert-article)
54       )
55      ((and (boundp 'mail-reply-buffer) mail-reply-buffer)
56       ;; maybe called from RMAIL.
57       (mail-yank-original nil)
58       )
59      (t
60       (message "Sorry, I don't have message inserter for your MUA.")
61       ))
62     ))
63
64 (defvar tm-mail/use-xemacs-popup-menu running-xemacs)
65
66 (if (and running-xemacs tm-mail/use-xemacs-popup-menu)
67     (cond 
68      ((string-match "19.14" emacs-version)
69       (setq mail-menubar-menu
70             (append mail-menubar-menu
71                     (list "---"
72                           mime-editor/popup-menu-for-xemacs)))
73       )
74      (t
75       (setq mail-mode-menu
76             (append mail-mode-menu
77                     (list "---"
78                           mime-editor/popup-menu-for-xemacs)))
79       )
80      )
81   )
82
83
84 ;;; @ end
85 ;;;
86
87 (provide 'tm-mail)
88
89 ;;; tm-mail.el ends here