;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;;; modified by OKABE Yasuo <okabe@kudpc.kyoto-u.ac.jp>
;;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;;; and KOBAYASHI Shuhei <shuhei-k@jaist.ac.jp>
;;; Created: 1993/11/20 (merged tm-gnus5.el)
-;;; Version: $Revision: 7.19 $
+;;; Version: $Revision: 7.20 $
;;; Keywords: news, MIME, multimedia, multilingual, encoded-word
;;;
;;; This file is part of tm (Tools for MIME).
;;;
(defconst tm-gnus/RCS-ID
- "$Id: tm-gnus4.el,v 7.19 1996/06/06 16:43:42 shuhei-k Exp $")
+ "$Id: tm-gnus4.el,v 7.20 1996/06/09 06:53:41 morioka Exp $")
(defconst tm-gnus/version
(concat (get-version-string tm-gnus/RCS-ID) " for 3.15 .. 5.1.*"))
'tm-edit
(function
(lambda ()
- (set-alist
- 'mime-editor/message-inserter-alist
- 'news-reply-mode (function tm-gnus/insert-article))
+ (set-alist 'mime-editor/message-inserter-alist
+ 'news-reply-mode (function tm-gnus/insert-article))
(autoload 'tm-mail/insert-message "tm-mail")
(set-alist 'mime-editor/message-inserter-alist
(if (string-match "XEmacs\\|Lucid" emacs-version)
(add-hook 'news-setup-hook 'mime-editor/attach-to-news-reply-menu)
)
+
+ (set-alist 'mime-editor/split-message-sender-alist
+ 'news-reply-mode
+ (function gnus-inews-news))
)))
;;; MORIOKA Tomohiko <morioka@jaist.ac.jp>
;;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;;; Created: 1994/08/21 renamed from mime.el
-;;; Version: $Revision: 7.66 $
+;;; Version: $Revision: 7.67 $
;;; Keywords: mail, news, MIME, multimedia, multilingual
;;;
;;; This file is part of tm (Tools for MIME).
;;;
(defconst mime-editor/RCS-ID
- "$Id: tm-edit.el,v 7.66 1996/05/28 03:06:10 morioka Exp $")
+ "$Id: tm-edit.el,v 7.67 1996/06/09 07:03:58 morioka Exp $")
(defconst mime-editor/version (get-version-string mime-editor/RCS-ID))
(defvar mime-editor/split-blind-field-regexp
"\\(^[BDFbdf]cc:\\|^cc:[ \t]*$\\)")
-(defvar mime-editor/message-default-sender-alist
- '((mail-mode . mail-send-and-exit)
- (mh-letter-mode . mh-send-letter)
- (news-reply-mode . gnus-inews-news)
- ))
-
(defvar mime-editor/split-message-sender-alist
'((mail-mode
. (lambda ()
))
))
-(defvar mime-editor/window-config-alist
- '((mail-mode . nil)
- (mh-letter-mode . mh-previous-window-config)
- (news-reply-mode . (cond ((boundp 'gnus-winconf-post-news)
- (prog1
- gnus-winconf-post-news
- (setq gnus-winconf-post-news nil)
- ))
- ((boundp 'gnus-prev-winconf)
- (prog1
- gnus-prev-winconf
- (setq gnus-prev-winconf nil)
- ))
- ))
- ))
-
(defvar mime-editor/news-reply-mode-server-running nil)
(make-temp-name
(expand-file-name "tm-draft" mime/tmp-dir))))
(separator mail-header-separator)
- (config
- (eval (cdr (assq major-mode mime-editor/window-config-alist))))
(id (concat "\""
(replace-space-with-underline (current-time-string))
"@" (system-name) "\"")))
(run-hooks 'mime-editor/before-split-hook)
- (let* ((header (rfc822/get-header-string-except
- mime-editor/split-ignored-field-regexp separator))
- (subject (mail-fetch-field "subject"))
- (total (+ (/ lines mime-editor/message-max-length)
- (if (> (mod lines mime-editor/message-max-length) 0)
- 1)))
- (the-buf (current-buffer))
- (buf (get-buffer "*tmp-send*"))
- (command
- (or cmd
- (cdr
- (assq major-mode
- mime-editor/split-message-sender-alist))
- (cdr
- (assq major-mode
- mime-editor/message-default-sender-alist))
- ))
- data)
- (goto-char (point-min))
- (if (re-search-forward (concat "^" (regexp-quote separator) "$")
- nil t)
- (replace-match "")
- )
- (if buf
- (progn
- (switch-to-buffer buf)
- (erase-buffer)
- (switch-to-buffer the-buf)
- )
- (setq buf (get-buffer-create "*tmp-send*"))
- )
- (switch-to-buffer buf)
- (make-local-variable 'mail-header-separator)
- (setq mail-header-separator separator)
- (switch-to-buffer the-buf)
- (goto-char (point-min))
- (re-search-forward "^$" nil t)
- (let ((mime-editor/partial-number 1))
- (setq data (buffer-substring
- (point-min)
- (progn
- (goto-line mime-editor/message-max-length)
- (point))
- ))
- (delete-region (point-min)(point))
- (switch-to-buffer buf)
- (mime-editor/insert-partial-header
- header subject id mime-editor/partial-number total separator)
- (insert data)
- (save-excursion
- (save-restriction
- (goto-char (point-min))
- (search-forward (concat "\n" mail-header-separator "\n"))
- (narrow-to-region
- (match-end 0)
- (if (re-search-forward "^$" nil t)
- (match-beginning 0)
- (point-max)
+ (let ((the-buf (current-buffer))
+ (copy-buf (get-buffer-create " *Original Message*"))
+ (header (rfc822/get-header-string-except
+ mime-editor/split-ignored-field-regexp separator))
+ (subject (mail-fetch-field "subject"))
+ (total (+ (/ lines mime-editor/message-max-length)
+ (if (> (mod lines mime-editor/message-max-length) 0)
+ 1)))
+ (command
+ (or cmd
+ (cdr
+ (assq major-mode
+ mime-editor/split-message-sender-alist))
))
- (goto-char (point-min))
- (while (re-search-forward
- mime-editor/split-blind-field-regexp nil t)
- (delete-region (match-beginning 0)
- (let ((e (rfc822/field-end)))
- (if (< e (point-max))
- (1+ e)
- e)))
- )
- ))
- (save-excursion
- (message (format "Sending %d/%d..."
- mime-editor/partial-number total))
- (call-interactively command)
- (message (format "Sending %d/%d... done"
- mime-editor/partial-number total))
- )
+ (mime-editor/partial-number 1)
+ data)
+ (save-excursion
+ (set-buffer copy-buf)
(erase-buffer)
- (switch-to-buffer the-buf)
- (setq mime-editor/partial-number 2)
- (while (< mime-editor/partial-number total)
+ (insert-buffer the-buf)
+ (save-restriction
+ (if (re-search-forward
+ (concat "^" (regexp-quote separator) "$") nil t)
+ (let ((he (match-beginning 0)))
+ (replace-match "")
+ (narrow-to-region (point-min) he)
+ ))
+ (goto-char (point-min))
+ (while (re-search-forward mime-editor/split-blind-field-regexp nil t)
+ (delete-region (match-beginning 0)
+ (1+ (rfc822/field-end)))
+ )))
+ (while (< mime-editor/partial-number total)
+ (erase-buffer)
+ (save-excursion
+ (set-buffer copy-buf)
(setq data (buffer-substring
(point-min)
(progn
(point))
))
(delete-region (point-min)(point))
- (switch-to-buffer buf)
- (mime-editor/insert-partial-header
- header subject id mime-editor/partial-number total separator)
- (insert data)
- (save-excursion
- (message (format "Sending %d/%d..."
- mime-editor/partial-number total))
- (call-interactively command)
- (message (format "Sending %d/%d... done"
- mime-editor/partial-number total))
- )
- (erase-buffer)
- (switch-to-buffer the-buf)
- (setq mime-editor/partial-number
- (1+ mime-editor/partial-number))
)
- (goto-char (point-min))
(mime-editor/insert-partial-header
header subject id mime-editor/partial-number total separator)
+ (insert data)
+ (save-excursion
+ (message (format "Sending %d/%d..."
+ mime-editor/partial-number total))
+ (call-interactively command)
+ (message (format "Sending %d/%d... done"
+ mime-editor/partial-number total))
+ )
+ (setq mime-editor/partial-number
+ (1+ mime-editor/partial-number))
+ )
+ (erase-buffer)
+ (save-excursion
+ (set-buffer copy-buf)
+ (setq data (buffer-string))
+ (erase-buffer)
+ )
+ (mime-editor/insert-partial-header
+ header subject id mime-editor/partial-number total separator)
+ (insert data)
+ (save-excursion
(message (format "Sending %d/%d..."
mime-editor/partial-number total))
- ))))
+ (message (format "Sending %d/%d... done"
+ mime-editor/partial-number total))
+ )
+ )))
(defun mime-editor/maybe-split-and-send (&optional cmd)
(interactive)