Possible unofficial fix for the Elm problem.

Rich Burridge (richb@stard)
Fri, 19 Jun 1992 13:09:58 +1000

I've just received this. I'm too busy to integrate it and send out an
official faces patch, so I'm just forwarding it here for now. Hopefully
I'll be in better shape in a month or two...

--- Forwarded mail from pod@suite.sw.oz.au (Paul O'Donnell)

>From acsnet@sunaus Fri Jun 19 12:20:29 1992
From: pod@suite.sw.oz.au (Paul O'Donnell)
Subject: faces fixes
To: richb@sunaus.sun.oz
Date: Fri, 19 Jun 92 12:19:03 EST
Organization: Softway Pty Ltd
X-Face: #mT^U,17J-aUFAO![bO5%!!8(!&pY+pxsx3W"6*}&"{36w_~[(4ov.NM6<
\T82Y%zp$@Z>c>8%yV2+&"G`xsq.TH/}J7(SaAM=IC3XUMQA4>Gut4pF`z
|)~rn!IqaV#HwH){R6I?Ue_2KS c/B\oWEuW+Z#5Oa\&,jH;V6jXmGcbS@
X-Mailer: ELM [version 2.3 PL11]

Two fixes:

There was a magic number 10 in make_pixrect(). This caused the
faces window to be the wrong size when the number of mail items
was between maxcols and 10.

When elm resyncs your mailbox, it resets the modification time back
to what it was. do_mail() checks this time and if it has not changed,
does nothing. Thus, even with -MH set, deleting mail does not cause
the faces window to shrink. This has been fixed by looking at the
inode modification time too.

Here are the diffs:

38a39
> static time_t lastctime = 0 ; /* or if the inode has changed */
276c277,282
< if (buf.st_mtime == lastmtime)

---
>   /*
>    * Elm, among other mailers, resets the modification time
>    * of a file after it resyncs your mailbox.  We can tell whether
>    * this has happened by checking the inode time.
>    */
>   if (buf.st_mtime == lastmtime && buf.st_ctime == lastctime)
281a288
>   lastctime = buf.st_ctime ;
517a525,528
>   /*
>    * Save the inode time too.
>    */
>   lastctime = (time_t) 0 ;
595c606
<   if (count <= 10)
---
>   if (count <= maxcols)

-- 
pod@softway.sw.oz.au                    | Gaffer tape is like the force,
Softway Pty Ltd                         | It has a light side and a dark
Phone:   +61 2 698-2322                 | side and it binds the universe
Fax:     +61 2 699-9174                 | together.

--- End of forwarded message from pod@suite.sw.oz.au (Paul O'Donnell)