/ Cameron Simpson wrote on Thu 1.Nov'12 at 21:14:45 +1100 / > On 31Oct2012 17:32, Jeremy Kitchen <kitc...@kitchen.io> wrote: > | On Thu, Nov 01, 2012 at 10:28:09AM +1100, Cameron Simpson wrote: > | > [...] I've got mutt configured to automatically > | > compose replies in a detachable screen session named after a mangling of > | > the subject line, so I can reconnect later if disconnected (or if I just > | > decide to disconnect from screen and finish composition another time). > | > Thus: > | > > | > [/home/cameron]janus*> scr > | > 1 23168.BACKUP > | > 2 7237.DOVECOT > | > 3 12992.EMERGE > | > 4 8218.GETMAIL > | > 5 9000.MAILFILER > | > 6 31196.WD > | > 7 4915.WD_BEY2 > | > 8 4793.WD_BEYONWIZ > | > 9 14831.mutt-01nov2012-10:10 > | > 10 16970.mutt-27oct2012-14:45 > | > > | > So I could detach right now and reconnect by saying "scr 10" to finish > | > the job. > | > | Hrm. I'd be very interested in seeing how this works. I like the idea, > | but mutt's email editing is modal, right? How does that work with > | essentially backgrounding an editor? > > I mentioned this briefly in: > > http://www.mail-archive.com/mutt-users@mutt.org/msg40856.html > > but more thoroughly: > > I have: > > set edit_headers=yes > set editor=muttedit > set autoedit=yes > > Muttedit is here: > > https://bitbucket.org/cameron_simpson/css/src/tip/bin/muttedit > > It relies on a feature of mutt: if you exit the editor having changed > nothing, mutt silently cancels the compose mode. So muttedit is invoked > as your editor. It: > > - takes a copy of the message composition file it is handed > > - computes a "screen" title from the time and message subject > > - invokes screen running > mutt -e 'set editor=$EDITOR' -e 'unset signature' -H "$filename" > i.e. it runs a separate mutt in "compose a message from this template > mode" > > So there you are in screen composing a message in a standalone mutt. > You can complete it right there and send, exiting the standalone mutt. > Or you can detach from screen and resume that process later. > > Either way, as far as your original mutt is concerned, muttedit exits > and the composition file is unchanged, so it queitly returns to your > index view or whatever. > > This is nearly seamless. Cheers,
This is really great Cameron. I'll certainly give that a go. It should be trivial to use or tweak it for use in tmux.