* Johannes Weißl on Sunday, November 28, 2010 at 23:49:26 +0100
> For users of mairix, mu or nmzmail, another script might be interesting:
> muttjump: https://github.com/weisslj/muttjump
> It allows jumping back from the search folder to the original message
> (useful for editing, changing flags, deleting).
Ah, nice, something I wanted to do for a long time. But it's
always easier to nitpick on others ;-) I did the following to
make it work - veeery quick and dirty, but might give you some
ideas:
if [ "$MUTTJUMP_USE_SCREEN" = no ] ; then
# work around $uncollapse_jump in folder-hook
# avoid wrap search
# for search be independent of collapsed threads
jump_cmd="1<enter><limit>$jump_expr<enter>"
[ "$MUTTJUMP_MODE" = "search" ] && jump_cmd="$jump_cmd<limit>all<enter>"
if [ -z "$STY" ]; then
SCREEN=""
# Close message-stdin and open terminal-stdin instead.
# mutt behaves different if STDIN is no terminal
# TODO: Find cleaner solution (e.g. mutt command-line argument?)
exec 0<&-
term="/dev/$(ps -p$$ | awk '!/PID/ { print $2 }')"
exec < $term
else
SCREEN="$SCREEN -X screen"
fi
# start mutt, open original folder and jump to the original message
$SCREEN $MUTT -f "$orig_maildir" -e "push \"$jump_cmd\""
1) consistently using <commands> might be a good idea - in case
someone decides to remap "/" ;-)
2) Avoid problems with $wrap_search by jumping to 1st message.
2) I for one set $uncollapse_jump in folder-hooks, therefore
"simulate" search to be independent of setups.
4) The screen code obviously does not belong there, I put it in
just for brevity and to point you to screen -X and $STY. You
might even be able to avoid some "screen stuff" commands in
the screen section.
5) ps has no --no-heading option here on Mac OS X (BSD-like).
c
--
theatre - books - texts - movies
Black Trash Productions at home: http://www.blacktrash.org
Black Trash Productions on Facebook:
http://www.facebook.com/blacktrashproductions