[Top][All Lists]

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

Re: [Nmh-workers] Relative Message Numbers

From: Paul Fox
Subject: Re: [Nmh-workers] Relative Message Numbers
Date: Wed, 03 Apr 2013 08:25:38 -0400

bill wrote:
 > address@hidden writes:
 > > Ken Hornstein <address@hidden> writes:
 > >
 > >> Hm.  I'm torn.  So, it looks like it's okay in terms of syntax; "_" is
 > >> not a valid character in a sequence.  But what are the semantics if
 > >> 'name' refers to more than one message?
 > >
 > > Then name+n is the nth message of name; name_n is the nth to last message 
 > > of name.(1 based ordinals. That is, name+1 is the first message of name 
 > > and name_1 is the last message of name).
 > Hey Norm, how is this useful? I can't see anyone manually referring to
 > the nth item in a sequence on the command line. The point of a sequence

    $ scan unseen
    ...notice that third-from-end message is spam...
    $ refile unseen_3 +spam

 > is that you don't have to know the constituents. Maybe you have a use
 > case.
 > If this is for programmatic use, it seems that something like
 >     for i in $(mark -list -sequence cur | cut -f 1 -d " " --complement); do
 >         scan $i;
 >     done
 > would be clearer.
 > Saaay, it just occurred to me. Maybe we should adopt MH-E's syntax.
 > Norm, please check out MH-E ranges [1]. While it's not identical to your
 > specification, it sure is nifty for MH-E users. If this works for you,
 > maybe applying the same syntax to nmh would mean that many more users
 > would be more familiar with the syntax than with _.
 > http://mh-e.sourceforge.net/manual/html/Ranges.html

with the exception of the mh-interpret-number-as-range-flag flag,
i think everything described on that page is existing mh

you asked how the syntax norm requested was useful for sequences.  as
noted, mh already supports the notion of ranges within sequences: 
"unseen:3" is the first 3 unseen messages, and unseen:-5 is the last 5. 
those are both great if you want to work with a short block of

but you can't refer to a single message using that syntax, unless it
happens to be the first or last in the sequence (i.e., unseen:-1). 
the new "unseen+3" syntax lets you refer to the (single) third unseen

 paul fox, address@hidden (arlington, ma, where it's 30.4 degrees)

reply via email to

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