X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fgnus-draft.el;h=678f6d9c9ece51586d7c2b9a624e8980ecd82d9b;hb=f9c8170d647a9e61dd1d8bb7c4f7d4d8c6721280;hp=8ecbf1fcbf3dac2381afc12dfbdbf1cf971722bd;hpb=dc9b03604a47bf5d66e2a5819ad562927c251acc;p=elisp%2Fgnus.git- diff --git a/lisp/gnus-draft.el b/lisp/gnus-draft.el index 8ecbf1f..678f6d9 100644 --- a/lisp/gnus-draft.el +++ b/lisp/gnus-draft.el @@ -1,7 +1,7 @@ ;;; gnus-draft.el --- draft message support for Gnus -;; Copyright (C) 1997,98 Free Software Foundation, Inc. +;; Copyright (C) 1997,98,99 Free Software Foundation, Inc. -;; Author: Lars Magne Ingebrigtgnus-run-hooks +;; Author: Lars Magne Ingebrigtsen ;; Keywords: news ;; This file is part of GNU Emacs. @@ -95,6 +95,10 @@ (let ((article (gnus-summary-article-number))) (gnus-summary-mark-as-read article gnus-canceled-mark) (gnus-draft-setup article gnus-newsgroup-name) + (set-buffer-modified-p t) + (save-buffer) + (let ((gnus-verbose-backends nil)) + (gnus-request-expire-articles (list article) gnus-newsgroup-name t)) (push `((lambda () (when (gnus-buffer-exists-p ,gnus-summary-buffer) @@ -111,13 +115,15 @@ (while (setq article (pop articles)) (gnus-summary-remove-process-mark article) (unless (memq article gnus-newsgroup-unsendable) - (gnus-draft-send article gnus-newsgroup-name) + (gnus-draft-send article gnus-newsgroup-name t) (gnus-summary-mark-article article gnus-canceled-mark))))) -(defun gnus-draft-send (article &optional group) +(defun gnus-draft-send (article &optional group interactive) "Send message ARTICLE." (gnus-draft-setup article (or group "nndraft:queue")) - (let ((message-syntax-checks 'dont-check-for-anything-just-trust-me) + (let ((message-syntax-checks (if interactive nil + 'dont-check-for-anything-just-trust-me)) + (messgage-inhibit-body-encoding t) message-send-hook type method) ;; We read the meta-information that says how and where ;; this message is to be sent. @@ -131,13 +137,19 @@ (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. - (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 (and (or (null method) + (gnus-server-opened method) + (gnus-open-server method)) + (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))) + (let ((gnus-verbose-backends nil)) + (gnus-request-expire-articles + (list article) (or group "nndraft:queue") t))))) (defun gnus-draft-send-all-messages () "Send all the sendable drafts."