mutt-kz icon indicating copy to clipboard operation
mutt-kz copied to clipboard

Synchronise tags to flags

Open paretje opened this issue 7 years ago • 4 comments

Currently, flags are synced to tags, but the reverse isn't true. If you mark a mail as unread "the mutt way", you'll be able to find this mail using tag:unread, however if you remove the tag unread, the flags aren't adjusted, and it's still marked unread in mutt.

This functionality is provided by notmuch, but means that any mail has to be synced to disc when the labels are modified, which conflicts with the way synchronisation to disk works in mutt.

To solve this properly, it's best to just check if the changes performed in the tags involve some flags handled by mutt, and if so, update the header in mutt. When mutt syncs to disc, the flags will be adjusted on disc as well.

Some remarks:

  • The parsing code is currently duplicated. I'll fix this.
  • The labels are currently hard-coded. It seems like notmuch doesn't allow customisation of these labels, but mutt-kz does for unread. Would you prefer if I added and used configuration variables for the other labels?
  • The draft and passed labels are currently ignored, as they aren't handled by mutt.

paretje avatar Sep 09 '16 15:09 paretje

hi @paretje Sorry for not commenting sooner.

You haven't been forgotten. Your patch is wanted.

NotMuch is still being developed, but @karelzak is a busy man. I'm the maintainer of the NeoMutt project. I'd like to take your patch, help you develop it and feed it back to mutt-kz when done.

flatcap avatar Sep 21 '16 10:09 flatcap

Pulled into branch: devel/notmuch-sync-flags

flatcap avatar Sep 21 '16 10:09 flatcap

Sounds good, but as suggested by @flatcap it would be better to continue in neomutt.

karelzak avatar Oct 04 '16 12:10 karelzak

Thanks, merged into NeoMutt.

flatcap avatar Oct 06 '16 22:10 flatcap