<<< Date Index >>>     <<< Thread Index >>>

Re: Deleting old messages



* 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'
> > 
> > Nicolas
> 
> Hi Nicholas,

Grrr, Nicolas
        !

I think you should have sent your reply to mutt-users, because other
might try to use that hook.

> Thanks for that advice. Unfortunately when I open the folder
> using that hook the error message 
> 
> :set: unknown command
> 
> appears.
> 
> I have entered the hook exactly as you described.

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'"

Perhaps you should replace D by T while trying, or leave out $ to
constrain the potential damage.

Nicolas (very tired)