summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--notmuch-sel-mid9
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