Gnus development mailing list
 help / color / mirror / Atom feed
* message-setup-hook called when sending from queue?
@ 2000-04-26  7:41 Pavel Janík ml.
  2000-04-26  8:20 ` Shenghuo ZHU
  0 siblings, 1 reply; 5+ messages in thread
From: Pavel Janík ml. @ 2000-04-26  7:41 UTC (permalink / raw)


Hi,

I have a 'fix' for the bug I reported earlier. When you have a message in the
queue and you are going to send it, the message-setup-hook is called. But it
should not be, because you have already the message prepared.

The fix Lars commited was to add 

 (message-setup-hook nil)

to let in gnus-draft-send. But this does not fix this behaviour. The place
where it fixes my problem is in gnus-draft-setup before
gnus-setup-message. But this is probably not good place, because this function
is called also for gnus-draft-edit-message and others where the hook should be
called. This should be fixed...

BTW - there is misplaced comment in gnus-draft.el:

          ;; Insert the separator.
...
-- 
Pavel Janík ml.
Pavel.Janik@inet.cz



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: message-setup-hook called when sending from queue?
  2000-04-26  7:41 message-setup-hook called when sending from queue? Pavel Janík ml.
@ 2000-04-26  8:20 ` Shenghuo ZHU
  2000-04-26 15:32   ` Pavel Janík ml.
  0 siblings, 1 reply; 5+ messages in thread
From: Shenghuo ZHU @ 2000-04-26  8:20 UTC (permalink / raw)


>>>>> "Pavel" == Pavel Janík ml <Pavel.Janik@inet.cz> writes:

Pavel> Hi,

Pavel> I have a 'fix' for the bug I reported earlier. When you have a
Pavel> message in the queue and you are going to send it, the
Pavel> message-setup-hook is called. But it should not be, because you
Pavel> have already the message prepared.

Pavel> The fix Lars commited was to add 

Pavel>  (message-setup-hook nil)

Pavel> to let in gnus-draft-send. But this does not fix this
Pavel> behaviour. The place where it fixes my problem is in
Pavel> gnus-draft-setup before gnus-setup-message. But this is
Pavel> probably not good place, because this function is called also
Pavel> for gnus-draft-edit-message and others where the hook should be
Pavel> called. This should be fixed...

Pavel> BTW - there is misplaced comment in gnus-draft.el:

Pavel>           ;; Insert the separator.
Pavel> ...

In the latest CVS version, I believe I have fixed the gnus-draft-setup
bug. Please test it.

-- 
Shenghuo



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: message-setup-hook called when sending from queue?
  2000-04-26  8:20 ` Shenghuo ZHU
@ 2000-04-26 15:32   ` Pavel Janík ml.
  2000-04-26 16:37     ` Shenghuo ZHU
  0 siblings, 1 reply; 5+ messages in thread
From: Pavel Janík ml. @ 2000-04-26 15:32 UTC (permalink / raw)
  Cc: ding

   From: Shenghuo ZHU <zsh@cs.rochester.edu>
   Date: 26 Apr 2000 04:20:05 -0400

Hi,

   > Pavel> BTW - there is misplaced comment in gnus-draft.el:
   > 
   > Pavel>           ;; Insert the separator.
   > Pavel> ...
   > 
   > In the latest CVS version, I believe I have fixed the gnus-draft-setup
   > bug. Please test it.

I have CVS from about an hour ago and still nothing... This is the fix I'm
using now:

