Gnus development mailing list
 help / color / mirror / Atom feed
* gnus-delay-send-queue should not run message-send-hook
@ 2014-05-27 12:11 Peter Münster
  2014-06-10 11:37 ` Peter Münster
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Münster @ 2014-05-27 12:11 UTC (permalink / raw)
  To: ding

Hi,

IMO, `gnus-delay-send-queue' should not run `message-send-hook,' because
`gnus-delay-article' does it already, and sometimes, there can be
interactive commands in this hook, that needs user interaction.

Do you agree? And if yes, what could be done to suppress the second
execution of `message-send-hook'?

TIA for any hints,
-- 
           Peter




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

* Re: gnus-delay-send-queue should not run message-send-hook
  2014-05-27 12:11 gnus-delay-send-queue should not run message-send-hook Peter Münster
@ 2014-06-10 11:37 ` Peter Münster
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Münster @ 2014-06-10 11:37 UTC (permalink / raw)
  To: ding

On Tue, May 27 2014, Peter Münster wrote:

> IMO, `gnus-delay-send-queue' should not run `message-send-hook,' because
> `gnus-delay-article' does it already, and sometimes, there can be
> interactive commands in this hook, that needs user interaction.
>
> Do you agree? And if yes, what could be done to suppress the second
> execution of `message-send-hook'?

Hi,

Since there is no feedback, I'm looking for a workaround:

--8<---------------cut here---------------start------------->8---
(defun pm/message-send ()
  (unless (message-field-value gnus-delay-header)
    (do-interactive-things-like-spell-checking)))
(add-hook 'message-send-hook 'pm/message-send)
--8<---------------cut here---------------end--------------->8---

But this does not work, because the `gnus-delay-header' is removed just
before this function. Could you please make use of the `append' argument
to `add-hook' in function `gnus-delay-send-queue' (line 156 in
gnus-delay.el), like this:

--8<---------------cut here---------------start------------->8---
      (when (gnus-group-entry group)
	(gnus-activate-group group)
	(add-hook 'message-send-hook
		  (lambda () (message-remove-header gnus-delay-header)) t)
	(setq articles (nndraft-articles))
--8<---------------cut here---------------end--------------->8---

Then, there would be no more problem.

TIA,
-- 
           Peter




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

end of thread, other threads:[~2014-06-10 11:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-27 12:11 gnus-delay-send-queue should not run message-send-hook Peter Münster
2014-06-10 11:37 ` Peter Münster

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