Gnus development mailing list
 help / color / mirror / Atom feed
From: Gaute B Strokkenes <gs234@cam.ac.uk>
Subject: Re: Gnus Agent and mail
Date: Wed, 14 May 2003 12:07:30 +0100	[thread overview]
Message-ID: <87issdyefh.fsf@cam.ac.uk> (raw)
In-Reply-To: <87smrj52c3.fsf@cam.ac.uk> (Gaute B. Strokkenes's message of "Mon, 12 May 2003 21:37:00 +0100")

[-- Attachment #1: Type: text/plain, Size: 884 bytes --]

On 12 mai 2003, gs234@cam.ac.uk wrote:
>I was slightly unsure about passing "nndraft:queue" down to
>gnus-draft-send.  The reason for this is that gnus-draft-send seems
>to use this argument in non-obvious ways to set several
>message-related variables.  However it already special-cases
>"nndraft:queue" and I made sure the behaviour is not actually
>changed.
>
>I haven't implemented a butt-saver for Kai, though.  I'll have to
>find out how...

Now done.

2003-05-12  Gaute B Strokkenes <gs234@srcf.ucam.org>

	* gnus-agent.el (gnus-agent-queue-mail,
	gnus-agent-prompt-send-queue): New variables.
	(gnus-agent-send-mail): Use gnus-agent-queue-mail.

	* gnus-draft.el (gnus-group-send-queue): Pass the group name
	"nndraft:queue" along to gnus-draft-send.  Use
	gnus-agent-prompt-send-queue.
	(gnus-draft-send): Rebind gnus-agent-queue-mail to nil when
	group is "nndraft:queue".


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gaqm.diff --]
[-- Type: text/x-patch, Size: 3492 bytes --]

Index: lisp/gnus-agent.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-agent.el,v
retrieving revision 6.173
diff -u -r6.173 gnus-agent.el
--- lisp/gnus-agent.el	14 May 2003 04:34:37 -0000	6.173
+++ lisp/gnus-agent.el	14 May 2003 11:08:32 -0000
@@ -174,6 +174,21 @@
 \(gnus-agent-directory) for groups that are no longer agentized.  When
 found, offer to remove them.")
 
+(defcustom gnus-agent-queue-mail t
+  "Whether and when outgoing mail should be queued by the agent.  When
+`always', always queue outgoing mail.  When `nil', never queue.
+Otherwise, queue if and only if unplugged."
+  :group 'gnus-agent
+  :type '(radio (const :format "Always" always)
+		(const :format "Never" nil)
+		(const :format "When plugged" t)))
+
+(defcustom gnus-agent-prompt-send-queue nil
+  "If non-nil, `gnus-group-send-queue' will prompt if called when
+unplugged."
+  :group 'gnus-agent
+  :type 'boolean)
+
 ;;; Internal variables
 
 (defvar gnus-agent-history-buffers nil)
@@ -625,7 +640,8 @@
      'gnus-dummy '((gnus-draft-mode)))))
 
 (defun gnus-agent-send-mail ()
-  (if gnus-plugged
+  (if (or (not gnus-agent-queue-mail)
+	  (and gnus-plugged (not (eq gnus-agent-queue-mail 'always))))
       (funcall gnus-agent-send-mail-function)
     (goto-char (point-min))
     (re-search-forward
Index: lisp/gnus-draft.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-draft.el,v
retrieving revision 6.21
diff -u -r6.21 gnus-draft.el
--- lisp/gnus-draft.el	12 Apr 2003 23:09:52 -0000	6.21
+++ lisp/gnus-draft.el	14 May 2003 11:08:32 -0000
@@ -141,6 +141,9 @@
 				message-send-hook))
 	(message-setup-hook (and group (not (equal group "nndraft:queue"))
 				 message-setup-hook))
+	(gnus-agent-queue-mail (if (equal group "nndraft:queue")
+				   nil
+				 gnus-agent-queue-mail))
 	type method move-to)
     (gnus-draft-setup article (or group "nndraft:queue"))
     ;; We read the meta-information that says how and where
@@ -191,22 +194,25 @@
 (defun gnus-group-send-queue ()
   "Send all sendable articles from the queue group."
   (interactive)
-  (gnus-activate-group "nndraft:queue")
-  (save-excursion
-    (let* ((articles (nndraft-articles))
-	   (unsendable (gnus-uncompress-range
-			(cdr (assq 'unsend
-				   (gnus-info-marks
-				    (gnus-get-info "nndraft:queue"))))))
-	   (gnus-posting-styles nil)
-	   (total (length articles))
-	   article)
-      (while (setq article (pop articles))
-	(unless (memq article unsendable)
-	  (let ((message-sending-message
-		 (format "Sending message %d of %d..."
-			 (- total (length articles)) total)))
-	    (gnus-draft-send article)))))))
+  (when (or gnus-plugged
+	    (not gnus-agent-prompt-send-queue)
+	    (gnus-y-or-n-p "Gnus is unplugged; really send queue? "))
+    (gnus-activate-group "nndraft:queue")
+    (save-excursion
+      (let* ((articles (nndraft-articles))
+	     (unsendable (gnus-uncompress-range
+			  (cdr (assq 'unsend
+				     (gnus-info-marks
+				      (gnus-get-info "nndraft:queue"))))))
+	     (gnus-posting-styles nil)
+	     (total (length articles))
+	     article)
+	(while (setq article (pop articles))
+	  (unless (memq article unsendable)
+	    (let ((message-sending-message
+		   (format "Sending message %d of %d..."
+			   (- total (length articles)) total)))
+	      (gnus-draft-send article "nndraft:queue"))))))))
 
 ;;;###autoload
 (defun gnus-draft-reminder ()

[-- Attachment #3: Type: text/plain, Size: 111 bytes --]

-- 
Big Gaute                               http://www.srcf.ucam.org/~gs234/
My LESLIE GORE record is BROKEN..

  reply	other threads:[~2003-05-14 11:07 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-24  8:33 Sean Neakums
2003-01-24 12:52 ` Kai Großjohann
2003-01-24 13:49   ` Sean Neakums
2003-01-24 22:00     ` Lars Magne Ingebrigtsen
2003-04-13 21:10 ` Kevin Greiner
2003-04-13 21:18   ` Sean Neakums
2003-04-13 23:32     ` Kevin Greiner
2003-04-14  6:15   ` Kai Großjohann
2003-04-18  6:31     ` Gaute B Strokkenes
2003-04-29  5:40       ` Kevin Greiner
2003-04-29 15:28         ` Kai Großjohann
2003-04-30  2:12           ` Kevin Greiner
2003-05-01 10:57             ` Kai Großjohann
2003-05-08 23:36         ` Gaute B Strokkenes
2003-05-10 14:43           ` Kevin Greiner
2003-05-10 16:08             ` Gaute B Strokkenes
2003-05-10 22:21               ` Gaute B Strokkenes
2003-05-11 23:20                 ` Kevin Greiner
2003-05-12  5:52                   ` Gaute B Strokkenes
2003-05-12 13:47                     ` Kevin Greiner
2003-05-12 18:46                       ` Gaute B Strokkenes
2003-05-12 20:37                         ` Gaute B Strokkenes
2003-05-14 11:07                           ` Gaute B Strokkenes [this message]
2003-05-14 17:15                             ` Kevin Greiner
2003-05-14 20:15                               ` Gaute B Strokkenes
2003-05-15  8:15                                 ` Gaute B Strokkenes
2003-05-12 15:51                     ` Kai Großjohann
2003-05-12 18:49                       ` Gaute B Strokkenes
2003-05-13 12:31                         ` Kai Großjohann
2003-05-10 17:35             ` Kai Großjohann
2003-05-10 20:54               ` Gaute B Strokkenes
2003-05-12 15:49                 ` Kai Großjohann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87issdyefh.fsf@cam.ac.uk \
    --to=gs234@cam.ac.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).