<<< Date Index >>>     <<< Thread Index >>>

Re: pseudo multi-threading



On 23Mar2006 17:04, Gerhard Siegesmund <jerri@xxxxxxxx> wrote:
| > Hello.  I have been working on trying to achieve a sort of pseudo
| > multi-threading in mutt.  I have managed to make some progress, but it's 
been
| > trickier than I would have liked and I was hoping maybe others out there 
could
| > help or offer suggestions.
| 
| Maybe the attached script is of any help. It is intended to be used
| together with screen (but it might be possible to change this script to
| use something other? :))
[...]
| case $1 in
|   # Output the configuration. You can use this script in the
|   # mutt-configuration-files like this:
|   # `compose.sh config`
|   config)
|     echo -n "set editor=\"vim -c 'set bs=1 tw=72 comments=nb:>' +/^To: 
+'silent! s/ignore@me//'\";"
|     echo -n "macro index m \"<shell-escape>$0 newmail<enter>\";"
|     echo -n "macro pager m \"<shell-escape>$0 newmail<enter>\";"
|     echo -n "macro index r \"<pipe-message>$0 reply<enter>\";"
|     echo -n "macro pager r \"<pipe-message>$0 reply<enter>\";"
|     echo -n "macro index g \"<pipe-message>$0 group-reply<enter>\";"
|     echo -n "macro pager g \"<pipe-message>$0 group-reply<enter>\";"
|     echo -n "macro compose q \"<exit>\";"
[...]

This is a nice idea, and I spent a little time last night hacking up
something similar for myself with an implementation I liked better
(it is smaller, too).

Instead of rewiring m and r and g etc, I wrote a "muttedit" script and
just "set editor=muttedit" (and rewired only the "e" keystroke to bypass
it).

Muttedit is thus invoked as the mail editor. Because I run with autoedit
on, this is seamless; it would probably not be satisfactory if you don't
use autoedit.

Anyway, it takes a copy of the file and invoked "mutt -H" inside a new
screen session (with the mail subject in the screen session title).
If I complete the message, the session ends and it's as though it was a
regular inline reply. If I want to defer I detach from the session.
Because the original temp file is unchanged, the reply is not sent
and the screen session awaits my attention. Here's my screen output while
I'm editing this message:

        [home/cameron]janus*> screen -ls
        There is a screen on:
                16212.mutt-01apr2006-08:41 Re_pseudo_multi_threading
        (Attached)
        1 Socket in /tmp/screen-cameron.

Muttedit is here:

        http://www.cskk.ezoshosting.com/cs/css/bin/muttedit

Note that the sub-mutt sets editor back to $EDITOR and unsets signature
(otherwise you get two signatures:-)

It seems seamless to me so far.

Cheers,
-- 
Cameron Simpson <cs@xxxxxxxxxx> DoD#743
http://www.cskk.ezoshosting.com/cs/

BSD code sucks. Of course, everything else sucks far more.
        - Theo de Raadt (OpenBSD President)