From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/84777 Path: news.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.gnus.general Subject: Re: [Patch] tell expiry-hook functions where expired messages are going Date: Thu, 14 Aug 2014 15:42:47 +0800 Message-ID: <8761hvseiw.fsf@ericabrahamsen.net> References: <877g2w3596.fsf@ericabrahamsen.net> <871tsurooq.fsf@ericabrahamsen.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1408001935 31556 80.91.229.3 (14 Aug 2014 07:38:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 14 Aug 2014 07:38:55 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M33020=ding+2Daccount=gmane.org@lists.math.uh.edu Thu Aug 14 09:38:43 2014 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XHpcQ-0005NL-FD for ding-account@gmane.org; Thu, 14 Aug 2014 09:38:42 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1XHpcP-0006cz-Ij for ding-account@gmane.org; Thu, 14 Aug 2014 02:38:41 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1XHpcN-0006cs-Sy for ding@lists.math.uh.edu; Thu, 14 Aug 2014 02:38:39 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtps (TLSv1:AES128-SHA:128) (Exim 4.76) (envelope-from ) id 1XHpcM-0006CC-AZ for ding@lists.math.uh.edu; Thu, 14 Aug 2014 02:38:39 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]) by quimby.gnus.org with esmtp (Exim 4.80) (envelope-from ) id 1XHpcK-0007pI-AR for ding@gnus.org; Thu, 14 Aug 2014 09:38:36 +0200 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XHpcH-0005Kq-Ka for ding@gnus.org; Thu, 14 Aug 2014 09:38:33 +0200 Original-Received: from 124.78.11.230 ([124.78.11.230]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 14 Aug 2014 09:38:33 +0200 Original-Received: from eric by 124.78.11.230 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 14 Aug 2014 09:38:33 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 76 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 124.78.11.230 User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.4.50 (gnu/linux) Cancel-Lock: sha1:c70pKcWv0/2CPYZgkZbNGrVXmK0= X-Spam-Score: -0.7 (/) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:84777 Archived-At: Alan Schmitt writes: > Hello, > > On 2014-08-06 20:14, Katsumi Yamaoka writes: > >> I've reverted the change in the Gnus git master and the Emacs trunk. >> Please reinstall the feature if you get a good solution. I have >> no idea for it so far, sorry. > > Here is an adaptation of Eric's patch that takes these problems into > account. As the target is either a string, the 'delete symbol, or > a function, I test those in turn. In the case it's a function, the > result from the call should be either a string or a 'delete symbol or > a string. In the case it's a 'delete symbole, the hook is called with > 'nil' as target. > > Eric: I reused your log message, I hope you don't mind. I don't mind at all, of course! This seems like the only solution that's likely to work. The only sure-fire solution would be to have the expiry functions return a list of articles they expired, and where they expired them to, but that's the opposite of what they do now -- they return a list of article that *weren't* expired. E > Best, > > Alan > > 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