On Wed, Jul 06 2016, Nicolas Richard wrote:
> I've been observing an annoying behaviour for a long time and finally
> took a closer look this morning. Here's what I have found :
>
> When composing a new message, mu4e picks a filename for saving it to
> disk as a draft. Let's say it's called `draftname`. Now if offlineimap
> runs in the background, it will actually rename that file to something
> else, behind emacs' back. If you save the same buffer again, it'll write
> to the old name (`draftname`), hence creating a second file for the same
> message.
>
> Here's an example of a filename that got renamed :
> 1467805728.a37c58e0dd3aee73.localhost:2,DS
> became, after a run of offlineimap :
> 1467806963_0.7963.localhost,U=247391,FMD5=f03ab16cd58372c77ba45a3d9a5a1cb9:2,DS
> (I checked it's the same inode number).
>
> Do you have any suggestion to avoid the problem ? i.e. avoid having
> multiple drafts or at least have them removed when sending the message.
For this very reason, I disabled auto-save in compose-mode buffers:
,----
| ;; disable auto-save for email: since I have set
| ;; auto-save-visited-file-name, auto-save seems to leave multiple copies of
| ;; a message in the drafts folder. this is not nice.
| (add-hook 'mu4e-compose-mode-hook #'(lambda () (auto-save-mode -1)))
`----
The comment claims it's dependent on `auto-save-visited-file-name` being
non-nil, but I don't remember what I did back then to test this. Do you
set this variable to t in your config?
I've long since reverted `auto-save-visited-file-name` to nil, because
it also caused problems with org-capture. Perhaps I should just try
removing that line from my config. ;-)
--
Joost Kremers
Life has its moments