Gnus development mailing list
 help / color / mirror / Atom feed
* How can I split old mail based on "Date:"?
@ 2001-09-05 22:14 Rob Browning
  2001-09-05 22:29 ` Nevin Kapur
  0 siblings, 1 reply; 7+ messages in thread
From: Rob Browning @ 2001-09-05 22:14 UTC (permalink / raw)



I've got some truly gargantuan groups (like debian-user) that I'd like
to break up into sub-groups based on date, and I'm wondering what the
best way to do this is.

Ideally I'd like to be able to just write elisp (for this and other
purposes) to do the job.  Perhaps something like:

  (gnus-group-for-each-msg 'my-by-date-splitter)

where my-by-date-splitter might look like this:

  (defun my-by-date-splitter (group article)
    (let ((header-date (gnus-article-get-date article))
          ...)
      (gnus-group-move-article group new-group)))

or similar. [1]

gnus probably already has most of the code I'd need, but where should
I start looking (i.e. to find out how to map over all articles, how to
get the article date, etc.)

I'd be happy with an elisp function I could call from the *Group*
buffer, or better yet, a function that gets called automatically now
and then, or perhaps just a suitable expiry function that moves
articles older than say a year to group-yearnumber.

I suppose I could just edit my splits and respool, but I want to
preserve marks, and I'd rather not have to add a new rule every time I
want to do this.

Thanks

[1] I've occasionally thought it might be nice to have a general
    purpose elisp or scheme library for manipulating email, and it
    seems like if the backend format were well enough specified, this
    shouldn't be too hard from either language for simple tasks (like
    changing article marks, etc.).  i.e. in nnmaildir, it seems like
    some things would be really easy, given its fs layout...

-- 
Rob Browning
rlb @defaultvalue.org, @linuxdevel.com, and @debian.org
Previously @cs.utexas.edu
GPG=1C58 8B2C FB5E 3F64 EA5C  64AE 78FE E5FE F0CB A0AD


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How can I split old mail based on "Date:"?
  2001-09-05 22:14 How can I split old mail based on "Date:"? Rob Browning
@ 2001-09-05 22:29 ` Nevin Kapur
  2001-09-27 16:46   ` Rob Browning
  0 siblings, 1 reply; 7+ messages in thread
From: Nevin Kapur @ 2001-09-05 22:29 UTC (permalink / raw)


Rob Browning <rlb@defaultvalue.org> writes:

[...]

> ... or perhaps just a suitable expiry function that moves
> articles older than say a year to group-yearnumber.

I posted some code in 

http://groups.google.com/groups?q=archive+author:nevin+author:kapur&hl=en&safe=off&rnum=1&selm=m3ofpjd6g0.fsf%40fermat.mts.jhu.edu

that expires like you want depending on an arbitrary header.

> I suppose I could just edit my splits and respool, but I want to
> preserve marks, and I'd rather not have to add a new rule every time I
> want to do this.

The code mentioned above will not preserver marks. It will expire
older email to groups, where they will appear as new when you 'g'.

-- 
Nevin


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How can I split old mail based on "Date:"?
  2001-09-05 22:29 ` Nevin Kapur
@ 2001-09-27 16:46   ` Rob Browning
  2001-09-27 18:40     ` Harry Putnam
  2001-09-27 21:54     ` Nevin Kapur
  0 siblings, 2 replies; 7+ messages in thread
From: Rob Browning @ 2001-09-27 16:46 UTC (permalink / raw)
  Cc: ding

Nevin Kapur <nevin@jhu.edu> writes:

>> I suppose I could just edit my splits and respool, but I want to
>> preserve marks, and I'd rather not have to add a new rule every time I
>> want to do this.
>
> The code mentioned above will not preserver marks. It will expire
> older email to groups, where they will appear as new when you 'g'.

Thanks, that's somewhat helpful, but I need to be able to preserve
marks.  I'd like to be able to traverse a group's articles and
"backend move" some of them whenever a predicate matches (i.e. date is
more than a year old).  Any suggestions for the easiest way to go
about this?

If there were date based limits, I suppse that might be another way to
go about it.

Thanks

-- 
Rob Browning
rlb @defaultvalue.org, @linuxdevel.com, and @debian.org
Previously @cs.utexas.edu
GPG=1C58 8B2C FB5E 3F64 EA5C  64AE 78FE E5FE F0CB A0AD



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How can I split old mail based on "Date:"?
  2001-09-27 16:46   ` Rob Browning
