Some ideas/code for faces

Tim Chown (T.J.Chown@ecs.southampton.ac.uk)
Fri, 10 May 91 11:57:18 BST

I have installed faces, and have some suggestions/code which may be
considered for inclusion in the official version. My comments are
made wrt faces 1.5.1 ...

1. If the mail spool shrinks (ie. the user deletes mail) then the
window should adjust; the -MH option doesn't seem to work for
me in this respect. Using -MH is a little misleading as I use
Elm and that can shrink the mail spool file too, so perhaps
the man page (and option name) should reflect this.

To get the shrinking to work (on a Sun3/SPARC) I needed the
following changes (I used an extra global boolean, yuk) ...
main.c add int mboxshrunk = 0; to the initial defs
extern.h add extern int mboxshrunk; to the defs.
mon.c some brackets were needed on line 359:
(mhflag && (buf.st_size < lastsize) && (buf.st_size != 0)))
and change line 361:
if (buf.st_size < lastsize) {lastsize = 0; mboxshrunk = 1;}
and reset the boolean at line 417:
mboxshrunk = 0;
x11.c Use the mboxshrunk boolean (lines 640 & 665) ...
if (beep_and_raise && raisewindow && newmail && !mboxshrunk)
if (beep_and_raise && newmail &!mboxshrunk) beep_flash(beeps, flashes)
Changes would be needed to xview.c, sunview.c, etc akin to x11.c.

2. The remote host monitoring wouldn't work either. This needed a
different variable rhostname to be used with -H rather than hostname
which was getting overwritten (so that localhost was always seen!).
main.c add char *rhostname ;
extern.h add extern char *rhostname ;
get.c Change line 176:
getparam(&rhostname, argv, "-H needs hostname");
mon.c Use the rhostname variable on lines 674,675:
if (rhostname == NULL) read_str(&rhostname, "localhost") ;
SPRINTF(command, USERSDEF, rhostname) ;

3. The addition of the option -l window_label is desirable; the default
label is "faces" which is a bit nondescript. Maybe there's a cunning
way to do this, but the following code allows -l to work (for x11
at least); a change to the man page would also be needed.
main.c Add char *faceslabel ;
extern.h Add extern char *faceslabel ;
get.c Add an extra branch to the command line parsing:
case 'l' : INC ;
getparam(&faceslabel ,argv,"-l needs window label");
break;
main.c Set up default label (line 228):
read_str(&faceslabel, "faces");
x11.c Use the label ... line 558 ...
XSetStandardProperties(dpy, frame[F_WINDOW], faceslabel , faceslabel , None,

4. Don't take sounds for mail when first reading in the mail spool
file. Just play them for new mail:
mon.c Edit line 221: if ((do_audio) && (!firsttime))

These four changes are simple and I think quite worthwhile. Any
comments welcome. The changes for x11.c should be replicable in the
other windows interface programs. Apologies for not providing them
as true patches :-(

Tim