Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option '-t' to get full thread from Message-Id #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kylebarbour
Copy link

This retrieves the entire thread as understood by notmuch for a given message ID (closes #11). Unfortunately, mutt doesn't provide a way to automatically give you the message ID, and as far as I can tell the message ID is the best way for notmuch to give you the thread, so this requires a little scripting to make it work — suggestions welcome to improve this!

I have a helper script containing the following:

#! /bin/bash
msg="$(< /dev/stdin)"
id="$(echo "$msg" | grep Message-Id | sed 's/.*<\(.*\)>/\1/')"

mutt-notmuch-py -G -t "$id" ~/.mutt/tmp/thread

and then in my .muttrc I can use

macro index,pager ga "<pipe-message>notmuch-thread.sh<Enter>\
<change-folder-readonly>~/.mutt/tmp/thread<Enter>" \
"show all messages in thread"

and I thus have the thread functionality provided by the original perl script.

Suggestions/improvements welcome!

@kylebarbour
Copy link
Author

One option that would make this a little less crufty would be to allow mutt-notmuch-py to accept the full message on stdin, which would allow all that manipulation to happen inside the program. I just wasn't sure if that was in line with your idea of how this ought to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reconstruct threads
1 participant