Re: [Nmh-workers] showing the n messages 'around' a particular message

2006-01-19 Thread Robert Elz
Date:Wed, 18 Jan 2006 20:44:42 +0700 From:Robert Elz <[EMAIL PROTECTED]> Message-ID: <[EMAIL PROTECTED]> | Usage is | xxx [any non message designator scan args] [-N] [A:[[-]N]] That should have (of course) been ... xxx [any non message designator scan

Re: [Nmh-workers] showing the n messages 'around' a particular message

2006-01-19 Thread Oliver Kiddle
Joel Reicher wrote: > I believe this will work, and doesn't have the problem with gaps in > message numbers that kre's script does. How about the following: last=`mhpath first:$((2*n)) cur:$n|tail -1` last=${last##*/} scan $last:-$((2*n)) Oliver This e-mail and any attachment is for authorised

Re: [Nmh-workers] showing the n messages 'around' a particular message

2006-01-19 Thread Joel Reicher
> Joel Reicher wrote: > > I believe this will work, and doesn't have the problem with gaps in > > message numbers that kre's script does. > > How about the following: > > last=`mhpath first:$((2*n)) cur:$n|tail -1` > last=${last##*/} > scan $last:-$((2*n)) Wow. Super clever. Doesn't work if cur

Re: [Nmh-workers] showing the n messages 'around' a particular message

2006-01-18 Thread Joel Reicher
> - Get a list of messages from "mhpath all" or "mhpath cur:-N cur:N" Clever. That solves the problem I was having with pick doing this in Bourne shell. I believe this will work, and doesn't have the problem with gaps in message numbers that kre's script does. pre=$((`mhpath cur:-$n|wc -l`)) if

Re: [Nmh-workers] showing the n messages 'around' a particular message

2006-01-18 Thread Jerry Peek
On 17 January 2006 at 22:36, [EMAIL PROTECTED] wrote: > A friend was trying to sort out a suitable shell alias/function for > doing a scan of the N messages 'around' the current one, by which I > mean something like "cur:-X cur:X" where X is N/2, except that if there > aren't X messages after cur y

Re: [Nmh-workers] showing the n messages 'around' a particular message

2006-01-18 Thread Robert Elz
Date:Tue, 17 Jan 2006 22:36:44 + From:[EMAIL PROTECTED] Message-ID: <[EMAIL PROTECTED]> | A friend was trying to sort out a suitable shell alias/function for | doing a scan of the N messages 'around' the current one, Try the following, which I think is approxi

Re: [Nmh-workers] showing the n messages 'around' a particular message

2006-01-17 Thread Joel Reicher
> scan cur:-$n | awk '{ line[NR]=$0 } END { i=(2*NR) an next:"i | getline line[++NR]) if(NR>n) start++; while(start [++start] }' n=$n Hmm. That's more complicated than it needs to be. scan cur:-$n | awk '{ line[NR]=$0 } END { i=(2*NR)http://lists.nongnu.org/mailman/listinfo/nmh-workers

Re: [Nmh-workers] showing the n messages 'around' a particular message

2006-01-17 Thread Joel Reicher
> A friend was trying to sort out a suitable shell alias/function for > doing a scan of the N messages 'around' the current one, by which I > mean something like "cur:-X cur:X" where X is N/2, except that if there > aren't X messages after cur you show more of the messages from before > cur, and vi

[Nmh-workers] showing the n messages 'around' a particular message

2006-01-17 Thread pmaydell
A friend was trying to sort out a suitable shell alias/function for doing a scan of the N messages 'around' the current one, by which I mean something like "cur:-X cur:X" where X is N/2, except that if there aren't X messages after cur you show more of the messages from before cur, and vice-versa,