Daily Archive for January 29th, 2012

Mutt: A faster way to mark messages as read

I was looking for a macro for Mutt to mark all the messages in a mailbox as read and came across this post which suggested:

[cce]macro index M “T.*\n;WN” “Mark all messages as read”[/cce]

However, this is slow because it performs a tag matching against the Regex pattern “.*”, which is computationally intensive. Another post recommended using ~A instead of .*, but this still has to tag everything in your mailbox and that kind of sucks big-time. So, I came up with this instead:

[cce]macro index <esc>m “T~N<enter>;WNT~O<enter>;WO\CT~T<enter>” “mark all messages read”[/cce]

It first selects all messages marked “New” and untags them. Then, it selects all messages marked “Old” but unread and untags them as well. Finally, it gets rid of all the tag markings by doing T ~A.

Seems to be working pretty snappily.