Skip to content

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

Open
kylebarbour wants to merge 1 commit into
honza:masterfrom
kylebarbour:threads
Open

Add option '-t' to get full thread from Message-Id#12
kylebarbour wants to merge 1 commit into
honza:masterfrom
kylebarbour:threads

Conversation

@kylebarbour

Copy link
Copy Markdown

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
Copy Markdown
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