-;;;
-;;; tm-vm.el --- tm-MUA for VM
-;;;
-;;; Copyright (C) 1994 MASUTANI Yasuhiro
-;;; Copyright (C) 1995 WAKAMIYA Kenji
-;;; Copyright (C) 1995,1996 KOBAYASHI Shuhei
-;;; Copyright (C) 1996 Oscar Figueiredo
-;;;
-;;; Author: MASUTANI Yasuhiro <masutani@me.es.osaka-u.ac.jp>
-;;; Kenji Wakamiya <wkenji@flab.fujitsu.co.jp>
-;;; MORIOKA Tomohiko <morioka@jaist.ac.jp>
-;;; KOBAYASHI Shuhei <shuhei-k@jaist.ac.jp>
-;;; Oscar Figueiredo <figueire@lspsun2.epfl.ch>
-;;; modified by SHIONO Jun'ichi <jun@case.nm.fujitsu.co.jp>
-;;; ISHIHARA Akito <aki@bpel.tutics.tut.ac.jp>
-;;; Rob Kooper <kooper@cc.gatech.edu>
-;;; Maintainer: KOBAYASHI Shuhei <shuhei-k@jaist.ac.jp>
-;;; Created: 1994/10/29
-;;; Version: $Revision: 7.53 $
-;;; Keywords: mail, MIME, multimedia, multilingual, encoded-word
-;;;
-;;; This file is part of tm (Tools for MIME).
-;;;
-;;; This program is free software; you can redistribute it and/or
-;;; modify it under the terms of the GNU General Public License as
-;;; published by the Free Software Foundation; either version 2, or
-;;; (at your option) any later version.
-;;;
-;;; This program is distributed in the hope that it will be useful,
-;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-;;; General Public License for more details.
-;;;
-;;; You should have received a copy of the GNU General Public License
-;;; along with This program. If not, write to the Free Software
-;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
-;;;
+;;; tm-vm.el --- tm-MUA (MIME Extension module) for VM
+
+;; Copyright (C) 1994,1995,1996 Free Software Foundation, Inc.
+
+;; Author: MASUTANI Yasuhiro <masutani@me.es.osaka-u.ac.jp>
+;; Kenji Wakamiya <wkenji@flab.fujitsu.co.jp>
+;; MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;; Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp>
+;; Oscar Figueiredo <figueire@lspsun2.epfl.ch>
+;; Maintainer: Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp>
+;; Created: 1994/10/29
+;; Version: $Revision: 7.62 $
+;; Keywords: mail, MIME, multimedia, multilingual, encoded-word
+
+;; This file is part of tm (Tools for MIME).
+
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License as
+;; published by the Free Software Foundation; either version 2, or (at
+;; your option) any later version.
+
+;; This program is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
;;; Commentary:
-;;;
-;;; Plese insert `(require 'tm-vm)' in your ~/.vm file.
-;;;
+
+;; Plese insert `(require 'tm-vm)' in your ~/.vm file.
+
;;; Code:
(require 'tm-view)
(require 'vm)
(defconst tm-vm/RCS-ID
- "$Id: tm-vm.el,v 7.53 1996/05/23 16:51:04 shuhei-k Exp $")
+ "$Id: tm-vm.el,v 7.62 1996/08/31 14:24:35 morioka Exp $")
(defconst tm-vm/version (get-version-string tm-vm/RCS-ID))
(define-key vm-mode-map "Z" 'tm-vm/view-message)
(if (or vm-highlighted-header-regexp
(and (vm-xemacs-p) vm-use-lucid-highlighting))
(vm-highlight-headers))
- ;;
+ (if (and vm-use-menus (vm-menu-support-possible-p))
+ (vm-energize-headers)) ;;
(goto-char (point-min))
(narrow-to-region (point) (search-forward "\n\n" nil t))
))
(require 'vm-reply)
+(defvar tm-vm/yank:message-to-restore nil
+ "For internal use by tm-vm only.")
+
(defun vm-yank-message (&optional message)
"Yank message number N into the current buffer at point.
When called interactively N is always read from the minibuffer. When
called non-interactively the first argument is expected to be a
message struct.
-This function originally provided by vm-reply has been patched for TM in
-order to provide better citation of MIME messages : if a MIME Preview
-buffer is displayed for the message then its contents are inserted
+This function originally provided by vm-reply has been patched for TM
+in order to provide better citation of MIME messages : if a MIME
+Preview buffer exists for the message then its contents are inserted
instead of the raw message.
This command is meant to be used in VM created Mail mode buffers; the
(setq result (string-to-int result)))
(if (null (setq mp (nthcdr (1- result) vm-message-list)))
(error "No such message."))
+ (setq tm-vm/yank:message-to-restore (string-to-int default))
+ (save-selected-window
+ (vm-goto-message result))
(car mp))
nil))))
(if (null message)
(vm-number-of message)))
(vm-display nil nil '(vm-yank-message)
'(vm-yank-message composing-message))
- (setq message (vm-real-message-of message))
(let ((b (current-buffer)) (start (point)) end)
(save-restriction
(widen)
(set-buffer (vm-buffer-of message))
(let* ((mbuf (current-buffer))
(pbuf (and mime::article/preview-buffer
- (get-buffer mime::article/preview-buffer)))
- (pwin (and pbuf (vm-get-visible-buffer-window pbuf))))
- (if pwin
+ ; is there a preview buffer alive ?
+ (get-buffer mime::article/preview-buffer)
+ ; rebuild preview to ensure it
+ ; corresponds to the current message
+ (save-excursion
+ (save-selected-window
+ (save-window-excursion
+ (tm-vm/view-message))))
+ (get-buffer mime::article/preview-buffer))))
+ (if pbuf
(if running-xemacs
(let ((tmp (generate-new-buffer "tm-vm/tmp")))
(set-buffer pbuf)
(setq end (vm-marker
(+ start (length (buffer-string))) b)))
(save-restriction
- (widen)
+ (setq message (vm-real-message-of message))
+ (set-buffer (vm-buffer-of message))
+ (widen)
(append-to-buffer
b (vm-headers-of message) (vm-text-end-of message))
(setq end
(mail-yank-hooks (run-hooks 'mail-yank-hooks))
(t (vm-mail-yank-default message)))
))
+ (if tm-vm/yank:message-to-restore
+ (save-selected-window
+ (vm-goto-message tm-vm/yank:message-to-restore)
+ (setq tm-vm/yank:message-to-restore nil)))
))
\f
(let ((dir default-directory)
to cc subject mp in-reply-to references newsgroups)
(cond ((setq to
- (let ((reply-to (rfc822/get-field-body "Reply-To")))
+ (let ((reply-to (std11-field-body "Reply-To")))
(if (vm-ignored-reply-to reply-to)
nil
reply-to))))
- ((setq to (rfc822/get-field-body "From")))
+ ((setq to (std11-field-body "From")))
;; (t (error "No From: or Reply-To: header in message"))
)
(if to-all
- (setq cc (delq nil (cons cc (rfc822/get-field-bodies '("To" "Cc"))))
+ (setq cc (delq nil (cons cc (std11-field-bodies '("To" "Cc"))))
cc (mapconcat 'identity cc ","))
)
- (setq subject (rfc822/get-field-body "Subject"))
+ (setq subject (std11-field-body "Subject"))
(and subject vm-reply-subject-prefix
(let ((case-fold-search t))
(not
subject)
0)))
(setq subject (concat vm-reply-subject-prefix subject)))
- (setq in-reply-to (rfc822/get-field-body "Message-Id")
+ (setq in-reply-to (std11-field-body "Message-Id")
references (nconc
- (rfc822/get-field-bodies '("References" "In-Reply-To"))
+ (std11-field-bodies '("References" "In-Reply-To"))
(list in-reply-to))
newsgroups (list (or (and to-all
- (rfc822/get-field-body "Followup-To"))
- (rfc822/get-field-body "Newsgroups"))))
+ (std11-field-body "Followup-To"))
+ (std11-field-body "Newsgroups"))))
(setq to (vm-parse-addresses to)
cc (vm-parse-addresses cc))
(if vm-reply-ignored-addresses
(vm-mail-internal
(if to
(format "reply to %s%s"
- (rfc822/full-name-string
- (car (rfc822/parse-address
- (rfc822/lexical-analyze to))))
- (if cc ", ..." "")))
+ (std11-full-name-string
+ (car (std11-parse-address-string to)))
+ (if cc ", ..." "")))
to subject in-reply-to cc references newsgroups)
(setq mail-reply-buffer buf
;; vm-system-state 'replying
(autoload 'tm-mail/insert-message "tm-mail")
(set-alist 'mime-editor/message-inserter-alist
'mail-mode (function tm-mail/insert-message))
+ (set-alist 'mime-editor/split-message-sender-alist
+ 'mail-mode (function
+ (lambda ()
+ (interactive)
+ (sendmail-send-it)
+ )))
(if (and (string-match "XEmacs\\|Lucid" emacs-version)
tm-vm/use-xemacs-popup-menu)
(add-hook 'vm-mail-mode-hook 'mime-editor/attach-to-vm-mode-menu)