nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] Relative Message Numbers

2013-03-25 08:42:52
David Levine <levinedl(_at_)acm(_dot_)org> writes:
Norm wrote:

If foobar is a message sequence then something like forbar+3, for
the third message of foobar, would make my life a bit easier.

Even better, would be to allow forbar+3,4 and foobar
forbar+3-5. Then, recursively, and perhaps a bit fancifully, since
forbar+3-5 is a message sequence, forbar+3-5+2 would be
meaningful. If foobar has had a least four messages it would denote
the fourth messages of foobar.

I agree with Robert and Ken.

The shell function below is another way to handle the simple
case:  pn forbar 3 4

Or, load each of the message numbers into a bash array and do
all kinds of fancy things with those.

I just don't think that native support would be useful enough
to justify the complexity.

David


# first argument is sequence name
# second argument is n'th message of sequence
# optional third argument is number of messages, default 1
function pn {
pick $1 | tail -n +$2 | head -${3:-1}
}

This comes very close to meeting my needs -- much better than the folder trick. 
I will try it for a few week to see how it goes. Certainly, at this a point in 
my life, I could never have come up with it. Thank you very much.


    Norman Shapiro

_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

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