I originally wrote:

>I just noticed that
>
>       mhpath cur
>
>produces the same results as
>
>       mhpath new
>
>if there is no current message.  Looking at the code, it seems
>deliberate, but why?  Acts like a bug to me.

Neil wrote:

> I just tested, and got
>
>       6% mhpath cur
>       mhpath: no cur message
>
> It seems that if the "cur" sequence is defined, but there is no
> message of that number, mhpath will return that path to the indicated
> message anyway.  If the "cur" sequence is not defined at all, it
> returns "no cur message".
>
> This seems right to me.

 -NWR

Sean wrote:
> I set my .mh_sequences "cur=120" in a folder with only 17 messages,
> and 'mhpath cur' return nothing.
>
> However, if I set it to a number inside an unused range, I get the
> next lowest message (ie., I have a folder with 1-187, 215-250.  I set
> cur=200, and mhpath (and folder) return  187.
>
> Also seems right to me.
>
> Sean

OK, here's what I'm seeing.

I just incorporated the messages from each of you.  These ended up being message
numbers 3913-3916 (because you each cc'd me in addition to posting to the list
list so I got two of each) in my inbox, located in /export/home/jon/Mail/inbox.  

I deleted (rmm) message 3916.  I then did "mhpath cur" and it returned

        /export/home/jon/Mail/inbox/3916

This is the same thing that "mhpath new" returns.  I would expect "cur" to say
"no cur message" and "new" to return the above.

I see the following line in uip/mhpath.c:

        mp->msgflags |= ALLOW_NEW;  /* allow the "new" sequence */

Then, m_convert is called, and hits the following code in m_convert.c

        if (mp->msgflags & ALLOW_NEW) {
                    set_select_empty (mp, first);
                } else {
                    if (first > mp->hghmsg
                        || first < mp->lowmsg
                        || !(does_exist (mp, first))) {
                        if (!strcmp (name, "cur") || !strcmp (name, "."))
                            advise (NULL, "no %s message", name);
                        else
                            advise (NULL, "message %d doesn't exist", first);
                        return 0;
                    }
                }

So I guess that I don't understand how Neil and Sean are seeing what they're
seeing.

Jon

Reply via email to