wangp / bower

A curses terminal client for the Notmuch email system
Other
119 stars 11 forks source link

[Request] pipe messages #42

Closed vivien closed 5 years ago

vivien commented 5 years ago

We need a | binding in the thread/pager view to allow piping a given message content to a user command, e.g. git am.

wangp commented 5 years ago

Instead of a separate binding, perhaps it would make sense for open (o) to behave differently if the command begins with |. You can get the same effect with a helper script, e.g. call it pipeto

#!/bin/bash -eu
test "$#" -gt 1 || exit 1
file="${@: -1}"
test -f "$file" || exit 1
set -- "${@:1:$#-1}"
exec "$@" < "$file"

then open the message or part with a command pipeto some command.

It might be useful to gather some more use cases.

vivien commented 5 years ago

I'm not sure to follow. How do you currently execute a command for a given notmuch thread or message ID?

wangp commented 5 years ago

You can highlight a message with capital V (the Date line is highlighted). There's no way to execute a command on an entire thread.

wangp commented 5 years ago

I think this is adequately supported by piping thread/message IDs with |.