nmh-workers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nmh-workers] Clearing `cur' Message.


From: David Levine
Subject: Re: [Nmh-workers] Clearing `cur' Message.
Date: Sun, 14 Oct 2012 14:25:56 -0500

> Perhaps have mark work on it as it already partially does.  `mark -seq
> cur -delete all'.

How about this, Ralph?  Instead of setting "cur" to 0, it
ends up removing it from .mh_sequences.  That's the same
state as never having set cur.

David


diff --git a/sbr/seq_del.c b/sbr/seq_del.c
index 8c353f3..2818d88 100644
--- a/sbr/seq_del.c
+++ b/sbr/seq_del.c
@@ -80,8 +80,14 @@ seq_delsel (struct msgs *mp, char *cp, int public, int zero)
      * Now clear the bit on all selected messages
      */
-    for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++)
+    for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) {
        if (is_selected (mp, msgnum))
            clear_sequence (mp, i, msgnum);
 
+       if (! strcmp ("cur", cp)  &&  mp->curmsg == msgnum) {
+           /* Removed current message indication, so reset curmsg. */
+           mp->curmsg = 0;
+       }
+    }
+
     /*
      * Set the public/private bit for this sequence.
diff --git a/test/sequences/test-mark b/test/sequences/test-mark
index 96a7e3d..cd3aedf 100755
--- a/test/sequences/test-mark
+++ b/test/sequences/test-mark
@@ -81,3 +81,7 @@ folder -create +other > /dev/null
 run_test 'mark +other -sequence unseen all' 'mark: no messages in other'
 
+# Test removal of indication of cur message.
+mark +inbox -sequence cur -delete all
+run_test 'pick -nolist cur' 'pick: no cur message'
+
 exit $failed



reply via email to

[Prev in Thread] Current Thread [Next in Thread]