From 87ddedae00cb2b069911d8ad945f341360f48cb0 Mon Sep 17 00:00:00 2001 From: morioka Date: Sat, 3 Oct 1998 02:05:18 +0000 Subject: [PATCH] (gnus-draft-edit-message): Use `gnus-draft-setup-for-editing' instead of `gnus-draft-setup'. (gnus-draft-send): Use `gnus-draft-setup-for-sending' instead of `gnus-draft-setup'; call `message-send-news-function' or `message-send-mail-function' instead of `message-send-and-exit'. (gnus-draft-setup-for-editing): New function (renamed from `gnus-draft-setup'). (gnus-draft-send-draft-buffer): New variable. (gnus-draft-setup-for-sending): New function. --- lisp/gnus-draft.el | 46 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 10 deletions(-) diff --git a/lisp/gnus-draft.el b/lisp/gnus-draft.el index 7a3ca8a..7d6db4f 100644 --- a/lisp/gnus-draft.el +++ b/lisp/gnus-draft.el @@ -3,6 +3,7 @@ ;; Author: Lars Magne Ingebrigtsen ;; MORIOKA Tomohiko +;; Tatsuya Ichikawa ;; Keywords: mail, news, MIME, offline ;; This file is part of GNU Emacs. @@ -95,7 +96,7 @@ (interactive) (let ((article (gnus-summary-article-number))) (gnus-summary-mark-as-read article gnus-canceled-mark) - (gnus-draft-setup article gnus-newsgroup-name) + (gnus-draft-setup-for-editing article gnus-newsgroup-name) (set-buffer-modified-p t) (save-buffer) (push @@ -119,7 +120,7 @@ (defun gnus-draft-send (article &optional group) "Send message ARTICLE." - (gnus-draft-setup article (or group "nndraft:queue")) + (gnus-draft-setup-for-sending article (or group "nndraft:queue")) (let ((message-syntax-checks 'dont-check-for-anything-just-trust-me) message-send-hook type method) ;; We read the meta-information that says how and where @@ -134,13 +135,25 @@ (message-remove-header gnus-agent-meta-information-header))) ;; Then we send it. If we have no meta-information, we just send ;; it and let Message figure out how. - (when (if type - (let ((message-this-is-news (eq type 'news)) - (message-this-is-mail (eq type 'mail)) - (gnus-post-method method) - (message-post-method method)) - (message-send-and-exit)) - (message-send-and-exit)) + (when (let ((mail-header-separator "")) + (cond ((eq type 'news) + (mime-edit-maybe-split-and-send + (function + (lambda () + (interactive) + (funcall message-send-news-function method) + ))) + (funcall message-send-news-function method) + ) + ((eq type 'mail) + (mime-edit-maybe-split-and-send + (function + (lambda () + (interactive) + (funcall message-send-mail-function) + ))) + (funcall message-send-mail-function) + t))) (let ((gnus-verbose-backends nil)) (gnus-request-expire-articles (list article) (or group "nndraft:queue") t))))) @@ -184,7 +197,7 @@ ;;;!!!but for the time being, we'll just run this tiny function uncompiled. (progn -(defun gnus-draft-setup (narticle group) +(defun gnus-draft-setup-for-editing (narticle group) (gnus-setup-message 'forward (let ((article narticle)) (message-mail) @@ -199,6 +212,19 @@ (insert mail-header-separator) (forward-line 1) (message-set-auto-save-file-name)))))) +;; +(defvar gnus-draft-send-draft-buffer " *send draft*") +(progn +(defun gnus-draft-setup-for-sending (narticle group) + (let ((article narticle)) + (if (not (get-buffer gnus-draft-send-draft-buffer)) + (get-buffer-create gnus-draft-send-draft-buffer)) + (set-buffer gnus-draft-send-draft-buffer) + (erase-buffer) + (if (not (gnus-request-restore-buffer article group)) + (error "Couldn't restore the article") + )))) +;; For draft TEST (defun gnus-draft-article-sendable-p (article) "Say whether ARTICLE is sendable." -- 1.7.10.4