From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/52568 Path: main.gmane.org!not-for-mail From: Gaute B Strokkenes Newsgroups: gmane.emacs.gnus.general Subject: Re: Gnus Agent and mail Date: Mon, 12 May 2003 21:37:00 +0100 Organization: The Church of Emacs Sender: ding-owner@lists.math.uh.edu Message-ID: <87smrj52c3.fsf@cam.ac.uk> References: <6uiswfhrqs.fsf@zork.zork.net> <8465phob8k.fsf@lucy.is.informatik.uni-duisburg.de> <87d6jk1flj.fsf@cam.ac.uk> <87llxhm2ol.fsf@cam.ac.uk> <87fznmhjih.fsf@cam.ac.uk> <87k7cytpco.fsf@cam.ac.uk> <87fznkg19m.fsf@cam.ac.uk> <878ytcc8aj.fsf@cam.ac.uk> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1052771822 5773 80.91.224.249 (12 May 2003 20:37:02 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 12 May 2003 20:37:02 +0000 (UTC) Original-X-From: ding-owner+M1112@lists.math.uh.edu Mon May 12 22:36:56 2003 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19FK2Z-0001UG-00 for ; Mon, 12 May 2003 22:36:55 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 19FK3v-0004O7-00; Mon, 12 May 2003 15:38:19 -0500 Original-Received: from sclp3.sclp.com ([64.157.176.121]) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 19FK3p-0004O2-00 for ding@lists.math.uh.edu; Mon, 12 May 2003 15:38:13 -0500 Original-Received: (qmail 72028 invoked by alias); 12 May 2003 20:38:13 -0000 Original-Received: (qmail 72023 invoked from network); 12 May 2003 20:38:13 -0000 Original-Received: from mta03-svc.ntlworld.com (62.253.162.43) by sclp3.sclp.com with SMTP; 12 May 2003 20:38:13 -0000 Original-Received: from belldandy ([81.100.93.186]) by mta03-svc.ntlworld.com (InterMail vM.4.01.03.37 201-229-121-137-20020806) with ESMTP id <20030512203811.JOOB11246.mta03-svc.ntlworld.com@belldandy> for ; Mon, 12 May 2003 21:38:11 +0100 Original-Received: from gs234 by belldandy with local (Exim 3.35 #1 (Debian)) id 19FK2l-0002Th-00 for ; Mon, 12 May 2003 21:37:07 +0100 Mail-Copies-To: never Original-To: ding@gnus.org Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAG1BMVEWWWBTly7aGMwb+/vz9 +ffIilb///+yaCxNCwHGVC3gAAACU0lEQVR4nF2TQWvjMBBGVUGwj3WxaY/aAWNfi0zuwZPuHp0Q ob079OwYjHrsChb0s3dGctJ0ddTzm9F8lsR7WiNiWWL/flviul9Uh0NR4vY/gJUxJjOEtt/AubBy UsotRfH2DbxWE0hom3w5XJUEKis9hACt2hR4B86VDOtqTNHfgeEGvLiUN7Ddze26Dx6y1CUa+ygo NwFQm0N/BeMzCZAtNIoQrd9EhcH5mWpnztB8ZpJBlH23jaAbuE4EhZ2Bam0TeJ0DRMCKVP6CegWk q4z2TVFUx0946FOPcSe9ELE3rSHAj15rBuddS0C4BGyAutfpVAQkKdZOQiwMMIHxlUDrgeej5Ns7 I/ccSWNBLda1XwYBEG1Qswy1yXJf879nA4cjkNI0H+FzoUyuRodPA5eqZwFONG34i30ccOxeKFUy flNe1szqsgLdvXwKCj6zjTXODHV9M46gZPCLlYKCGTYO8S0aOAvJzRfD0w+1XcGIsxLUw/sYl5sM 9n0yjkoSUDOByrijwRRiAq13NhqLJYB3ACazrgN2bIwanyJQKXhHAJPRPQruEaCJP2Shy4DJ2As+ FQjJZH7AZIy6w0pQiiRYAh8nTEZHYDfRqSDeB5OXq4EEcAC4NocvoBl4+n1cyl54nyLRNA3iIwRP wNGFOK1g1Gz8jNfaCjdtqJLm2LXuqMc+50cDIJQpr6X0OHa4X58ULAw03QbRd7GUiG/K04mj0bNB xQhwJkEsJiZ1Bbgb6CnF79cBE+jwF91qniOCP3fghUFKxOShjIATw/wOfIQTg39LpFHtxhlKywAA AABJRU5ErkJggg== In-Reply-To: <878ytcc8aj.fsf@cam.ac.uk> (Gaute B. Strokkenes's message of "Mon, 12 May 2003 19:46:28 +0100") User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.2 (gnu/linux) Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:52568 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:52568 --=-=-= On 12 mai 2003, gs234@cam.ac.uk wrote: > On 12 mai 2003, kgreiner@xpediantsolutions.com wrote: > >Gaute B Strokkenes writes: > > > >>Then there would be no way to send mail without temporarily setting > >>gnus-agent-queue-mail to t or nil. > > > >That last part was what I was hoping to here. Wouldn't your patch > >work just as well if you bound gnus-agent-queue-mail to nil as your > >original bind of message-send-mail-real-function? > > You're quite right; that is a better way to do it. > > >>Hmm. Actually, is is possible to enter the queue group and send > >>messages with `D s' and `D S'. I need to take care of those cases > >>as well. > > > >Hmmm... I'm glad you thought of that now. > > I'll move the rebinding down to gnus-draft-send, suitably guarded. Here is an improved version: 2003-05-12 Gaute B Strokkenes * gnus-agent.el (gnus-agent-queue-mail): New variable. (gnus-agent-send-mail): Use it. * gnus-draft.el (gnus-group-send-queue): Pass the group name "nndraft:queue" along to gnus-draft-send. (gnus-draft-send): Rebind gnus-agent-queue-mail to nil when group is "nndraft:queue". 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... --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=gaqm.diff Index: lisp/gnus-agent.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/gnus-agent.el,v retrieving revision 6.172 diff -u -r6.172 gnus-agent.el --- lisp/gnus-agent.el 12 May 2003 18:43:29 -0000 6.172 +++ lisp/gnus-agent.el 12 May 2003 20:30:11 -0000 @@ -169,6 +169,15 @@ :type '(radio (const :format "Enable " ENABLE) (const :format "Disable " DISABLE))) +(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-expire-unagentized-dirs t "Have gnus-agent-expire scan the directories under \(gnus-agent-directory) for groups that are no longer agentized. When @@ -625,7 +634,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 12 May 2003 20:30:11 -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 @@ -206,7 +209,7 @@ (let ((message-sending-message (format "Sending message %d of %d..." (- total (length articles)) total))) - (gnus-draft-send article))))))) + (gnus-draft-send article "nndraft:queue"))))))) ;;;###autoload (defun gnus-draft-reminder () --=-=-= -- Gaute Strokkenes http://www.srcf.ucam.org/~gs234/ While I'm in LEVITTOWN I thought I'd like to see the NUCLEAR FAMILY!! --=-=-=--