diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2021-05-15 19:14:20 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2021-05-15 19:14:20 +0200 |
commit | 555f5a2f362ac23a83bba5cbf8262221cc78a451 (patch) | |
tree | e63ef1a9dd282aab094fbd906294d3e7865b0c46 | |
parent | 9244192e2822b4e764b5670d8e00ec1f1a3792a0 (diff) |
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r-- | notmuch-sel-mid | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/notmuch-sel-mid b/notmuch-sel-mid index 92b9d54..3bc0dcc 100644 --- a/notmuch-sel-mid +++ b/notmuch-sel-mid @@ -152,11 +152,16 @@ debug "TERMS = ${TERMS}" [[ -z "${TERMS}" ]] && abort "TERMS ('${TERMS}') cannot be empty" matcher_select() { - "$MATCHER" --preview "notmuch search --output=files {} | xargs -n 1 cat" + "$MATCHER" --with-nth 2.. --preview 'echo {} | sed "s,\ .*,," | xargs -n 1 notmuch search --output=files | xargs -n 1 cat' } notmuch search --output=messages ${TERMS} | \ + xargs -n 1 notmuch search --output=messages | \ + while read -r line; do + echo -n "$line" + notmuch search --output=files "$line" | head -n 1 | xargs -n 1 grep -E "^Subject" | sed 's,^Subject:,,' + done | \ matcher_select | \ - sed 's,^id:,,' + sed 's,^id:,,; s,\ .*,,' # vim: set ft=sh ts=4 sw=4 et |