From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: ding@gnus.org
Subject: Re: [Patch] tell expiry-hook functions where expired messages are going
Date: Thu, 14 Aug 2014 15:42:47 +0800 [thread overview]
Message-ID: <8761hvseiw.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <m2ha1jf7c4.fsf@polytechnique.org>
Alan Schmitt <alan.schmitt@polytechnique.org> writes:
> Hello,
>
> On 2014-08-06 20:14, Katsumi Yamaoka <yamaoka@jpl.org> 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 <alan.schmitt@polytechnique.org>
> 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
next prev parent reply other threads:[~2014-08-14 7:42 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-29 9:04 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 [this message]
2014-08-14 11:30 ` Katsumi Yamaoka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8761hvseiw.fsf@ericabrahamsen.net \
--to=eric@ericabrahamsen.net \
--cc=ding@gnus.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).