From d79800074d63ff4242402ff7f7af7b2c9afdc6eb Mon Sep 17 00:00:00 2001 From: Alan Schmitt Date: Mon, 11 Aug 2014 16:01:06 +0200 Subject: [PATCH] Tell expiry-hook functions where the message is going * lisp/gnus-sum.el (gnus-summary-expire-articles): functions registered to the gnus-summary-article-expire-hook should be told where the function is going. In particular, the gnus registry might want to know. --- lisp/gnus-sum.el | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index c0e099b..d54fe91 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -10444,13 +10444,18 @@ This will be the case if the article has both been mailed and posted." (when (and (not (memq article es)) (gnus-data-find article)) (gnus-summary-mark-article article gnus-canceled-mark) - (run-hook-with-args 'gnus-summary-article-expire-hook - 'delete - (gnus-data-header - (assoc article (gnus-data-list nil))) - gnus-newsgroup-name - nil - nil))))))) + (run-hook-with-args + 'gnus-summary-article-expire-hook + 'delete + (gnus-data-header (assoc article (gnus-data-list nil))) + gnus-newsgroup-name + (cond + ((stringp nnmail-expiry-target) nnmail-expiry-target) + ((eq nnmail-expiry-target 'delete) nil) + (t + (let ((rescall (funcall nnmail-expiry-target gnus-newsgroup-name))) + (if (stringp rescall) rescall nil)))) + nil))))))) (gnus-message 6 "Expiring articles...done"))))) (defun gnus-summary-expire-articles-now () -- 2.0.3