@ 2001-09-27 18:40     ` Harry Putnam
  2001-09-27 21:26       ` Rob Browning
  2001-09-27 21:54     ` Nevin Kapur
  1 sibling, 1 reply; 7+ messages in thread
From: Harry Putnam @ 2001-09-27 18:40 UTC (permalink / raw)
  Cc: Nevin Kapur, ding

Rob Browning <rlb@defaultvalue.org> writes:

> If there were date based limits, I suppse that might be another way to
> go about it.

Did you already know about `/ t' and `C-u / t'



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How can I split old mail based on "Date:"?
  2001-09-27 18:40     ` Harry Putnam
@ 2001-09-27 21:26       ` Rob Browning
  2001-10-31 22:51         ` Rob Browning
  0 siblings, 1 reply; 7+ messages in thread
From: Rob Browning @ 2001-09-27 21:26 UTC (permalink / raw)
  Cc: Nevin Kapur, ding

Harry Putnam <reader@newsguy.com> writes:

> Did you already know about `/ t' and `C-u / t'

Hmm, that might work, presuming it operates on article Date:'s.

I had kinda wanted a non-interactive way to do this, but now that I
think of it, with some helper functions to handle figuring out the
actual number of days to use to limit to a particular year, I might be
able to work something out.

In the long run, if I have the time, I'd really like to figure out how
to write a function like

  (for-each-article-in-group function group)

if there's not one already.

-- 
Rob Browning
rlb @defaultvalue.org, @linuxdevel.com, and @debian.org
Previously @cs.utexas.edu
GPG=1C58 8B2C FB5E 3F64 EA5C  64AE 78FE E5FE F0CB A0AD



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How can I split old mail based on "Date:"?
  2001-09-27 16:46   ` Rob Browning
  2001-09-27 18:40     ` Harry Putnam
@ 2001-09-27 21:54     ` Nevin Kapur
  1 sibling, 0 replies; 7+ messages in thread
From: Nevin Kapur @ 2001-09-27 21:54 UTC (permalink / raw)
  Cc: Rob Browning

Rob Browning <rlb@defaultvalue.org> writes:

> Thanks, that's somewhat helpful, but I need to be able to preserve
> marks.  I'd like to be able to traverse a group's articles and
> "backend move" some of them whenever a predicate matches (i.e. date is
> more than a year old).  Any suggestions for the easiest way to go
> about this?

I am interested in a solution to this problem too. It would be nice if
expiry to a group preserved marks.

-- 
Nevin Kapur
nevin@jhu.edu 



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How can I split old mail based on "Date:"?
  2001-09-27 21:26       ` Rob Browning
@ 2001-10-31 22:51         ` Rob Browning
  0 siblings, 0 replies; 7+ messages in thread
From: Rob Browning @ 2001-10-31 22:51 UTC (permalink / raw)
  Cc: Nevin Kapur, ding

Rob Browning <rlb@defaultvalue.org> writes:

> Harry Putnam <reader@newsguy.com> writes:
>
>> Did you already know about `/ t' and `C-u / t'
>
> Hmm, that might work, presuming it operates on article Date:'s.

[...]

> In the long run, if I have the time, I'd really like to figure out how
> to write a function like
>
>   (for-each-article-in-group function group)

/ t sort of works, but it's a pain because I'd like to move all
articles from say 1999 into their own group, presuming I've already
moved everything before 1999, I either have to run the command at
exactly midnight on the day I do the / t, or I'll have overlap.  It
would be nice to have something like / t that has a fixed rounding
either up or down to the nearest day.

I can still use / t, but I have to use it to get close, and then do
the rest by hand, which is unfortunate.

Maybe I'll look at how / t works and try to come up with something
myself.

Thanks

-- 
Rob Browning
rlb @defaultvalue.org, @linuxdevel.com, and @debian.org
Previously @cs.utexas.edu
GPG=1C58 8B2C FB5E 3F64 EA5C  64AE 78FE E5FE F0CB A0AD



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2001-10-31 22:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-05 22:14 How can I split old mail based on "Date:"? Rob Browning
2001-09-05 22:29 ` Nevin Kapur
2001-09-27 16:46   ` Rob Browning
2001-09-27 18:40     ` Harry Putnam
2001-09-27 21:26       ` Rob Browning
2001-10-31 22:51         ` Rob Browning
2001-09-27 21:54     ` Nevin Kapur

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).