On Wednesday, 03 August 2005 at 11:36, Thomas Roessler wrote: > On 2005-08-02 00:35:17 -0700, Brendan Cully wrote: > > > How's this? > > I'd put this information into the BODY structure, to keep it close > to "unlink"; see below. I thought of that, but preferred to have the state exist only where it might actually do something. BODY is used in practically every file in mutt, and almost none of them need to worry about whether mutt owns the file. So almost everywhere but in compose.c, unowned is just clutter.I don't feel strongly about it though. > On another note, I'm not even convinced that this entire thing is a > bug that needs fixing... The more I think about this the more I > think the original behavior is the right one, and the patch should > be backed out again. I guess my argument is that toggle-unlink is intuitively like the difference between save-message and copy-message: first you move the attachment somewhere else, then you unlink it. In normal usage (when you send or postpone the message), mutt behaves non-destructively. Having it actually destroy something that can't be recreated, with no warning, seems a little less intuitive. > In particular if you consider that the attachments in question will > also be deleted from the disk when you *cancel* a message. Now, why > on earth should mutt treat an attachment differently when the > *attachment* is cancelled than when the *message* is cancelled? It shouldn't. My take on this is that a bug remains in OP_EXIT :) Patch attached.
Index: compose.c =================================================================== RCS file: /home/roessler/cvs/mutt/compose.c,v retrieving revision 3.24 diff -u -p -r3.24 compose.c --- compose.c 2 Aug 2005 14:39:56 -0000 3.24 +++ compose.c 3 Aug 2005 14:20:13 -0000 @@ -1146,6 +1146,8 @@ int mutt_compose_menu (HEADER *msg, /* /* avoid freeing other attachments */ idx[idxlen]->content->next = NULL; idx[idxlen]->content->parts = NULL; + if (idx[idxlen]->unowned) + idx[idxlen]->content->unlink = 0; mutt_free_body (&idx[idxlen]->content); FREE (&idx[idxlen]->tree); FREE (&idx[idxlen]);
Attachment:
pgpuakdppcso0.pgp
Description: PGP signature