Gnus development mailing list
 help / color / mirror / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: ding@gnus.org
Subject: Re: Hooks for moving an article and for setting it expirable
Date: Mon, 18 Aug 2014 22:25:36 +0800	[thread overview]
Message-ID: <87mwb1lvrz.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <87zjf1j4dt.fsf@aura.christopherculver.com>

Christopher Culver <crculver@christopherculver.com> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>> Hmm, it is a little unfortunate that the docstrings of those hooks don't
>> say... Both of them are called with the same arguments: ACTION (which
>> can be a symbol like move, delete, crosspost, or copy), DATA (which is
>> the header data as returned by `gnus-data-header'), FROM-GROUP (where
>> the article's coming from), TO-GROUP (where it's going), and
>> SELECT-METHOD, for the current select method.
>
> Strange, I would have expected one of the arguments to be the article
> itself, not just the header. If I want a function called by a hook to do
> something with the raw article, how can I get the raw article passed to
> the function? Or can I simply call gnus-summary-save-in-pipe from within
> the function and it would know to act on the article(s) presently being
> moved or deleted? My knowledge of Emacs Lisp is still rudimentary and
> maybe I don’t understand the scoping.
>
> Christopher Culver

Actually the data argument should be all you need. It will contain
several of the important email headers from the message, if that's good
enough, and that it isn't good enough, it also contains the article
number, which is all you need to retrieve the whole article.

Part of the confusing thing about this is that it's hard to tell what
"the article" actually is. As far as Gnus is concerned, the article
number is the important thing. But when you say you want the "raw
article" passed to the function, what does that mean, exactly? A buffer
holding the article? The article as a string? Practically speaking, you
can use that data to do pretty much anything you wanted to do with the
article.

I know that's not that helpful...

Eric




  reply	other threads:[~2014-08-18 14:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-05 16:26 Christopher Culver
2014-08-07 20:45 ` Adam Sjøgren
2014-08-08  1:59 ` Eric Abrahamsen
2014-08-17 20:10   ` Christopher Culver
2014-08-18  0:03     ` Eric Abrahamsen
2014-08-18 13:47       ` Christopher Culver
2014-08-18 14:25         ` Eric Abrahamsen [this message]
2014-08-18 15:27           ` Christopher Culver
2014-08-18 17:16             ` Christopher Culver
2014-08-19  1:16               ` Eric Abrahamsen
2014-08-20 18:16                 ` Christopher Culver
2014-08-24  3:22                   ` Eric Abrahamsen
2014-08-26 23:50                     ` Christopher Culver
2014-08-27  2:07                       ` Eric Abrahamsen

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=87mwb1lvrz.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).