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: Wed, 27 Aug 2014 10:07:09 +0800	[thread overview]
Message-ID: <87fvgi4rea.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <8738ci95fs.fsf@aura.christopherculver.com>

Christopher Culver <crculver@christopherculver.com> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>> Christopher Culver <crculver@christopherculver.com> writes:
>>> 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?
>
> If the Gnus internals create a variable referring to the to-article, how
> do I access it? Attempting to do perform an action with a variable
> "to-article" produces the error:
>
> Symbol's value as variable is void: to-article

Sorry, I wasn't looking closely enough at the code -- to-article is
already out of scope by the time the hook is run.

> So, the only variables I seem to be able to access are the ones passed
> by gnus-summary-article-move-hook to the hooked function: (action
> data-header from &optional to method). And here the value of "to" is
> only the destination group, not the destination message.

Yup, unfortunately I don't see any way of getting at the new article
number, it's just not present. It would make a lot of sense to me to
have that available to the hook functions, but it's not possible right
now. There might be some objection to changing the calling signature of
the hook functions, as well...

Eric




      reply	other threads:[~2014-08-27  2:07 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
2014-08-26 23:50                     ` Christopher Culver
2014-08-27  2:07                       ` Eric Abrahamsen [this message]

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