[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nmh-workers] What am I doing wrong: refile -retainsequences, when s
Re: [Nmh-workers] What am I doing wrong: refile -retainsequences, when src and destination are the sane directory
Mon, 16 Jun 2014 23:49:14 -0400
>1) copies the old message to the new file
>2) adds the new message number to the sequence
>3) removes the old message number from the sequence
>It writes the sequences file out in step 2), so you can see
>both the old and new message numbers in the sequence then.
>I don't know why it clobbers the new message number in step 3).
>I haven't unravelled the struct msgs data structure and the
>operations on it. Anyone?
They're both operating on the same sequence file. I suspect the case
is something like this:
0) open source folder "inbox" using mp1, open dest folder "inbox" using mp2.
1) Copy message "12" to message "21".
2) Add 21 to sequence in mp1 and write out sequence file.
3) Remove 12 from sequence in mp2 write out sequence file.
See the problem? Step 3 writes out the the same sequence file again;
it doesn't "know" that message 21 got added to the sequence, since that
happened using a different folder message structure.
It looks like the only true solution would be to have refile recognize
the special case where the source and destination folder are the same
and use the same structure for both. Sigh. I lack the energy to
do this right now. I suspect a "correct" solution might involve
folder_read() detecting that it's the same folder and returning a
reference to the previously opened folder. Seems like a lot of work
for this one particular case.