[comp.mail.mush] Official Patch #1 for Mush-7.0

schaefer@ogicse.ogc.edu (Barton E. Schaefer) (12/14/89)

This is the first official patch for Mush-7.0.  Complete sources with this
patch applied are available for ftp from

	ucbvax.berkeley.edu:pub/mailers/mush-7.0.tar.Z

	cse.ogi.edu:pub/mush/mush-7.0.tar.Z

Changes/Fixes in this patch:

    Attempted to fix problems with textsw handling on SunOS 3.5.  This is
    the shakiest part of the patch since I have no 3.5 Suns to test on.
    Thanks to Rich Burridge for suggestions.

    Bogus Bcc: headers in logfiles eliminated.

    Added Tom Neff's change for -F! so it won't complain about redirection.

    Improved/expanded the description of script usage in the man page.

    Some miscellaneous lint warnings dealt with.  Thanks to Larry Virden.

    Put notes for Ultrix in makefile.bsd where they're easier to spot.

*** /tmp/,RCSt1009684	Wed Dec 13 14:07:35 1989
--- commands.c	Wed Dec 13 09:46:35 1989
***************
*** 1125,1131 ****
  	int c, n = 1;
  	while (c = argv[0][n++])
  	    switch(c) {
! 		when 'h': comp_hdr++;
  		when 'p': as_prompt++;
  		when 'm': as_macro++;
  		otherwise: return help(0, "eval", cmd_help);
--- 1125,1131 ----
  	int c, n = 1;
  	while (c = argv[0][n++])
  	    switch(c) {
! 		case 'h': comp_hdr++;
  		when 'p': as_prompt++;
  		when 'm': as_macro++;
  		otherwise: return help(0, "eval", cmd_help);
*** /tmp/,RCSt1009684	Wed Dec 13 14:07:39 1989
--- execute.c	Wed Dec 13 10:56:13 1989
***************
*** 42,51 ****
--- 42,56 ----
      print("Editor done.");
      msg_rect = *((Rect *) window_get(tty_sw, WIN_RECT));
      (void) window_set(tty_sw, WIN_SHOW, FALSE, NULL);
+ #ifdef ALERT_ATTR /* SunOS 4.0+ */
      (void) window_set(msg_sw,
  	WIN_SHOW,		TRUE,
  	TEXTSW_FILE_CONTENTS,	file,
  	NULL);
+ #else /* ALERT_ATTR */
+     textsw_load_file(msg_sw, file, 1, 0, 0);
+     textsw_set(msg_sw, WIN_SHOW, TRUE, NULL);
+ #endif /* ALERT_ATTR */
      textsw_normalize_view(msg_sw, (Textsw_index)0);
      (void) unlink(file);
  
*** /tmp/,RCSt1009684	Wed Dec 13 14:07:40 1989
--- file.c	Wed Dec 13 09:51:01 1989
***************
*** 141,150 ****
      if (x) {
  	/* if x == 1, then path is a directory */
  	wprint("is a directory.\n");
! 	return;
      } else if (!(tmp_fp = fopen(file, mode))) {
  	wprint("%s\n", sys_errlist[errno]);
! 	return;
      } else if (*mode != 'r') {
  	rewind(fp);
  	for(x = 0; fgets(buf, BUFSIZ, fp); x++)
--- 141,150 ----
      if (x) {
  	/* if x == 1, then path is a directory */
  	wprint("is a directory.\n");
! 	return -1;
      } else if (!(tmp_fp = fopen(file, mode))) {
  	wprint("%s\n", sys_errlist[errno]);
! 	return -1;
      } else if (*mode != 'r') {
  	rewind(fp);
  	for(x = 0; fgets(buf, BUFSIZ, fp); x++)
*** /tmp/,RCSt1009684	Wed Dec 13 14:07:47 1989
--- mail.c	Wed Dec 13 10:03:30 1989
***************
*** 1005,1013 ****
      FILE *files[30];  /* 30 should be sufficiently large enough */
      char *names[30];
  #endif /* MAXFILES */
! #ifdef VERBOSE_ARG
      SIGRET (*oldchld)();
! #endif /* VERBOSE_ARG */
      int next_file = 1; /* reserve files[0] for the mail delivery program */
      int log_file = -1; /* the index into the files array for mail logging */
      char buf[3*HDRSIZ];
--- 1005,1013 ----
      FILE *files[30];  /* 30 should be sufficiently large enough */
      char *names[30];
  #endif /* MAXFILES */
! #if defined(VERBOSE_ARG) && !defined(SUNTOOL)
      SIGRET (*oldchld)();
! #endif /* VERBOSE_ARG && !SUNTOOL */
      int next_file = 1; /* reserve files[0] for the mail delivery program */
      int log_file = -1; /* the index into the files array for mail logging */
      char buf[3*HDRSIZ];
***************
*** 1136,1153 ****
      /* expand Bcc addrs, but don't add to list yet.  sign letter first */
      if (isoff(flags, EDIT_HDRS))
  	orig_bcc = savestr(Bcc);
!     if (*Bcc && !(p = alias_to_address(Bcc))) {
! 	wprint("address expansion failed for Bcc: list.\n");
! 	free_vec(&names[1]);
! 	/* rm_edfile(-1); */
! 	if (isoff(flags, EDIT_HDRS)) {
! 	    strcpy(To, orig_to), xfree(orig_to);
! 	    strcpy(Cc, orig_cc), xfree(orig_cc);
! 	    strcpy(Bcc, orig_bcc), xfree(orig_bcc);
  	}
- 	return -1;
      } else
! 	p = strcpy(Bcc, p);
  
      /* Sign the letter before adding the Bcc list since they aren't
       * considered when adding a signature.
--- 1136,1157 ----
      /* expand Bcc addrs, but don't add to list yet.  sign letter first */
      if (isoff(flags, EDIT_HDRS))
  	orig_bcc = savestr(Bcc);
!     if (*Bcc) {
! 	if (p = alias_to_address(Bcc))
! 	    p = strcpy(Bcc, p);
! 	else {
! 	    wprint("address expansion failed for Bcc: list.\n");
! 	    free_vec(&names[1]);
! 	    /* rm_edfile(-1); */
! 	    if (isoff(flags, EDIT_HDRS)) {
! 		strcpy(To, orig_to), xfree(orig_to);
! 		strcpy(Cc, orig_cc), xfree(orig_cc);
! 		strcpy(Bcc, orig_bcc), xfree(orig_bcc);
! 	    }
! 	    return -1;
  	}
      } else
! 	p = NULL;
  
      /* Sign the letter before adding the Bcc list since they aren't
       * considered when adding a signature.
*** /tmp/,RCSt1009684	Wed Dec 13 14:07:49 1989
--- main.c	Tue Dec 12 18:02:17 1989
***************
*** 205,211 ****
      }
      turnoff(glob_flags, IS_SENDING); /* no longer sending mail; running shell */
  
!     if (ison(glob_flags, REDIRECT)) {
  	puts("You can't redirect input unless you're sending mail.");
  	puts("If you want to run a shell with redirection, use \"-i\"");
  	cleanup(0);
--- 205,212 ----
      }
      turnoff(glob_flags, IS_SENDING); /* no longer sending mail; running shell */
  
!     if (ison(glob_flags, REDIRECT)
! 	    && (!Flags.src_file || !Flags.src_n_exit)) {
  	puts("You can't redirect input unless you're sending mail.");
  	puts("If you want to run a shell with redirection, use \"-i\"");
  	cleanup(0);
*** /tmp/,RCSt1009684	Wed Dec 13 14:07:50 1989
--- makefile.bsd	Wed Dec 13 10:45:13 1989
***************
*** 17,22 ****
--- 17,24 ----
  
  MAKES= makefile.bsd makefile.xenix makefile.sys.v makefile.hpux makefile.sun
  
+ # See the README for changes needed to compile under Ultrix.
+ # In particular, you may need -DSIGRET=void and/or -ltermcap.
  CFLAGS= -O -DCURSES -DBSD
  LDFLAGS=
  LINTFLAGS= -bxah -Dlint -DCURSES -DBSD
*** /tmp/,RCSt1009684	Wed Dec 13 14:07:51 1989
--- malloc.c	Wed Dec 13 10:05:37 1989
***************
*** 395,400 ****
--- 395,401 ----
  u_int n, s;
  {
      xfree(p);
+     return NULL;
  }
  
  char *
***************
*** 402,407 ****
--- 403,409 ----
  char *p;
  {
      xfree(p);
+     return NULL;
  }
  
  #else /* INTERNAL_MALLOC */
*** /tmp/,RCSt1009684	Wed Dec 13 14:07:56 1989
--- mush.1	Wed Dec 13 13:38:01 1989
***************
*** 9,15 ****
  .if n .ds - --
  .if t .ds - \(em
  .nh
! .TH MUSH 1 "Dec 10, 1989" "Version 7.0.0"
  .UC 4
  .SH NAME
  The Mail User's Shell \- Shell for electronic mail.
--- 9,15 ----
  .if n .ds - --
  .if t .ds - \(em
  .nh
! .TH MUSH 1 "Dec 13, 1989" "Version 7.0.1"
  .UC 4
  .SH NAME
  The Mail User's Shell \- Shell for electronic mail.
***************
*** 224,233 ****
  (\-interact)
  Forces interactive mode even if input has been redirected to the program.
  This is intended for remote host mail sessions (with -e) but also allows
! the user to redirect \*Qscripts\*U of
  .I Mush
  commands.
! See the INITIALIZATION section for information on how to
  write scripts that deal with mail.
  Note that this flag is different from the \*Qignore\*U flag of UCB Mail.
  .TP
--- 224,233 ----
  (\-interact)
  Forces interactive mode even if input has been redirected to the program.
  This is intended for remote host mail sessions (with -e) but also allows
! the user to redirect input from a \*Qscript\*U of
  .I Mush
  commands.
! See the INITIALIZATION and MUSH SCRIPTS sections for information on how to
  write scripts that deal with mail.
  Note that this flag is different from the \*Qignore\*U flag of UCB Mail.
  .TP
***************
*** 457,463 ****
  though the screen package may not yet have been started.
  If
  .I is_shell
! is true, then mush has entered the shell;
  .I is_shell
  is always false at startup when initialization files are read,
  and is always true when files are sourced after initialization with the
--- 457,465 ----
  though the screen package may not yet have been started.
  If
  .I is_shell
! is true, then
! .I Mush
! has entered the shell;
  .I is_shell
  is always false at startup when initialization files are read,
  and is always true when files are sourced after initialization with the
***************
*** 483,488 ****
--- 485,495 ----
  If \-i is specified, the value for
  .I redirect
  will be set to false.
+ Note that any time
+ .I Mush
+ runs when not connected to a terminal, it will
+ believe that input has been redirected.
+ See the MUSH SCRIPTS section for more details.
  .PP
  The `!' operator may be used to negate expressions, thus,
  .sp
***************
*** 574,580 ****
  and \*Q-z\*U.  These flags test to see if a file exists (\*Q-e\*U) or
  if it is zero-length (\*Q-z\*U).
  These are most useful in command files that are to be read after the
! shell has started; see the example below.
  .PP
  After sourcing the initialization file,
  .I Mush
--- 581,587 ----
  and \*Q-z\*U.  These flags test to see if a file exists (\*Q-e\*U) or
  if it is zero-length (\*Q-z\*U).
  These are most useful in command files that are to be read after the
! shell has started; see the examples in the MUSH SCRIPTS section.
  .PP
  After sourcing the initialization file,
  .I Mush
***************
*** 604,670 ****
  command.
  Such files use the same format as the initialization files and may use all
  the same tests in \*Qif\*U expressions.
- For example, a filtering file, "filter", might contain:
- .sp
- .nf
- .in +2
- set newfolder = /usr/spool/mail/$USER
- if is_shell
- .in +4
- if -z $newfolder
- .ti +4
- set newfolder = $mbox	# mbox must be set!
- endif
- if -e $newfolder
- .ti +4
- folder $newfolder
- else
- .ti +4
- quit
- endif
- .in -4
- endif
- .sp
- pick -f Mailer-Daemon | save mail_errors
- pick -f yukko | delete
- pick -s -i thesis | save +thesis_mail
- pick -t unix-wizards | +wizmail
- update
- sort d
- .in -2
- .fi
- .sp
- Then the first command the user typed might be \*Qsource filter\*U
- and the following would happen:
- .sp
- .in +2
- First, a new variable called \fBnewfolder\fR is set to the the user's spool
- mailbox (the system mailbox).
- A test is made to see if the shell is running, because the \fBfolder\fR
- command can only be used from the shell.
- Then a test is done to see the spool mailbox is zero length, and if it is,
- the variable is reset to the value of the user's \fBmbox\fR variable
- (mbox must already be set by this time or this will fail).
- A final test assures that the new folder exists.
- If it does, \fIMush\fR changes folders to the new folder.
- If it doesn't exist, the program exits (via \fBquit\fR).
- .sp
- Once the correct folder has been loaded, all messages that have
- \*QMailer-Daemon\*U in the From header will be saved in the file mail_errors.
- Then, all mail from the user \*Qyukko\*U will simply be deleted.
- Next, all mail that has in the Subject field, \*Qthesis\*U
- (case ignored, so \*QThesis\*U would also match) will be
- saved in the file $folder/thesis.
- The next command will find all messages that are addressed to
- the group \*Qunix-wizards\*U (of which the user is an elite
- member) and save them in the file $folder/wizmail.
- Last, the folder will be updated, removing all deleted mail
- (saved mail may be marked as deleted)
- and the folder is reread and sorted according to the date of the messages.
- .in -2
- .sp
  Sourcing of a file of filter commands such as those in the example above
  can be automated by using the \-F option when \fIMush\fR is started.
  .SH "GENERAL USAGE"
  Because there are three different interfaces available to the user,
  the tty characteristics (backspace, kill-word, kill-line, redraw line)
--- 611,619 ----
  command.
  Such files use the same format as the initialization files and may use all
  the same tests in \*Qif\*U expressions.
  Sourcing of a file of filter commands such as those in the example above
  can be automated by using the \-F option when \fIMush\fR is started.
+ Also see the MUSH SCRIPTS section for other uses.
  .SH "GENERAL USAGE"
  Because there are three different interfaces available to the user,
  the tty characteristics (backspace, kill-word, kill-line, redraw line)
***************
*** 1010,1018 ****
  escape character.
  When sending mail, the above tilde escapes are available in
  all three user interfaces.
! However, \fItilde escapes are NOT interpreted when mush is started with
! redirected input\fR.
! If tilde-interpretation is desired, use the \-i option when starting mush.
  .PP
  .IR "Mail Aliases" .
  .PP
--- 959,970 ----
  escape character.
  When sending mail, the above tilde escapes are available in
  all three user interfaces.
! However,
! .I "tilde escapes are NOT interpreted when"
! Mush
! .IR "is started with redirected input" .
! If tilde-interpretation is desired, use the \-i option when starting
! .IR mush .
  .PP
  .IR "Mail Aliases" .
  .PP
***************
*** 1657,1663 ****
  a panel of header display manipulation commands,
  a display of message header summaries,
  another panel of message, file, and folder manipulation commands,
! a one-line window for warnings and other data printed by mush,
  a four-line scrollable window for output of certain commands,
  and a larger window which is used for displaying messages.
  .PP
--- 1609,1616 ----
  a panel of header display manipulation commands,
  a display of message header summaries,
  another panel of message, file, and folder manipulation commands,
! a one-line window for warnings and other data printed by
! .IR Mush ,
  a four-line scrollable window for output of certain commands,
  and a larger window which is used for displaying messages.
  .PP
***************
*** 1686,1692 ****
  and a large window for editing the letter.
  Tilde escapes are not recognized, but the tool interface allows the user to
  make menu or panel item selections from a subset of the tilde escapes.
! As long as the composition frame is open, all mush command output is
  redirected from the small window in the main frame to the small window here.
  The SunView
  .I textsw
--- 1639,1647 ----
  and a large window for editing the letter.
  Tilde escapes are not recognized, but the tool interface allows the user to
  make menu or panel item selections from a subset of the tilde escapes.
! As long as the composition frame is open, all
! .I Mush
! command output is
  redirected from the small window in the main frame to the small window here.
  The SunView
  .I textsw
***************
*** 2392,2398 ****
  The \-e flag causes you to enter the editor described by the variable
  .BR visual .
  .sp
! The \-E flag causes mush to place the headers of the outgoing message in
  the editor file so they can be changed.
  See the description of the variable
  .B edit_hdrs
--- 2347,2355 ----
  The \-e flag causes you to enter the editor described by the variable
  .BR visual .
  .sp
! The \-E flag causes
! .I Mush
! to place the headers of the outgoing message in
  the editor file so they can be changed.
  See the description of the variable
  .B edit_hdrs
***************
*** 2730,2736 ****
  Allows the user to send the texts of a list of messages to a
  .IR UNIX (TM)
  command.
! The list of messages may either be given explicitly or may come from a mush
  pipeline (see \*QPiping commands\*U under the LINE-MODE INTERFACE section).
  If a list is neither given nor piped, the current message is used.
  Headers which have not been ignored are considered part of the message
--- 2687,2694 ----
  Allows the user to send the texts of a list of messages to a
  .IR UNIX (TM)
  command.
! The list of messages may either be given explicitly or may come from a
! .I Mush
  pipeline (see \*QPiping commands\*U under the LINE-MODE INTERFACE section).
  If a list is neither given nor piped, the current message is used.
  Headers which have not been ignored are considered part of the message
***************
*** 3479,3486 ****
  .sp
  In this command, mail is being sent to the user \*Qmanager\*U and the
  subject is set to \*Qreport\*U and the file \*Qreport_file\*U is being
! redirected as input.  In this case, there will be \fIno\fR signature
! appended.
  .sp
  .IR Note :
  The `|' syntax for calling a program to sign the letter is a little
--- 3437,3444 ----
  .sp
  In this command, mail is being sent to the user \*Qmanager\*U and the
  subject is set to \*Qreport\*U and the file \*Qreport_file\*U is being
! redirected as input.
! In this case, there will be \fIno\fR signature appended.
  .sp
  .IR Note :
  The `|' syntax for calling a program to sign the letter is a little
***************
*** 3619,3625 ****
  .B complete
  is set, but not to a value, the escape characer is used as the default.
  When the completion character is typed at the end of a word prefix,
! .I mush
  will interactively complete that word.
  If the prefix is not unique, the word will be completed as far as possible
  and a bell will sound (see, however, the variable
--- 3577,3583 ----
  .B complete
  is set, but not to a value, the escape characer is used as the default.
  When the completion character is typed at the end of a word prefix,
! .I Mush
  will interactively complete that word.
  If the prefix is not unique, the word will be completed as far as possible
  and a bell will sound (see, however, the variable
***************
*** 3667,3673 ****
  (String)
  This variable may be set to a space-separated list of curses mode command
  names (see the CURSES section for the possible choices).
! If set but without a value, a default list established by your mush
  maintainer is used.
  When it is set, a display of the current bindings for the listed commands
  will appear at the bottom of the screen in curses mode.
--- 3625,3632 ----
  (String)
  This variable may be set to a space-separated list of curses mode command
  names (see the CURSES section for the possible choices).
! If set but without a value, a default list established by your
! .I Mush
  maintainer is used.
  When it is set, a display of the current bindings for the listed commands
  will appear at the bottom of the screen in curses mode.
***************
*** 3805,3815 ****
  cannot be set or unset; the user must end the letter (either
  by sending it or forcefully terminating it) first.
  .sp
! Header editing is required when using the
! .I Compose
  tool mode item, because the
  .I textsw
! interface does not permit mush to recognize tilde-escapes.
  .TP
  .B escape
  (Character)
--- 3764,3775 ----
  cannot be set or unset; the user must end the letter (either
  by sending it or forcefully terminating it) first.
  .sp
! Header editing is required when using the \*QCompose\*U
  tool mode item, because the
  .I textsw
! interface does not permit
! .I Mush
! to recognize tilde-escapes.
  .TP
  .B escape
  (Character)
***************
*** 4330,4336 ****
  .TP
  .B quiet
  (Boolean/Multivalued)
! This variable tells mush to be quiet in various circumstances.
  If set, but not to any values, the currently running version of
  .I Mush
  is not printed on startup.
--- 4290,4298 ----
  .TP
  .B quiet
  (Boolean/Multivalued)
! This variable tells
! .I Mush
! to be quiet in various circumstances.
  If set, but not to any values, the currently running version of
  .I Mush
  is not printed on startup.
***************
*** 4716,4721 ****
--- 4678,4806 ----
  or
  .BR eval ,
  which also provide better quoting of the interpolated strings.
+ .SH "MUSH SCRIPTS"
+ One of the most useful features of
+ .I Mush
+ is the ability to write scripts of
+ commands, which can be read by the
+ .B source
+ command from within
+ .IR Mush ,
+ or by redirecting input from the script and using the \-i option.
+ If your operating system supports the \*Q#!\*U interpreter mechanism,
+ a script can be even be executed as a program.
+ Script files can use all the usual
+ .I Mush
+ commands; the only restriction is
+ that the `!' history notation for referencing arguments of
+ .B cmd
+ aliases is disabled in scripts, so only very simple
+ .BR cmd s
+ will work.
+ .PP
+ For example, a filtering file, \*Qfilter\*U, might contain:
+ .sp
+ .nf
+ .in +2
+ set newfolder = /usr/spool/mail/$USER
+ if is_shell
+ .in +4
+ if -z $newfolder
+ .ti +4
+ set newfolder = $mbox	# mbox must be set!
+ endif
+ if -e $newfolder
+ .ti +4
+ folder $newfolder
+ else
+ .ti +4
+ quit
+ endif
+ .in -4
+ endif
+ .sp
+ pick -f Mailer-Daemon | save mail_errors
+ pick -f yukko | delete
+ pick -s -i thesis | save +thesis_mail
+ pick -t unix-wizards | +wizmail
+ update
+ sort d
+ .in -2
+ .fi
+ .sp
+ Then the first command the user types when beginning a
+ .I Mush
+ session might be \*Qsource filter\*U, and the following would happen:
+ .sp
+ .in +2
+ First, a new variable called \fBnewfolder\fR is set to the the user's spool
+ mailbox (the system mailbox).
+ A test is made to see if the shell is running, because the \fBfolder\fR
+ command can only be used from the shell.
+ Then a test is done to see the spool mailbox is zero length, and if it is,
+ the variable is reset to the value of the user's \fBmbox\fR variable
+ (mbox must already be set by this time or this will fail).
+ A final test assures that the new folder exists.
+ If it does, \fIMush\fR changes folders to the new folder.
+ If it doesn't exist, the program exits (via \fBquit\fR).
+ .sp
+ Once the correct folder has been loaded, all messages that have
+ \*QMailer-Daemon\*U in the From header will be saved in the file mail_errors.
+ Then, all mail from the user \*Qyukko\*U will simply be deleted.
+ Next, all mail that has in the Subject field, \*Qthesis\*U
+ (case ignored, so \*QThesis\*U would also match) will be
+ saved in the file $folder/thesis.
+ The next command will find all messages that are addressed to
+ the group \*Qunix-wizards\*U (of which the user is an elite
+ member) and save them in the file $folder/wizmail.
+ Last, the folder will be updated, removing all deleted mail
+ (saved mail may be marked as deleted)
+ and the folder is reread and sorted according to the date of the messages.
+ .in -2
+ .PP
+ If the \*Q#!\*U mechanism is supported, the \*Qfilter\*U script can be
+ made into a program by adding as the first line:
+ .sp
+ .ti +4
+ #! /usr/local/bin/mush -F
+ .sp
+ (The actual location of
+ .I mush
+ may vary from system to system; /usr/local/bin is used as an example.)  Then
+ make the file executable:
+ .sp
+ .ti +4
+ chmod +x filter
+ .sp
+ Now, when the command \*Qfilter\*U is typed at the user's regular shell
+ prompt, the
+ .I mush 
+ program will be invoked by the operating system.
+ .I Mush
+ will first read the commands from the \*Qfilter\*U file and perform them,
+ exactly as described above, and then will continue into the usual interface.
+ If it would be preferable for
+ .I mush
+ to exit after reading the script, the first line can be changed to:
+ .sp
+ .ti +4
+ #! /usr/local/bin/mush -F!
+ .sp
+ The \-F! option should also be used when running
+ scripts in the background or in other circumstances where the standard
+ input cannot be a terminal, and the only commands to be executed are those
+ in the script itself.
+ .PP
+ Note that any additional arguments passed to a \*Q#!\*U script are
+ interpreted by
+ .IR mush ;
+ they are not passed along in any way that makes them accessible to the script.
+ Thus,
+ .sp
+ .ti +4
+ % filter \-f mbox
+ .sp
+ would apply the commands in the \*Qfilter\*U script to the \*Qmbox\*U folder.
  .SH MACROS
  Macros are available in several different modes in
  .IR Mush .
*** /tmp/,RCSt1009684	Wed Dec 13 14:08:13 1989
--- mush.h	Wed Dec 13 10:29:07 1989
***************
*** 239,247 ****
  
  #define TRUE		  1
  #define FALSE		  0
! #define print		  printf
! #define wprint		  printf
! #define print_more	  printf
  
  #endif /* !SUNTOOL && !CURSES */
  
--- 239,247 ----
  
  #define TRUE		  1
  #define FALSE		  0
! #define print		  (void) printf
! #define wprint		  (void) printf
! #define print_more	  (void) printf
  
  #endif /* !SUNTOOL && !CURSES */
  
***************
*** 251,257 ****
  #endif /* max */
  
  #if defined(CURSES) && (!defined(SUNTOOL))
! #define wprint printf
  #endif /* CURSES && (!SUNTOOL) */
  
  #if defined(CURSES) || defined(SUNTOOL)
--- 251,257 ----
  #endif /* max */
  
  #if defined(CURSES) && (!defined(SUNTOOL))
! #define wprint	(void) printf
  #endif /* CURSES && (!SUNTOOL) */
  
  #if defined(CURSES) || defined(SUNTOOL)
***************
*** 554,560 ****
  #ifdef SUNTOOL
  void
      timeout_cursors(), hdr_io(), do_file_dir(), toggle_mail_items(),
!     opts_panel_item(), view_options();
  
  char
      *find_key(),	/* pass x,y coords to find which function key assoc. */
--- 554,561 ----
  #ifdef SUNTOOL
  void
      timeout_cursors(), hdr_io(), do_file_dir(), toggle_mail_items(),
!     read_mail(), opts_panel_item(), view_options(), toolquit(), wprint(),
!     update_list_textsw();
  
  char
      *find_key(),	/* pass x,y coords to find which function key assoc. */
*** /tmp/,RCSt1009684	Wed Dec 13 14:08:15 1989
--- pick.c	Wed Dec 13 10:14:04 1989
***************
*** 3,9 ****
  #include "mush.h"
  
  static int before, after, search_from, search_subj, search_to, xflg, icase;
! static mdy[3], search_hdr[64];
  static int pick();
  
  do_pick(n, argv, list)
--- 3,10 ----
  #include "mush.h"
  
  static int before, after, search_from, search_subj, search_to, xflg, icase;
! static char search_hdr[64];
! static int mdy[3];
  static int pick();
  
  do_pick(n, argv, list)
*** /tmp/,RCSt1009684	Wed Dec 13 14:08:20 1989
--- version.h	Wed Dec 13 11:05:12 1989
***************
*** 1,8 ****
  /* @(#)version.h	(c) Copyright 1989 (Dan Heller) */
  
  #define MUSHNAME	"Mail User's Shell"
! #define RELEASE_DATE	"12/10/89"
  #define RELEASE		7
  #define REVISION	"0"
! #define PATCHLEVEL	0
  #define ORIGINAL_DATE	"12/10/89"
--- 1,8 ----
  /* @(#)version.h	(c) Copyright 1989 (Dan Heller) */
  
  #define MUSHNAME	"Mail User's Shell"
! #define RELEASE_DATE	"12/13/89"
  #define RELEASE		7
  #define REVISION	"0"
! #define PATCHLEVEL	1
  #define ORIGINAL_DATE	"12/10/89"
*** /tmp/,RCSt1009823	Wed Dec 13 14:08:23 1989
--- doproc.c	Wed Dec 13 10:52:51 1989
***************
*** 319,324 ****
--- 319,325 ----
  
  /* panel selction button to send a letter. */
  /*ARGSUSED*/
+ void
  do_send(item, value, event)
  Panel_item item;
  int value;
***************
*** 412,418 ****
--- 413,423 ----
      }
      (void) add_to_letter(buf);
      fclose(ed_fp), ed_fp = NULL_FILE;
+ #ifdef ALERT_ATTR /* SunOS 4.0+ */
      window_set(msg_sw, TEXTSW_FILE_CONTENTS, file, NULL);
+ #else /* ALERT_ATTR */
+     textsw_load_file(msg_sw, file, 1, 0, 0);
+ #endif /* ALERT_ATTR */
      (void) unlink(file);
  }
  
***************
*** 484,489 ****
--- 489,495 ----
      Textsw_index first, last;
  
      strdup(file, hfile);
+ #ifdef ALERT_ATTR /* SunOS 4.0+ */
      window_set(msg_sw,
  	TEXTSW_CLIENT_DATA,		file,
  	TEXTSW_FILE_CONTENTS,		hfile,
***************
*** 490,495 ****
--- 496,509 ----
  	TEXTSW_READ_ONLY,		FALSE,
  	TEXTSW_STORE_CHANGES_FILE,	FALSE,
  	NULL);
+ #else /* ALERT_ATTR */
+     textsw_load_file(msg_sw, hfile, 1, 0, 0);
+     window_set(msg_sw,
+ 	TEXTSW_CLIENT_DATA,		file,
+ 	TEXTSW_READ_ONLY,		FALSE,
+ 	TEXTSW_STORE_CHANGES_FILE,	FALSE,
+ 	NULL);
+ #endif /* ALERT_ATTR */
  
      first = (Textsw_index)window_get(msg_sw, TEXTSW_LENGTH);
      if (search) {
*** /tmp/,RCSt1009823	Wed Dec 13 14:08:26 1989
--- misc_frame.c	Wed Dec 13 11:00:16 1989
***************
*** 12,17 ****
--- 12,20 ----
   */
  
  #include "mush.h"
+ #ifndef ALERT_ATTR /* SunOS 3.5? */
+ #define TEXTSW_WRAP_AT_WORD TEXTSW_WRAP_AT_CHAR
+ #endif /* ALERT_ATTR */
  
  /****************** Mail Aliases ********************/
  
*** /tmp/,RCSt1009823	Wed Dec 13 14:08:28 1989
--- panels.c	Wed Dec 13 10:09:59 1989
***************
*** 40,47 ****
  
  extern void
      do_ignore(), do_aliases(), do_compose(), do_send(), do_hdr(), do_sort(),
!     do_edit(), read_mail(), delete_mail(), respond_mail(), do_help(), do_lpr(),
!     toolquit(), do_update(), abort_mail(), display_hdrs(), do_include(),
      open_compose();
  
  extern Panel_setting
--- 40,47 ----
  
  extern void
      do_ignore(), do_aliases(), do_compose(), do_send(), do_hdr(), do_sort(),
!     do_edit(), delete_mail(), respond_mail(), do_help(), do_lpr(),
!     do_update(), abort_mail(), display_hdrs(), do_include(),
      open_compose();
  
  extern Panel_setting
***************
*** 489,495 ****
--- 489,497 ----
  Panel_item item;
  {
      char	*tmp = NULL, *p;
+ #ifdef WALK_MENUS
      Menu_item	mi;
+ #endif /* WALK_MENUS */
  
      if (!(p = do_set(set_options, "folder")) || !*p)
  	p = DEF_FOLDER;
-- 
Bart Schaefer     "Miserable miscreant!  Question MY integrity, will you?"
               "I have to see some *evidence* of it before I can question it."
                                                            -- Calvin & Hobbes
schaefer@cse.ogi.edu (used to be cse.ogc.edu)