Gnus development mailing list
 help / color / mirror / Atom feed
* [Patch] tell expiry-hook functions where expired messages are going
@ 2014-07-29  9:04 Eric Abrahamsen
  2014-08-06  8:06 ` Alan Schmitt
  0 siblings, 1 reply; 9+ messages in thread
From: Eric Abrahamsen @ 2014-07-29  9:04 UTC (permalink / raw)
  To: ding; +Cc: Lars Ingebrigtsen

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

This patch lets functions registered in the
`summary-article-expire-hook' know which group the expired articles are
going to. In particular this is useful for the registry: if people are
using expiration to move articles to a different group, rather than
deleting them, the registry should know where they've gone.

If nnmail-expiry-target is a function, this will still work, but not
quite as the docstring says: the hook function is given the from-group
as an argument, but is *not* called in a buffer narrowed to the message,
as it says. That would be hard to do, though, and this seems better than
nothing.

Eric


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Tell-expiry-hook-functions-where-the-message-is-goin.patch --]
[-- Type: text/x-diff, Size: 1075 bytes --]

From d89d596301fae28f94ce2370b7affe8719361ce3 Mon Sep 17 00:00:00 2001
From: Eric Abrahamsen <eric@ericabrahamsen.net>
Date: Tue, 29 Jul 2014 16:53:09 +0800
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 | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el
index c0e099b..4f061cd 100644
--- a/lisp/gnus-sum.el
+++ b/lisp/gnus-sum.el
@@ -10449,7 +10449,10 @@ This will be the case if the article has both been mailed and posted."
 					(gnus-data-header
 					 (assoc article (gnus-data-list nil)))
 					gnus-newsgroup-name
-					nil
+					(if (fboundp nnmail-expiry-target)
+					    (funcall nnmail-expiry-target
+						     gnus-newsgroup-name)
+					  nnmail-expiry-target)
 					nil)))))))
 	(gnus-message 6 "Expiring articles...done")))))
 
-- 
2.0.3


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

end of thread, other threads:[~2014-08-14 11:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-29  9:04 [Patch] tell expiry-hook functions where expired messages are going Eric Abrahamsen
2014-08-06  8:06 ` Alan Schmitt
2014-08-06  8:45   ` Eric Abrahamsen
2014-08-06 11:00     ` Katsumi Yamaoka
2014-08-06 11:14       ` Katsumi Yamaoka
2014-08-06 16:22         ` Eric Abrahamsen
2014-08-11 14:07         ` Alan Schmitt
2014-08-14  7:42           ` Eric Abrahamsen
2014-08-14 11:30             ` Katsumi Yamaoka

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