nmh-workers
[Top] [All Lists]

Re: check if message is in a particular sequence?

2021-04-30 10:19:06
ken wrote:
Thanks.  Seems...  overkill...  to have to fire up a parsing language,
but it will definitely work.

Remind me ... how many parsing languages get fired up for a random Unix
command on a modern Unix system, today? :-)

Touché!

It also seems like mark(1) could do it.  Currently it ignores its
message args if -list is given.  It could be enhanced so that if
message args are given, then -list would only output sequence
membership for the given args.

...time passes...

I have a partial patch for mark which does what I described.  Don't
know whether it's worth it or not.

I think that would make sense to me; I cannot think of a reason why that
wouldn't generally be useful.

I have a patch, including man page and test script changes.  The
change is somewhat backward-INcompatible, in that previously, "mark
-list" ignored any supplied "msgs".  Now they make a difference.

    $ mark -list
    cur: 1
    odd: 1 3 5 7 9
    even: 2 4 6 8 10

    $ mark -seq even -list
    even: 2 4 6 8 10

    $ mark -seq even -list 2-6
    even: 2 4 6         <-- previously output was "even: 2 4 6 8 10"

    $ mark -seq odd -list 2-6
    odd: 3 5            <-- previously output was "odd: 1 3 5 7 9"

    $ mark -list 2-6    <-- previously behaved as "mark -list", above
    odd: 3 5
    even: 2 4 6

    $ mark -list 1-4    <-- previously behaved as "mark -list", above
    cur: 1
    odd: 1 3
    even: 2 4

From the new man page:
    The -list switch tells mark to list the messages associated with
    sequences specified by a -sequence switch, or with any sequences if no
    -sequence switch is present.  If the sequence is private, this will be
    indicated.  If msgs are specified, then only the sequence memberships
    for the given messages are shown, either for all sequences, or just
    for those named by -sequence switches.  The -zero switch does not
    affect the operation of -list.

Are we in any kind of waiting period for the next release?

Any objections if I commit to master?

paul
=----------------------
paul fox, pgf@foxharp.boston.ma.us (arlington, ma, where it's 57.2 degrees)


<Prev in Thread] Current Thread [Next in Thread>