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

Re: message preservation in composition buffer



=- Russell L. Harris wrote on Mon 20.Nov'06 at  3:18:48 -0600 -=

> It appears that Mutt assigns the filename to a message, and refuses
> to accept from the editor a message with any other filename.
> {...}
> I suppose that the best approach is to cut and paste the message
> into a regular xemacs window, complete the message, and then cut
> and paste the message back into a xemacs-called-by-mutt window.
> Another approach would be to print a copy of the message every
> five minutes or so, until composition is complete.

Sure, because mutt waits for the editor to finish the file it was
given, it has no AI to check for anything else the editor might
return. But ... you can define a wrapper script as mutt's $editor,
which copies the msg given by mutt to some scratch space, where
you edit the copied file, and then copy the edited stuff back to
the file mutt expects:

        EDITFILE=$TRASHDIR/$RANDOMFILE
        cp -f $1 $EDITFILE
        real-editor $EDITFILE
        cp -f $EDITFILE $1

Now since mutt doesn't cleanup this TRASHDIR, you'll have to do it
yourself, manually or however automatically.

> After investing an hour in the composition of such a message, it
> is quite frustrating to have the message disappear simply
> because I pressed the wrong key.

In your editor: save occasionally, *emacs has autosave. In
combination with mutt either see above or make your real editor
(via macros?) save intermediate versions somewhere else.
In mutt you can define a macro to write-fcc for whatever key you
mistakenly type before it executes the intended function. Purging
again is up to you.

=- Russell L. Harris wrote on Mon 20.Nov'06 at  4:01:00 -0600 -=

> I find that, having sent the previous message, the file
> "~/.mutt/tmp/mutt-cromwell-1000-10686-0~" was not deleted. So,
> simply by saving the file occasionally during composition, the
> problem is solved.

You just have to get used to it. Many good things don't help
because they don't become good habit.

> I recall saving the file which I lost. So perhaps switching
> "tempdir" from the default value ("/tmp") to "~/.mutt/tmp" has
> something to do with the previous file loss?

No, as pointed out by others, mutt cleans up only its own mess,
editor backups are/ must be taken care of by something else.

> I did not reboot the machine after the file disappeared, but
> perhaps whatever mechanism manages "/tmp" automatically discards
> files with names ending in "~"?

Maybe some tmpskulker, see cron jobs.

-- 
© Rado S. -- You must provide YOUR effort for your goal!
Even if it seems insignificant, in fact EVERY effort counts
for a shared task, at least to show your deserving attitude.