Re: Deleting old messages
* Nicolas Rachinsky <list@xxxxxxxxxxxx> [031209 22:15]:
> * Ian Partridge <ian@xxxxxxxxxxxxx> [2003-12-09 14:10 +0000]:
> > On Fri, Dec 05, 2003 at 09:01:14PM +0100, Nicolas Rachinsky wrote:
> > > * Ian Partridge <ian@xxxxxxxxxxxxx> [2003-12-05 13:00 +0000]:
> > > > How can I write a hook such that when a mailbox is
> > > > opened, only the 30 highest-numbered messages are retained and
> > > > the rest are purged (not just marked for deletion)?
> > >
> > > The following should work (untested, with default key bindings).
> > > folder-hook something ':set sort=reverse-threads\nD~m>30\n$:set
> > > sort=threads\n'
>
> Hmm, it seems there is a push missing, but I'm not totally sure about
> the correct quoting (too tired to think hard or try it). But something
> similar to one of the following should work:
> folder-hook something push ':set sort=reverse-threads\nD~m>30\n$:set
> sort=threads\n'
> folder-hook something 'push :set sort=reverse-threads\nD~m>30\n$:set
> sort=threads\n'
> folder-hook something "push ':set sort=reverse-threads\nD~m>30\n$:set
> sort=threads\n'"
How about
macro index ,d ":set delete=yes\r"
macro index ,D ":set delete=ask-yes\r"
folder-hook something
"<sort-reverse>r<delete-pattern>~m>30<enter><sort-mailbox>t,d<sync-mailbox>,D"
jack