--- gnus-draft.el.orig	Wed Apr 26 17:24:32 2000
+++ gnus-draft.el	Wed Apr 26 17:27:48 2000
@@ -188,21 +188,22 @@
 
 (progn
   (defun gnus-draft-setup (narticle group &optional restore)
-    (gnus-setup-message 'forward
+    (let ((message-setup-hook nil))
+     (gnus-setup-message 'forward
       (let ((article narticle))
 	(message-mail)
 	(erase-buffer)
 	(if (not (gnus-request-restore-buffer article group))
 	    (error "Couldn't restore the article")
-	  ;; Insert the separator.
 	  (if (and restore (equal group "nndraft:queue"))
 	      (mime-to-mml))
+	  ;; Insert the separator.
 	  (goto-char (point-min))
 	  (search-forward "\n\n")
 	  (forward-char -1)
 	  (insert mail-header-separator)
 	  (forward-line 1)
-	  (message-set-auto-save-file-name))))))
+	  (message-set-auto-save-file-name)))))))
 
 (defun gnus-draft-article-sendable-p (article)
   "Say whether ARTICLE is sendable."

BTW - Please move the comment ;; Insert the separator lower where it belongs
as in this patch.
-- 
Pavel Janík ml.
Pavel.Janik@inet.cz



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: message-setup-hook called when sending from queue?
  2000-04-26 15:32   ` Pavel Janík ml.
@ 2000-04-26 16:37     ` Shenghuo ZHU
  2000-04-26 20:54       ` Pavel Janík ml.
  0 siblings, 1 reply; 5+ messages in thread
From: Shenghuo ZHU @ 2000-04-26 16:37 UTC (permalink / raw)


>>>>> "Pavel" == Pavel Janík ml <Pavel.Janik@inet.cz> writes:


Pavel> I have CVS from about an hour ago and still nothing... This is
Pavel> the fix I'm using now:

Pavel> --- gnus-draft.el.orig	Wed Apr 26 17:24:32 2000
Pavel> +++ gnus-draft.el	Wed Apr 26 17:27:48 2000
Pavel> @@ -188,21 +188,22 @@
 
Pavel>  (progn
Pavel>    (defun gnus-draft-setup (narticle group &optional restore)
Pavel> -    (gnus-setup-message 'forward
Pavel> +    (let ((message-setup-hook nil))
Pavel> +     (gnus-setup-message 'forward

This is not good. message-setup-hook is should be set to nil only if
it is in nndraft:queue group and going to be sent.

Now I fixed it in draft-send.

Pavel>        (let ((article narticle))
Pavel>  	(message-mail)
Pavel>  	(erase-buffer)
Pavel>  	(if (not (gnus-request-restore-buffer article group))
Pavel>  	    (error "Couldn't restore the article")
Pavel> -	  ;; Insert the separator.
Pavel>  	  (if (and restore (equal group "nndraft:queue"))
Pavel>  	      (mime-to-mml))

This will make sure that a queued message will not be restored to mml
when it is going to be sent.

Pavel> +	  ;; Insert the separator.

The comment is moved. Thank you.

Pavel>  	  (goto-char (point-min))
Pavel>  	  (search-forward "\n\n")
Pavel>  	  (forward-char -1)
Pavel>  	  (insert mail-header-separator)
Pavel>  	  (forward-line 1)
Pavel> -	  (message-set-auto-save-file-name))))))
Pavel> +	  (message-set-auto-save-file-name)))))))
 

-- 
Shenghuo



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: message-setup-hook called when sending from queue?
  2000-04-26 16:37     ` Shenghuo ZHU
@ 2000-04-26 20:54       ` Pavel Janík ml.
  0 siblings, 0 replies; 5+ messages in thread
From: Pavel Janík ml. @ 2000-04-26 20:54 UTC (permalink / raw)
  Cc: ding

   From: Shenghuo ZHU <zsh@cs.rochester.edu>
   Date: 26 Apr 2000 12:37:26 -0400

Hi,


[...]

   > This is not good. message-setup-hook is should be set to nil only if
   > it is in nndraft:queue group and going to be sent.
   > 
   > Now I fixed it in draft-send.

yes, it works perfectly. Thank you.
-- 
Pavel Janík ml.
Pavel.Janik@inet.cz



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2000-04-26 20:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-04-26  7:41 message-setup-hook called when sending from queue? Pavel Janík ml.
2000-04-26  8:20 ` Shenghuo ZHU
2000-04-26 15:32   ` Pavel Janík ml.
2000-04-26 16:37     ` Shenghuo ZHU
2000-04-26 20:54       ` Pavel Janík ml.

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).