Always display flagged messages in mutt
Asked Answered
C

2

5

In mutt, I'd like to keep track of important messages which I need to answer, pretty much like I did in GMail before. The problem is that I tend to forget that I have such important messages, and so, never run the macro which makes flagged messages appear (in case they are too old to appear in the index). So, I'd like that the flagged messages always appear in the main index, no matter how old they are. This setting, along with the fact that the flagged messages appear in a different color (they already do), should be enough to prevent me to forgetting answering old - but important - messages. Is that possible ?

Thanks in advance!

Convolution answered 2/7, 2013 at 2:48 Comment(0)
L
7

The ordering of messages cannot be changed arbitrarily outside the scope of sort and sort_aux. However, you can limit the messages in your index to specific kinds of mail and bind everything neatly to macros, like so:

macro index .i  "<limit>(~N|~F)<Enter>"  "view new/flag"
macro index .a  "<limit>~A<Enter>"       "view all"

The first macro .i will limit messages in the index to only flagged (starred) and new ones, whereas the latter .a will remove any limit and show all messages, again.

You can automatically apply one of these views when entering a mail folder by utilizing a folder-hook.

folder-hook */INBOX push .i

Just alter the regular expression following the hook to whatever folder(s) you want to apply the macro to. Simply press .a at any point in the index to show all messages, again.

For further details consult the manpage, as it is fairly comprehensive.

Lynd answered 17/7, 2013 at 3:48 Comment(1)
Thanks for your answer! Yeah, after a few days without any answer, I took more time to look around for similar requests and I finally found a config trick like this one in someone else's .muttrc. It is not exactly what I wanted, but it is clearly a good partial solution to my problem. I'm pretty surprised that there exists no way of « cutting the screen in half », reserving a small portion of it (like the pager when reading a message) for specific messages (flagged one, in this case), but anyway, thanks.Convolution
L
0

That's a great hint and it works, I only had to change folder-hook to point to /var/mail/username (Linux INBOX).

I only wonder if the "push" (or maybe even the macro itself) could be made conditional, that is to work only if there are any new/flagged messages. As it is now, if there are no such messages, one gets empty list and has to manually execute ".a" macro.

Landahl answered 18/2, 2023 at 10:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.