From: morioka Date: Sat, 3 Oct 1998 02:05:18 +0000 (+0000) Subject: (gnus-draft-edit-message): Use `gnus-draft-setup-for-editing' instead X-Git-Tag: chaotzu-gnus-base~14 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=87ddedae00cb2b069911d8ad945f341360f48cb0;p=elisp%2Fgnus.git- (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. --- 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."