diff --git a/src/sh/notmuch.sh b/src/sh/notmuch.sh index 942854f..1b46156 100644 --- a/src/sh/notmuch.sh +++ b/src/sh/notmuch.sh @@ -38,6 +38,14 @@ nm_message_get_part() { $NOTMUCH show --part="$2" id:"$1" } +# Print part of message, but this automatically converts to the current +# encoding. +# @argument $1: message id +# @argument $2: part number +nm_message_get_text_part() { + $NOTMUCH show --part="$2" --format=text id:"$1" | awk 'BEGIN { RS="\x0c"; FS="\n" } /^part{/ { for (i=2; i