sure those changes are before calling rmmproc(). Update programs
that use folder_delmsgs() to make all changes to sequences and
the context before calling folder_delmsgs().
/* Mark that the sequence information has changed */
mp->msgflags |= SEQMOD;
/* Mark that the sequence information has changed */
mp->msgflags |= SEQMOD;
+ /*
+ * Write out the sequence and context files; this will release
+ * any locks before the rmmproc is called.
+ */
+
+ seq_save (mp);
+ context_save ();
+
vec = argsplit(rmmproc, &prog, &vecp);
/*
vec = argsplit(rmmproc, &prog, &vecp);
/*
/* Mark that the sequence information has changed */
mp->msgflags |= SEQMOD;
/* Mark that the sequence information has changed */
mp->msgflags |= SEQMOD;
+ /*
+ * Write out sequence and context files
+ */
+
+ seq_save (mp);
+ context_save ();
+
- * This is a hack. If we are using an external rmmproc,
- * then save the current folder to the context file,
- * so the external rmmproc will remove files from the correct
- * directory. This should be moved to folder_delmsgs().
+ * Update this now, since folder_delmsgs() will save the context
+ * but doesn't have access to the folder name.
- if (rmmproc) {
- context_replace (pfolder, folder);
- context_save ();
- fflush (stdout);
- }
+
+ context_replace (pfolder, folder); /* update current folder */
+
+ /*
+ * Adjust "cur" if necessary
+ */
+
+ if (mp->hghsel != mp->curmsg
+ && (mp->numsel != mp->nummsg || linkf))
+ seq_setcur (mp, mp->hghsel);
/* If -nolink, then "remove" messages from source folder.
*
/* If -nolink, then "remove" messages from source folder.
*
*/
if (!linkf) {
folder_delmsgs (mp, unlink_msgs, 1);
*/
if (!linkf) {
folder_delmsgs (mp, unlink_msgs, 1);
+ } else {
+ seq_save (mp); /* synchronize message sequences */
+ context_save (); /* save the context file */
}
clsfolds (folders, foldp);
}
clsfolds (folders, foldp);
- if (mp->hghsel != mp->curmsg
- && (mp->numsel != mp->nummsg || linkf))
- seq_setcur (mp, mp->hghsel);
- seq_save (mp); /* synchronize message sequences */
-
- context_replace (pfolder, folder); /* update current folder */
- context_save (); /* save the context file */
folder_free (mp); /* free folder structure */
done (0);
return 1;
folder_free (mp); /* free folder structure */
done (0);
return 1;
seq_setprev (mp); /* set the previous-sequence */
/*
seq_setprev (mp); /* set the previous-sequence */
/*
- * This is hackish. If we are using a external rmmproc,
- * then we need to update the current folder in the
- * context so the external rmmproc will remove files
- * from the correct directory. This should be moved to
- * folder_delmsgs().
+ * As part of the new world locking order, folder_delmsgs() now updates
+ * the sequence and context for us. But since folder_delmsgs() doesn't
+ * have access to the folder name, change the context now.
- if (rmmproc) {
- context_replace (pfolder, folder);
- context_save ();
- fflush (stdout);
- }
+
+ context_replace (pfolder, folder);
/* "remove" the SELECTED messages */
folder_delmsgs (mp, unlink_msgs, 0);
/* "remove" the SELECTED messages */
folder_delmsgs (mp, unlink_msgs, 0);
- seq_save (mp); /* synchronize message sequences */
- context_replace (pfolder, folder); /* update current folder */
- context_save (); /* save the context file */
folder_free (mp); /* free folder structure */
done (0);
return 1;
folder_free (mp); /* free folder structure */
done (0);
return 1;