before this patch, if messages are displaied with a pager and during
that time a new message comes to the folder. The new message is added
to the unseen sequence. But after closing the pager the unseen sequence
gets overwritten and the new message is removed from the unseen
sequence.
Now the sequence file gets reread before remove the shown messages
from the unseen sequenece.
' 0 1 2 15
failed=0
+#fake sleeps 60 secounds and then reads all input
+mmh_test_fakepager()
+{
+ sleep 60
+
+ while read a
+ do
+ sleep 0
+ done
+ exit 0
+}
test_skip()
{
--- /dev/null
+#!/bin/sh
+######################################################
+#
+# Test change of sequence during show
+#
+######################################################
+
+. "$MH_TEST_COMMON"
+
+mark -sequence u -add -nozero 1-9
+show 1-8 | mmh_test_fakepager &
+pagerpid=$!
+
+#because the fakepager sleeps 60 secounds the unseen sequence should be unchainged
+#this can fail if the buffer of the pipe is big enouth to hold all messages
+runandcheck "pick u" <<!
+1
+2
+3
+4
+5
+6
+7
+8
+9
+!
+mark -sequence u -add -nozero 10
+runandcheck "pick u" <<!
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+!
+pkill -P $pagerpid
+wait $pagerpid
+
+runandcheck "pick u" <<!
+9
+10
+!
if (is_selected(mp, msgnum))
set_unseen(mp, msgnum);
- seq_setunseen(mp, 0); /* unset unseen seqs for shown msgs */
-
cts = mh_xcalloc(mp->numsel + 1, sizeof(*cts));
ctp = cts;
/* If reading from a folder, do some updating */
if (mp) {
+ seq_read(mp);
+ seq_setunseen(mp, 0); /* unset unseen seqs for shown msgs */
context_replace(curfolder, folder); /* update current folder */
seq_setcur(mp, mp->hghsel); /* update current message */
seq_save(mp); /* synchronize sequences */