Fitler: munge long headers for display in mutt

Ingrid often interacts with people who don't know how to bcc; in mutt this is particularly irritating because you have to page past all the recipients. If you're afflicted by this, consider trying my little program "fitler".

After putting the script on your PATH as 'fitler' (don't forget to mark it +x), you can enable it in mutt with:

set display_filter=fitler
and you can have a couple of macros to turn this on and off:
macro pager o    \e0o
macro pager \e0o ":set nodisplay_filter\r:macro pager o \e1o\ri "
macro pager \e1o ":set display_filter=fitler\r:macro pager o \e0o\ri "

Now, "o" in the pager will toggle the use of fitler on or off and redisplay the current message; it does this by having two macros "esc 0 o" and "esc 1 o" which change the display_filter setting and then remap "o" to the other macro, creating a toggle. (I think sometime in the last 5 years mutt may have grown a smarter way to do this, but I'm just cutting and pasting what's in this very venerable muttrc.).

Instead of a header like

Cc: Zzzzz Z Zzzzzz <zzzzzzz@zzzzz.zzz>, Zzzzz Zzzzzzzz <zzzzzz@zzzzz.zzz>,
        Zzzz Zzzzz <zzzzzz@zzzzzzzzzz.zzz>,
        Zzzzzzzz Zzzzzz <zzzzzzzz@zzzzz.zzz>, Zzzzzzzz Zzzz <zzz@zzzz.zzz>,
        Zzzz Zzzz-Zzzz <zzzzzzzzz@zzzzz.zzz>,
        Zzzzzz Zzzz <zzzzz@zzzzzzz.zzzz.zz>,
        Zzzzz Zzzzzzzz <zzzzz@zzzzzzzzzz.zz.zz>,
        Zzzz Zzzzzzzz Zzzzzzzzz <zzzzzz@zzzzz.zzz>
you'll see instead
Cc: [9 recipients] Zzzzz Z Zzzzzz, Zzzzz Zzzzzzzz, Zzzz Zzzzz, Zzzzzzzz Zzzzz...

.. hit "o" in the rare cases where you need to see the full header.

Files currently attached to this page:

fitler.py2.0kB



Entry first conceived on 20 August 2012, 2:30 UTC, last modified on 20 August 2012, 2:45 UTC
Website Copyright © 2004-2024 Jeff Epler