nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] What am I doing wrong: refile -retainsequences, when src and destination are the sane directory

2014-08-03 09:43:28
David Levine <levinedl(_at_)acm(_dot_)org> writes:
Ken wrote:

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.

Agreed, and I just committed that.  Let me explain what I did so
that it can be readily reviewed, because this change affects the
operation of refile(1) even without -retainsequences.

All of the changes are in uip/refile.c.  There are two
significant changes:

1) If the source and destination folder are the same, instead of
calling folder_read() on both, just copy the result of
folder_read() on the source folder to the destination
folder's folders[] entry (fp->f_mp in the loop).  Simple
enough.

2) If the source and destination folder are the same, don't
indicate that the new message is selected so that 1)
folder_delmsgs() doesn't delete it later and 2) it is not
reflected in mp->hghsel, and therefore won't be assigned to
be the current message.

This happens after the message has been copied to its
destination, so selecting the message would only affect
whether or not it's to be deleted and removed from sequences.

Thank you very much.

Would it work if I just replaced the old nmh-1.6/uip/refile.c with the one
implementing the bug fix and then rebuilt? If so, would you tell me how to get
the new new refile.c ?

    Norman Shapiro

_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>