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: Ralph Corderoy
Subject: Re: [Nmh-workers] Clearing `cur' Message.
Date: Sun, 14 Oct 2012 23:13:40 +0100

Hi David,

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

Sounds good.

> @@ -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;
> +       }
> +    }
> +

Does the test need to be in the for-loop, running on every message?
Perhaps

    if (!strcmp(cp, current) &&
        mp->curmsg >= mp->lowsel && mp->curmsg <= mp->hghsel) {
        /* Removed current message indication, so reset curmsg. */
        mp->curmsg = 0;
    }

afterwards?  (Note use of `current'.)

Cheers, Ralph.



reply via email to

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