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-02 21:41:53
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.

David

_______________________________________________
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>