Subject: Tab with MH incoming message folders

From: rose@.pa.dec.com (Stephen Rose)
Date: 21 Nov 1995 07:23:29 GMT

I've recently installed MH and converted all my pine folders to MH folders.
Also, I'm using procmail to separate my list server mail into incoming
message folders.  Everything seems to work just fine except for one thing.
When I try to tab to the next folder with unread messages, pine thinks that 
there are no incoming message folders with unread messages.  I see it quickly
cycle through all the incoming message folders and say that there are no
more incoming messages folders.  When I list the folders and go to a 
specific folder, there are clearly unread messages.  Does this really work
with MH folders?  I sure hope I can fix this.  It's very boring manually
visiting potentially empty folders.  Thanks.

---

From: Mark Crispin <[email-masked]>
Date: Tue, 21 Nov 1995 18:10:31 -0800

> visiting potentially empty folders.  Thanks.

Your observations are correct, and this will most likely be a long-term
deficiency with MH folder support.  The MH folder system does not provide
any place to maintain some of the information which Pine likes to maintain
about messages and the folder.  Much of this information is inferred, but
other information lasts only as long as the session lasts.

Here's the technical explanation, if your're interested:

Two of the interesting states of a message related to "newness" are the
"recent" and "seen" state of a message.  "Recent" is defined to mean "this
message appeared in the folder since the previous session"; "seen" is
defined to mean "the user has read this message in some way".  In formats
such as mbox or tenex, there are specific state flags kept in each message
that contain these (and other) states.

An addition semantic of "recent" messages is that the number of "recent"
messages should be available quickly.

"Recent" and "seen" are independent status.

With MH, both "recent" and "seen" are inferred from information read from
the folder directory (via readdir()) and file inodes (via stat()).  There
is no storage for the status in the message files themselves; nor would it
be particularly beneficial to do so because it'd be too slow to read it
from all the files.

The upshot of this is that in MH, "recent" means "this message appeared in
the folder since the start of *this* session" and "seen" is defined to
mean "the user has read the message during this sesson and/or the Unix
access time of the message file is greater than the Unix modification time
of the file".  A message can appear in the folder either because Pine
itself has transferred the file from /usr/spool/mail/$USER to the user's
#mhinbox, or because some other program has done so.

The TAB command in Pine checks a count of "recent" messages.  When just
scanning folders, this count will always be zero, hence the behavior that
you observed.

-- Mark --

DoD #0105, R90/6 pilot, FAX: (206) 685-4045  ICBM: N 47 39'35" W 122 18'39"
Science does not emerge from voting, party politics, or public debate.

---

From: Mike Brudenell <[email-masked]>
Date: Wed, 22 Nov 1995 16:26:40 +0000 (GMT)

> scanning folders, this count will always be zero, hence the behavior that

Mark -

Are you saying that the Tab key actually scans for the next Recent
message?  If so, Pine's Help screen for the Folder Index intriguingly
says the following: 

: MESSAGE TEXT Screen Commands   B  Bounce                       *  Flag
: ----------------------------
:  G   Goto a specified folder     General Pine Commands
:  H   Full Header Mode            ---------------------
: Tab  Next New                    O  Show all other available commands
  ^^^^^^^^^^^^^

(Apologies if I've misunderstood your comment and got hold of the wrong end 
of the stick!)

Mike Brudenell                                         <[email-masked]>
------------------------------------------------------------------------
The Computing Service, University of York, Heslington, York, YO1 5DD, UK
Tel: +44-1904-433811  FAX: +44-1904-433740  http://www.york.ac.uk/~pmb1/

---

From: Terry Gray <[email-masked]>
Date: Wed, 22 Nov 1995 16:40:08 -0800 (PST)

Mike,
There is an inconsistency between what TAB does within a folder, and what
it does *between* folders.  The help text is correct for the first case,
but when you are at or past the last *new* message in a folder and press
TAB, it will scan the incoming folder list looking for the next folder
with any *recent* messages in it.

We have debated whether this behavior is "correct", but that's the way it
works today.

-teg

---

From: Terry Gray <[email-masked]>
Date: Wed, 22 Nov 1995 23:25:37 -0800 (PST)

Yes, that's right... I neglected to mention that TAB stops at either NEW
(unseen) or IMPORTANT messages within a folder.

-teg

On Thu, 23 Nov 1995, Andrej Borsenkow wrote:

> On Wed, 22 Nov 1995, Terry Gray wrote:
>
> > Mike,
> ... skipped ...
> It seems to be not QUITE so. If I press TAB in a folder, I jump to the
> next MARKED message (not neccessarily NEW). It could be e.g. Important
> (marked with *). At least it is so by me. I am using 3.91 for Windows;
> all folders are remote.
>
> Is the behavior correct?
>
> greetings
>
> ----------------------------------------------------
> Andrej Borsenkow        E-Mail: [email-masked]
> SNI ITS, Moscow         Phone:  +7 (095) 252 13 88
> ----------------------------------------------------
>

---

From: Andrej Borsenkow <[email-masked]>
Date: Thu, 23 Nov 1995 10:23:38 +0300 (EET)

... skipped ...

Is the behavior correct?

greetings

---

From: Rahul Dhesi <[email-masked]>
Date: 26 Nov 1995 03:33:35 GMT

In <loo-ong-message-id> Mark Crispin <[email-masked]> writes:

>The MH folder system does not provide
>about messages and the folder....
...
>..."seen" is
>defined to mean "the user has read this message in some way".
...
>the folder directory (via readdir()) and file inodes (via stat()).

MH does keeps track of whether a message has been seen or not, via the
'unseen' sequence.  Once the user defines this sequence in his
.mh_profile with a line like

     unseen-sequence: unseen

all the MH utilities will create, delete, and update this sequence as
needed.  Thus you can scan for all unseen messages with 'scan unseen',
or scan for all seen messages with 'scan ^unseen' (assuming you defined
the ^ character for sequence negation), or see all unseen messages with
'show unseen', etc.

Other software could well maintain other information, such as another
sequence called 'recent', though of course this would be neither used
nor updated by MH-specific utilities.  But since MH does maintain a
'cur' sequence that remembers which message was last read, it's not
clear to my why one needs 'recent' at all.  Assuming the user reads
messages sequentially, 'cur' will indicate where the user should
continue reading where he left off.

I will append below a portion of the 'man .mh_profile' online manual.

     Unseen-Sequence: unseen
               Names the sequences which should be defined as
               those messages recently incorporated by inc.  Show
               knows to remove messages from this sequence once
               it thinks they have been seen.  If not present, or
               empty, no sequences are defined.  Otherwise, for
               each name given, the sequence is first zero'd and
               then each message is added to the sequence.  (pro-
               file, no default)
-- 
Rahul Dhesi <[email-masked]>
"please ignore Dhesi" -- Mark Crispin <[email-masked]>