- * 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.
+ */
+
+ 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);
+
+ /*
+ * Close destination folders now; if we are using private sequences
+ * we need to have all of our calls to seq_save() complete before we
+ * call context_save().