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: Sun, 24 Aug 2014 11:22:10 +0800	[thread overview]
Message-ID: <87a96uy3kt.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <87r40bdo2e.fsf@aura.christopherculver.com>

Christopher Culver <crculver@christopherculver.com> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>> In gnus-sum.el there are a series of `gnus-data-*' functions for
>> working with the data vector, there's a `gnus-data-number', for
>> instance. Of course, all that does is take the car of the vector! But
>> if you're doing more than that, it's probably better to use the
>> pre-made functions.
>
> How does one use that? To save the article number as a variable specific
> to the function I’m writing, I had (defvar the-article-number (aref
> data-header 0)), which works. However, changing that to
> (gnus-data-number data-header) gives an error.

Huh, that's weird, I don't see why (aref ARRAY 0) would be any different
from (car ARRAY)... What error do you get?

> The problem now with my function is that gnus-article-move-hook is
> apparently called *after* the message has been totally moved from the
> group in question and deleted from the summary buffer. Without the
> article still present in the summary buffer, I cannot use the following
> functions that I had expected to:
>
> (gnus-summary-goto-subject the-article-number)  
> (gnus-summary-save-in-pipe "my-piped-command" t)
>
> Trying to use those functions results in the following error message:
>
> No such file: /home/crculver/Mail/mail/misc/54433
> No such article (may have expired or been canceled)
>
> Does Gnus have a way of accessing messages in other groups than what is
> visible in the summary buffer? Of course, the article number will change in
> the group to which the message is moved.
>
> Or is there a way to run the gnus-article-move-hook function *prior* to
> the moving of the message?

There are several dynamic variables bound during
`gnus-summary-move-article' that you might be able to use. In the
message moving loop, the variables to-group and to-article *ought* to be
bound to the destination group, and the message's new article number in
that group. Maybe try using those variables in your hook function to
find the article at its new location?

HTH,
Eric




  reply	other threads:[~2014-08-24  3:22 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
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 [this message]
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=87a96uy3kt.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).