[comp.sources.x] v08i098: xmail, Patch2, Part03/05

michael@parns.nsc.com (Michael Wagnitz) (08/28/90)

Submitted-by: michael@parns.nsc.com (Michael Wagnitz)
Posting-number: Volume 8, Issue 98
Archive-name: xmail/patch2.03

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 3 (of 5)."
# Contents:  Patch.02a
# Wrapped by michael@harley on Mon Aug 27 12:47:26 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'Patch.02a' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Patch.02a'\"
else
echo shar: Extracting \"'Patch.02a'\" \(49821 characters\)
sed "s/^X//" >'Patch.02a' <<'END_OF_FILE'
XPrereq: 1
X
X*** ../v1.1/patchlevel.h	Mon Jun  4 09:48:28 1990
X--- patchlevel.h	Mon Aug 27 11:09:21 1990
X***************
X*** 1 ****
X! #define PATCHLEVEL 1
X--- 1 ----
X! #define PATCHLEVEL 2
X*** ../v1.1/CHANGES	Mon Jun  4 09:47:30 1990
X--- CHANGES	Mon Aug 27 11:09:16 1990
X***************
X*** 1,2 ****
X--- 1,136 ----
X  
X+                                                                 August, 1990
X+ 
X+    The following changes have been effected for Patchlevel 2 of xmail.
X+ 
X+ 
X+ Imakefile:	Reordered R3 and R4 dependencies to allow for R4 make depend.
X+ 
X+ HelpText.c:	Corrected some text and added help for text window key actions.
X+ 
X+ Mailwatch.c:	Added option to start icon in reverse video.  Also added
X+ 		option to display the username in the icon window, for those
X+ 		times when xmail processes for more than one user are desired.
X+ 
X+ actions.c:	Changed Newmail action to NOT automatically remove the
X+ 		current folder list when changing to the system mail folder.
X+ 		'Drop Folders' is now a separate action selectable within the
X+ 		Newmail command menu.  Fixed SetFolders routine to not prepend
X+ 		the home directory to folder names beginning with either a
X+ 		dot (.) or foreword slash (/).  Also added a COMMIT option
X+ 		to change of folder (when current folder has deleted mail)
X+ 		or cancel of composed message.  Commit option is tailorable
X+ 		by -e (expert) flag, 'Preserve' menu selection, and/or resource
X+ 		specification.  Re-edit of the current message composition is
X+ 		now supported within the 'Send' popup 'Deliver' sub-menu.
X+ 		Deletions in the 'Send' popup text fields will no longer force
X+ 		the cursor position to the end of the line.  Additional error
X+ 		messages from the mail program are also trapped.  To better
X+ 		support variations in 'Berkeley' mail, 'set no' commands are
X+ 		no changed to 'unset' commands.  Both forms are also parsed.
X+ 		To allow pasting of selected text within the various windows,
X+ 		message indexing is now indicated by a preceeding greater-
X+ 		than symbol (>) instead of highlighting using the selection
X+ 		mechanism.
X+ 
X+ callbacks.c:	Mechanisms for delivering mail messages are now forked to a
X+ 		child process if possible, instead of the previous synchronous
X+ 		system calls.  Better support for file and folder recipients
X+ 		to messages are also included.  Changes in folder or quitting
X+ 		with a modified folder are now confirmed, unless the expert
X+ 		flag has been specified.  Callbacks for re-editing message
X+ 		composition and for dropping the current folders list are also
X+ 		added.
X+ 
X+ confirm.c:	This is a new routine which supplys the confirmation method.
X+ 
X+ defs.h:		Changes to accomodate 'make depend' under X11R4 .vs. X11R3.
X+ 		Added command line option flag: expert.
X+ 
X+ directory.c:	Modified list display to be more box like, to help prevent
X+ 		the menu from running off the bottom of the screen.
X+ 
X+ environs.c:	Improved alias parsing routines to separate real people from
X+ 		file and folder names as recipients of mail messages.  Also
X+ 		expanded environment variables in GetMailEnv calls.
X+ 
X+ globals.h:	Added definitions for new routines and flags.
X+ 
X+ handler.c:	Removed widget privates dependencies in SystemFolder routine
X+ 		by correctly calling XtGetValues for the label of the widget.
X+ 
X+ icon.mail:	Modified bitmaps for both icons to allow for placing the
X+ 		username under the mailbox, when requested.
X+ 
X+ mail.c:		Added editMail routine to support re-edits of message text.
X+ 
X+ parser.c:	Added ability to export the match function to other routines
X+ 		for better handling of errors from mail.  Changed 'set no'
X+ 		calls to 'unset's, for support of SONY NEWS OS mail program.
X+ 		Changed message index highlighting to use the greater-than
X+ 		symbol (>) instead.  Revert to default mail prompt of received
X+ 		during startup, for case where user's .mailrc file fails to
X+ 		parse before the intended prompt can be set.
X+ 
X+ utils.c:	Changed message index selection highlighting to use symbol.
X+ 
X+ windows.c:	Added new command menu options.  Provided for cut and paste
X+ 		operations in File and text windows.  Added second help
X+ 		window to text area for mapping of keyboard keys to command
X+ 		actions.  Added keyboard cursor motion commands to the Index
X+ 		and Text windows.  Added routine to parse the icon geometry.
X+ 
X+ xmail.c:	Added support for new options: -e (expert), -iconic, and
X+ 		-rv (reverse video on the icon).  Also default to no position
X+ 		(0,0) for icon if not explicitly specified.
X+ 
X+ xmail.man:	Many changes to document patchlevel 2 enhancements and fixes.
X+ 
X+ xmailregex.h:	Added support for use outside of the parser routines.  Also
X+ 		added additional error messages for users with problems in
X+ 		their environment or .mailrc file.
X+ 
X+ XMail.ad:	Changed the color specifications in the applications defaults
X+ 		from names to hex values, to provide support when the server
X+ 		fails to parse color names (a rare but annoying occurance).
X+ 		Added definitions for the new command menu buttons.
X+ 
X+ 
X+ Again, I'd like to thank the contributors of suggestions and actual patches.
X+ I'd also like to thank those persons who sent in complaints and suggestions.
X+ If I somehow managed to forget some of those persons, I hope they can
X+ forgive me.
X+ 
X+ *) Jeff Dauber was first to request the ability to re-edit new messages.
X+ 
X+ *) Mark Scholl was responsible for requesting the addition of a Confirmation
X+    option.
X+ 
X+ *) More illegal pointer combination fixes, the ParseIconGeometry() routine,
X+    and the expansion of environment variables within the GetMailEnv() routine
X+    were supplied by Christos Zoulas.
X+ 
X+ *) Tom Dunigan and Peter Marshall both pointed out the error of my ways in
X+    handling RFC822 addresses, and supplied much needed help in making the
X+    corrections.
X+ 
X+ *) Peter Marshal also initiated changes to allow a greater variety of editor
X+    choices, including better support for the emacs invocation.  He was also
X+    one of the first to complain about the delays during delivery of messages,
X+    which drove the efforts to fork off those tasks.
X+ 
X+ *) David Elliott suggested the no-default icon position, the missing paste
X+    ability in the File window, and the need to support 'unset' versus 'set no'
X+    construct in mail.
X+ 
X+ *) Suggestions from Casey Leedom precipitated the revision of the Makefile
X+    depends to provide better support for make depend under Sun and X11R4.
X+ 
X+ *) Questions from John Meissen prompted modifications to the way the file
X+    handlers are modified when calling mail and forking edit children.  He also
X+    pointed out the probability of a MAIL environment variable pointing to
X+    the intended mail spool and made suggestions for changing the code.
X+ 
X+ ---------------------- end of changes for patchlevel 2 -----------------------
X+ 
X                                                                     May, 1990
X*** ../v1.1/COPYRIGHT	Mon Jun  4 09:46:24 1990
X--- COPYRIGHT	Mon Aug 27 11:09:16 1990
X***************
X*** 34,36 ****
X   * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
X!  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
X   * PERFORMANCE OF THIS SOFTWARE.
X--- 34,36 ----
X   * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
X!  * OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
X   * PERFORMANCE OF THIS SOFTWARE.
X*** ../v1.1/HelpText.c	Mon Jun  4 09:48:30 1990
X--- HelpText.c	Mon Aug 27 11:09:16 1990
X***************
X*** 19,25 ****
X   * EVENT SHALL NATIONAL SEMICONDUCTOR CORPORATION BE LIABLE FOR ANY SPECIAL,
X   * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
X   * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
X!  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
X   * PERFORMANCE OF THIS SOFTWARE.
X   *
X   * Author:  Michael C. Wagnitz - National Semiconductor Corporation
X--- 19,25 ----
X   * EVENT SHALL NATIONAL SEMICONDUCTOR CORPORATION BE LIABLE FOR ANY SPECIAL,
X   * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
X   * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
X!  * OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
X   * PERFORMANCE OF THIS SOFTWARE.
X   *
X   * Author:  Michael C. Wagnitz - National Semiconductor Corporation
X***************
X*** 36,42 ****
X  Pressing the right mouse button in this window displays\n\
X  a list of your aliases.  Releasing the right mouse\n\
X  button while one of the alias names is highlighted\n\
X! copies that name into the window, preceeding it with a\n\
X  comma if needed.\n\n\
X  Pressing the backspace or delete key erases a previously\n\
X  entered character.  Control_W (^W) erases a previous\n\
X--- 36,42 ----
X  Pressing the right mouse button in this window displays\n\
X  a list of your aliases.  Releasing the right mouse\n\
X  button while one of the alias names is highlighted\n\
X! copies that name into the window, preceding it with a\n\
X  comma if needed.\n\n\
X  Pressing the backspace or delete key erases a previously\n\
X  entered character.  Control_W (^W) erases a previous\n\
X***************
X*** 48,54 ****
X  Pressing the right mouse button in this window displays a\n\
X  list of your aliases.  Releasing the right mouse button\n\
X  while one of the alias names is highlighted copies that\n\
X! name into the window, preceeded with a comma if needed.\n\n\
X  Pressing the backspace or delete key erases a previously\n\
X  entered character.  Control_W (^W) erases a previous\n\
X  word and Control_U (^U) the entire line.";
X--- 48,54 ----
X  Pressing the right mouse button in this window displays a\n\
X  list of your aliases.  Releasing the right mouse button\n\
X  while one of the alias names is highlighted copies that\n\
X! name into the window, preceded with a comma if needed.\n\n\
X  Pressing the backspace or delete key erases a previously\n\
X  entered character.  Control_W (^W) erases a previous\n\
X  word and Control_U (^U) the entire line.";
X***************
X*** 62,68 ****
X  The uppercase (Copy) command copies the message to a file\n\
X  whose name is derived from the author of the message,\n\
X  rather than from any name currently in the File: window.\n\n\
X! See also the save command for additional information.";
X  
X  String	Delete_Help_Text = "\
X  Pressing this button removes the selected message from the\n\
X--- 62,68 ----
X  The uppercase (Copy) command copies the message to a file\n\
X  whose name is derived from the author of the message,\n\
X  rather than from any name currently in the File: window.\n\n\
X! See also the save command help for additional information.";
X  
X  String	Delete_Help_Text = "\
X  Pressing this button removes the selected message from the\n\
X***************
X*** 77,89 ****
X  See also preserve, save, folder, Newmail, and quit.";
X  
X  String	Deliver_Help_Text = "\
X! The Deliver button will complete the currently composed\n\
X! message and ship it to the sendmail daemon for delivery.\n\n\
X! The right mouse button pops up a menu for both Delivery\n\
X! and Cancel commands.  Selecting Cancel aborts delivery\n\
X! and removes the temporary file, while the third selection\n\
X! saves a copy of the message text in your dead letter file\n\
X! (~/dead.letter by default).";
X  
X  String	File_Help_Text = "\
X  The File: window provides a mechanism for specifying a\n\
X--- 77,93 ----
X  See also preserve, save, folder, Newmail, and quit.";
X  
X  String	Deliver_Help_Text = "\
X! The Deliver button will ship the currently composed message\n\
X! to the system sendmail daemon for delivery to the indicated\n\
X! addressees.\n\n\
X! The right mouse button gives a menu of Delivery, Re-edit,\n\
X! and Cancel commands.\n\n\
X! Use the Re-edit selection to perform additional changes\n\
X! to the current message.\n\n\
X! Selecting \"Cancel, save\" aborts delivery and saves a copy\n\
X! of the message text in your dead letter file\n\
X! ($HOME/dead.letter by default), while the last selection\n\
X! just aborts delivery and removes the temporary file.";
X  
X  String	File_Help_Text = "\
X  The File: window provides a mechanism for specifying a\n\
X***************
X*** 98,110 ****
X  The left button changes the active folder to the one\n\
X  specified in the File: window.  Changing folders COMMITs\n\
X  any modifications to the current folder.\n\n\
X! The right button brings up a list of folders from which\n\
X! to choose.\n\n\
X! Clicking the left button on a directory (indicated by\n\
X! trailing slash) while still holding down the right,\n\
X! expands the directory, if it has files.\n\n\
X  Releasing the right button copies the selected name to\n\
X! the File: window.";
X  
X  String	Hold_Help_Text = "\
X  This command marks the selected message for preservation\n\
X--- 102,116 ----
X  The left button changes the active folder to the one\n\
X  specified in the File: window.  Changing folders COMMITs\n\
X  any modifications to the current folder.\n\n\
X! The right button brings up a menu of folders from which\n\
X! to choose.  Clicking the left button on a directory\n\
X! (indicated by trailing slash) while still holding down\n\
X! the right, expands that directory, if it has files.\n\
X  Releasing the right button copies the selected name to\n\
X! the File: window.\n\n\
X! The current menu can be erased (to include new folders\n\
X! created since the menu was last generated) by using an\n\
X! option provided with the Newmail command button.";
X  
X  String	Hold_Help_Text = "\
X  This command marks the selected message for preservation\n\
X***************
X*** 114,121 ****
X  preserve is used after having saved a message to another\n\
X  file or folder when you still wish to preserve the mail\n\
X  message in your system folder.  (See the mail man page.)\n\n\
X! The right mouse button presents a menu of three mail\n\
X! environment variables that may be altered while in xmail.\n\
X  Commands listed denote what state each variable will be\n\
X  changed to if the appropriate label is highlighted as the\n\
X  mouse button is released.";
X--- 120,127 ----
X  preserve is used after having saved a message to another\n\
X  file or folder when you still wish to preserve the mail\n\
X  message in your system folder.  (See the mail man page.)\n\n\
X! The right mouse button presents a menu of four of the\n\
X! environment variables that may be altered while in xmail.\n\n\
X  Commands listed denote what state each variable will be\n\
X  changed to if the appropriate label is highlighted as the\n\
X  mouse button is released.";
X***************
X*** 123,134 ****
X  String	Index_Help_Text = "\
X  The index window displays a list of mail messages in the\n\
X  current folder, as well as the currently selected message.\n\n\
X! Pressing the left mouse button anywhere on the line marks\n\
X! a message as selected (for other commands) but does not\n\
X  automatically display the message in the text window.\n\n\
X  Pressing the right button selects and also automatically\n\
X! displays the message.\n\n\
X! See also the read command for additional help information.";
X  
X  #ifdef SUNOS_4
X  String	NewMail_Help_Text = "\
X--- 129,143 ----
X  String	Index_Help_Text = "\
X  The index window displays a list of mail messages in the\n\
X  current folder, as well as the currently selected message.\n\n\
X! Pressing the left mouse button anywhere on a line marks\n\
X! the message as selected (for other commands) but does not\n\
X  automatically display the message in the text window.\n\n\
X  Pressing the right button selects and also automatically\n\
X! displays the message.\n\
X! See also the read command help for additional information.\n\n\
X! The index window header list may be scrolled using either\n\
X! the scrollbar and mouse or keyboard keys.  See the Text\n\
X! window help for a description of the keys supported.";
X  
X  #ifdef SUNOS_4
X  String	NewMail_Help_Text = "\
X***************
X*** 138,147 ****
X  folder was accessed.  This action COMMITS any changes to\n\
X  the current folder.\n\n\
X  The Newmail button will highlight whenever new mail has\n\
X! been delivered.  The right mouse button provides a\n\
X! choice between committing changes, or just incorporating\n\
X! new messages without committing changes (only if your\n\
X! system mailbox is already your current folder).";
X  #else
X  String	NewMail_Help_Text = "\
X  Pressing this button causes your system mail folder to\n\
X--- 147,158 ----
X  folder was accessed.  This action COMMITS any changes to\n\
X  the current folder.\n\n\
X  The Newmail button will highlight whenever new mail has\n\
X! been delivered.\n\n\
X! The right mouse button provides a choice of committing\n\
X! changes, just incorporating new messages without\n\
X! committing changes (only if your system mailbox is\n\
X! already your current folder), or dropping any current\n\
X! folder list(s).";
X  #else
X  String	NewMail_Help_Text = "\
X  Pressing this button causes your system mail folder to\n\
X***************
X*** 150,157 ****
X  folder was accessed.  This action COMMITS any changes to\n\
X  the current folder.\n\n\
X  The Newmail button will highlight whenever new mail has\n\
X! been delivered.  The right mouse button is a duplicate\n\
X! of the Newmail command.";
X  #endif
X  
X  String	Print_Help_Text = "\
X--- 161,169 ----
X  folder was accessed.  This action COMMITS any changes to\n\
X  the current folder.\n\n\
X  The Newmail button will highlight whenever new mail has\n\
X! been delivered.\n\n\
X! The right mouse button provides the choice of retrieving\n\
X! new messages or just dropping any current folder list(s).";
X  #endif
X  
X  String	Print_Help_Text = "\
X***************
X*** 160,166 ****
X  A message will be displayed in the status window\n\
X  indicating which message was printed, along with its\n\
X  size in bytes.\n\n\
X! See also the index window for help on selecting a message.";
X  
X  String	Quit_Help_Text = "\
X  quit - terminates xmail, committing changes made to the\n\
X--- 172,178 ----
X  A message will be displayed in the status window\n\
X  indicating which message was printed, along with its\n\
X  size in bytes.\n\n\
X! See also the Index window for help on selecting a message.";
X  
X  String	Quit_Help_Text = "\
X  quit - terminates xmail, committing changes made to the\n\
X***************
X*** 180,186 ****
X  reading it with full header (overrides suppression of\n\
X  normally ignored fields), or reading the next or previous\n\
X  message.\n\n\
X! See also the index window help information.";
X  
X  String	Reply_Help_Text = "\
X  reply - initiates the mechanism to create and send a mail\n\
X--- 192,198 ----
X  reading it with full header (overrides suppression of\n\
X  normally ignored fields), or reading the next or previous\n\
X  message.\n\n\
X! See also the Index window help for more information.";
X  
X  String	Reply_Help_Text = "\
X  reply - initiates the mechanism to create and send a mail\n\
X***************
X*** 189,195 ****
X  'reply', 'reply included', 'replyall' (which addresses all\n\
X  recipients of the original mail), or 'replyall included'.\n\
X  The include options automatically copy the original\n\
X! message into the new one.\n\n\See also the send command.";
X  
X  String	Save_Help_Text = "\
X  save - copies a message to the file or folder named in\n\
X--- 201,207 ----
X  'reply', 'reply included', 'replyall' (which addresses all\n\
X  recipients of the original mail), or 'replyall included'.\n\
X  The include options automatically copy the original\n\
X! message into the new one.\n\nSee also the Send command.";
X  
X  String	Save_Help_Text = "\
X  save - copies a message to the file or folder named in\n\
X***************
X*** 212,218 ****
X  specify the name of the recipient(s), subject, and to whom\n\
X  to send copies of this message.  Pressing the 'Deliver'\n\
X  button completes the operation.\n\n\
X! See also the reply command for additional information.";
X  
X  String	Sign_Help_Text = "\
X  You may insert you choice of the two autograph strings\n\
X--- 224,230 ----
X  specify the name of the recipient(s), subject, and to whom\n\
X  to send copies of this message.  Pressing the 'Deliver'\n\
X  button completes the operation.\n\n\
X! See also the reply command help for additional information.";
X  
X  String	Sign_Help_Text = "\
X  You may insert you choice of the two autograph strings\n\
X***************
X*** 240,249 ****
X  the entire line.";
X  
X  String	Text_Help_Text = "\
X! The text window displays the currently selected message.\n\n\
X! The scrollbar may be used to move the displayed text, as\n\
X! necessary.\n\n\
X! See also the index window for help on selecting a message.";
X  
X  String	Title_Help_Text = "\
X  The Title window displays the\n\n\
X--- 252,300 ----
X  the entire line.";
X  
X  String	Text_Help_Text = "\
X! The text window displays the currently selected message.\n\
X! See the Index window help on how to select a message.\n\n\
X! Text and index windows may be scrolled using either the\n\
X! mouse and scrollbar, or the keyboard keys in the manner\n\
X! of text display programs such as \"more\" and \"less\".\n\n\
X! spacebar - scroll down a page      b - scroll up a page\n\
X! return   - scroll down a line      k - scroll up a line\n\
X!   G      - go to end of text       ' - go to top of text\n\n\
X! The text window also supports keyboard access to each of\n\
X! the command buttons.  See the xmail man page for details,\n\
X! or press the question mark key (?) in the text window.";
X! 
X! #ifdef SUNOS_4
X! String	Text2_Help_Text = "\
X! Keyboard keys which duplicate the command button actions:\n\n\
X!  a - REPLY to all recipients    A  - REPLY to all included\n\
X!  c - COPY a message             C  - COPY to Author file\n\
X!  d - DELETE the message         u  - UNDELETE a message\n\
X!  f - READ with full headers     F  - FORWARD a message\n\
X!  m - MAIL a message             M  - REPLY to a message\n\
X!  i - incorporate NEW MAIL       N  - retrieve NEW MAIL\n\
X!  p - read PREVIOUS message      P  - PRINT a message\n\
X!  r - READ the message           R  - REPLY included\n\
X!  s - SAVE current message       S  - SAVE to author\n\
X!  n - read the NEXT message      w  - WRITE current message\n\
X!  q - QUIT, committing changes   x  - EXIT, no commits\n\
X!  ? - DISPLAY this help info   <LF> - REMOVE this help info";
X! #else
X! String	Text2_Help_Text = "\
X! Keyboard keys which duplicate the command button actions:\n\n\
X!  a - REPLY to all recipients    A  - REPLY to all included\n\
X!  c - COPY a message             C  - COPY to Author file\n\
X!  d - DELETE the message         u  - UNDELETE a message\n\
X!  f - READ with full headers     F  - FORWARD a message\n\
X!  m - MAIL a message             M  - REPLY to a message\n\
X!  n - read the NEXT message      N  - retrieve NEW MAIL\n\
X!  p - read PREVIOUS message      P  - PRINT a message\n\
X!  r - READ the message           R  - REPLY included\n\
X!  s - SAVE current message       S  - SAVE to author\n\
X!  q - QUIT, committing changes   w  - WRITE current message\n\
X!  x - EXIT, no commits\n\
X!  ? - DISPLAY this help info   <LF> - REMOVE this help info";
X! #endif
X  
X  String	Title_Help_Text = "\
X  The Title window displays the\n\n\
X*** ../v1.1/Imakefile	Mon Jun  4 09:48:31 1990
X--- Imakefile	Mon Aug 27 11:09:17 1990
X***************
X*** 1,5 ****
X  #
X! # Imakefile for xmail 1.1
X  #
X  # SUNOS_4 is defined if compiling under Sun OS 4.x - newer directory routines
X  #
X--- 1,5 ----
X  #
X! # Imakefile for xmail 1.2
X  #
X  # SUNOS_4 is defined if compiling under Sun OS 4.x - newer directory routines
X  #
X***************
X*** 18,28 ****
X    LOCAL_LIBRARIES = $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB)
X  
X               SRCS = Mailwatch.c HelpText.c actions.c callMail.c callbacks.c \
X! 		    directory.c environs.c handler.c mail.c parser.c \
X  		    regex.c utils.c windows.c xmail.c
X  
X               OBJS = Mailwatch.o HelpText.o actions.o callMail.o callbacks.o \
X! 		    directory.o environs.o handler.o mail.o parser.o \
X  		    regex.o utils.o windows.o xmail.o
X  
X  ComplexProgramTarget(xmail)
X--- 18,28 ----
X    LOCAL_LIBRARIES = $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB)
X  
X               SRCS = Mailwatch.c HelpText.c actions.c callMail.c callbacks.c \
X! 		    confirm.c directory.c environs.c handler.c mail.c parser.c \
X  		    regex.c utils.c windows.c xmail.c
X  
X               OBJS = Mailwatch.o HelpText.o actions.o callMail.o callbacks.o \
X! 		    confirm.o directory.o environs.o handler.o mail.o parser.o \
X  		    regex.o utils.o windows.o xmail.o
X  
X  ComplexProgramTarget(xmail)
X*** ../v1.1/Mailwatch.c	Mon Jun  4 09:48:32 1990
X--- Mailwatch.c	Mon Aug 27 11:09:17 1990
X***************
X*** 55,61 ****
X   * EVENT SHALL NATIONAL SEMICONDUCTOR CORPORATION BE LIABLE FOR ANY SPECIAL,
X   * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
X   * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
X!  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
X   * PERFORMANCE OF THIS SOFTWARE.
X   *
X   * The following software modules were created and are Copyrighted by National
X--- 55,61 ----
X   * EVENT SHALL NATIONAL SEMICONDUCTOR CORPORATION BE LIABLE FOR ANY SPECIAL,
X   * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
X   * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
X!  * OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
X   * PERFORMANCE OF THIS SOFTWARE.
X   *
X   * The following software modules were created and are Copyrighted by National
X***************
X*** 87,93 ****
X  #define	flagdown_width	no_mail_width
X  #define	flagdown_height	no_mail_height
X  
X! #define between(x, i, y)	((i) < (x) ? (x) : (i) > (y) ? (y) : (i))
X  
X  #define REMOVE_TIMEOUT(id) if (!id) ; else XtRemoveTimeOut(id)
X  #ifdef X11R2
X--- 87,93 ----
X  #define	flagdown_width	no_mail_width
X  #define	flagdown_height	no_mail_height
X  
X! #define between(x, i, y)   ((i) < (x) ? (x) : (i) > (y) ? (y) : (i))
X  
X  #define REMOVE_TIMEOUT(id) if (!id) ; else XtRemoveTimeOut(id)
X  #ifdef X11R2
X***************
X*** 98,108 ****
X  static struct stat stbuf;
X  static Pixmap ReadBitmapFile();
X  static Boolean SetValues();
X! static GC GetNormalGC();
X  extern void
X      reset_mailbox();
X  static void
X!     GetMailFile(), CloseDown(), check_mailbox(), redraw_mailbox(),
X      Initialize(), Realize(), Destroy(), Redisplay(), clock_tic();
X  
X  #define min(a,b) ((a) < (b) ? (a) : (b))
X--- 98,108 ----
X  static struct stat stbuf;
X  static Pixmap ReadBitmapFile();
X  static Boolean SetValues();
X! static GC GetNormalGC(), GetInvertGC();
X  extern void
X      reset_mailbox();
X  static void
X!     GetMailFile(), GetUserName(), CloseDown(), check_mailbox(), redraw_mailbox(),
X      Initialize(), Realize(), Destroy(), Redisplay(), clock_tic();
X  
X  #define min(a,b) ((a) < (b) ? (a) : (b))
X***************
X*** 146,151 ****
X--- 146,155 ----
X  	offset(mail), XtRString, NULL},
X      {XtNcallback, XtCCallback, XtRCallback, sizeof(caddr_t),
X  	offset(callback), XtRCallback, NULL},
X+     {"useName", XtCBoolean, XtRBoolean, sizeof(Boolean),
X+ 	offset(useName), XtRString, (caddr_t) "FALSE" },
X+     { XtNfont, XtCFont, XtRFontStruct, sizeof (XFontStruct *),
X+ 	offset(font), XtRString, "fixed"},
X  };
X  
X  #undef offset
X***************
X*** 199,204 ****
X--- 203,210 ----
X      register Display *dpy = XtDisplay(new);
X      int depth = DefaultDepth(dpy, DefaultScreen(dpy)), wid, hgt;
X  
X+     GetUserName(w);
X+ 
X      if (!w->mailbox.filename)
X  	GetMailFile(w);
X  
X***************
X*** 212,217 ****
X--- 218,226 ----
X  
X      GetNormalGC(w);
X  
X+     if (w->mailbox.useName)
X+        GetInvertGC(w);
X+ 
X      /*
X       * build up the pixmaps that we'll put into the image
X       */
X***************
X*** 299,304 ****
X--- 308,328 ----
X      w->mailbox.normal_GC = XtGetGC((Widget) w, valuemask, &xgcv);
X  }
X  
X+ static GC
X+ GetInvertGC(w)
X+ MailwatchWidget w;
X+ {
X+     XtGCMask valuemask;
X+     XGCValues xgcv;
X+ 
X+     valuemask = GCForeground | GCBackground | GCFunction | GCGraphicsExposures;
X+     xgcv.foreground = w->core.background_pixel;
X+     xgcv.background = w->mailbox.foreground_pixel;
X+     xgcv.function = GXcopy;
X+     xgcv.graphics_exposures = False;	/* this is Bool, not Boolean */
X+     w->mailbox.invert_GC = XtGetGC((Widget) w, valuemask, &xgcv);
X+ }
X+ 
X  static Pixmap
X  ReadBitmapFile(dpy, root, file, width, height)
X  Display *dpy;
X***************
X*** 336,341 ****
X--- 360,366 ----
X      MailwatchWidget w = (MailwatchWidget) gw;
X  
X      XtFree(w->mailbox.filename);
X+     XtFree(w->mailbox.username);
X      REMOVE_TIMEOUT(w->mailbox.interval_id);
X      XtReleaseGC(w, w->mailbox.normal_GC);
X      XFreePixmap(XtDisplay(w), w->mailbox.flagup_pixmap);
X***************
X*** 356,363 ****
X  /*
X  ** Modified to NOT update the mail file timestamp via utimes(), and to
X  ** ignore state change where mail adds a status record to the message.
X! ** The first elminates collisions with mail during delivery, and the
X! ** second elminates false triggers for new mail.  The number of times
X  ** the terminal bell is rung is controlled by the same .mailrc resource
X  ** (bell) used by Sunview's mailtool.
X  */
X--- 381,388 ----
X  /*
X  ** Modified to NOT update the mail file timestamp via utimes(), and to
X  ** ignore state change where mail adds a status record to the message.
X! ** The first eliminates collisions with mail during delivery, and the
X! ** second eliminates false triggers for new mail.  The number of times
X  ** the terminal bell is rung is controlled by the same .mailrc resource
X  ** (bell) used by Sunview's mailtool.
X  */
X***************
X*** 413,447 ****
X  } /* check_mailbox */
X  
X  /*
X!  * get user name for building mailbox
X!  */
X  static void
X  GetMailFile(w)
X  MailwatchWidget w;
X  {
X!     char *getlogin();
X!     char *username;
X!     int len;
X  
X-     username = getlogin();
X-     if (!username) {
X- 	struct passwd *pw = getpwuid(getuid());
X  
X! 	if (!pw) {
X! 	    fprintf(stderr, "%s:  unable to find a username for you.\n",
X! 		"Mailbox widget");
X! 	    CloseDown(w, 1);
X! 	}
X! 	username = pw->pw_name;
X!     }
X!     if (!(w->mailbox.filename = (String) XtMalloc(strlen(MAILBOX_DIRECTORY)+1
X! 	  + strlen(username)+1))) {
X! 	fprintf(stderr, "can't allocate enough memory for widget.\n");
X! 	exit(1);
X!     }
X!     sprintf(w->mailbox.filename, "%s/%s", MAILBOX_DIRECTORY, username);
X! }
X  
X  static void
X  CloseDown(w, status)
X  MailwatchWidget w;
X--- 438,487 ----
X  } /* check_mailbox */
X  
X  /*
X! ** Retrieve the user's mailbox filename - use MAIL environment value, if set
X! */
X  static void
X  GetMailFile(w)
X  MailwatchWidget w;
X  {
X!  if (! (w->mailbox.filename = (char *) GetMailEnv("MAIL"))) {
X!     if (! (w->mailbox.filename = (String) XtMalloc(strlen(MAILBOX_DIRECTORY) + 1
X! 	  + strlen(w->mailbox.username) + 1))) {
X!        fprintf(stderr, "Mailbox widget: can't allocate enough memory.\n");
X!        CloseDown(w, 1);
X!       }
X!     sprintf(w->mailbox.filename,"%s/%s",MAILBOX_DIRECTORY,w->mailbox.username);
X!    }
X! } /* GetMailFile */
X  
X  
X! /*
X! ** Retrieve the mailbox user's name
X! */
X! static void
X! GetUserName(w)
X! MailwatchWidget w;
X! {
X!  char *username = (char *)getlogin();
X  
X+  if (! username) {
X+     struct passwd *pw = getpwuid(getuid());
X+ 
X+     if (! pw) {
X+        fprintf(stderr, "Mailbox widget: can't find your username.\n");
X+        CloseDown(w, 1);
X+       }
X+     username = pw->pw_name;
X+    }
X+ 
X+  if (! (w->mailbox.username = (String) XtMalloc(strlen(username) + 1))) {
X+     fprintf(stderr, "Mailbox widget: can't allocate space for username.\n");
X+     CloseDown(w, 1);
X+    }
X+  sprintf(w->mailbox.username, "%s", username);
X+ } /* GetUserName */
X+ 
X+ 
X  static void
X  CloseDown(w, status)
X  MailwatchWidget w;
X***************
X*** 481,509 ****
X   * drawing code
X   */
X  static void
X! redraw_mailbox(mw)
X! MailwatchWidget mw;
X  {
X!     register Display *dpy = XtDisplay(mw);
X!     register Window win = XtWindow(mw);
X!     register int x, y, w, h;
X!     Pixmap picture;
X  
X  
X      XClearWindow(dpy, win);
X!     if (mw->mailbox.flag_up) {			/* paint the "up" position */
X! 	picture = mw->mailbox.flagup_pixmap;
X  	w = pix_up_w, h = pix_up_h;
X      } else {					/* paint the "down" position */
X! 	picture = mw->mailbox.flagdown_pixmap;
X  	w = pix_dn_w, h = pix_dn_h;
X      }
X  
X      /* center the picture in the window */
X!     x = (mw->core.width - w) / 2;
X!     y = (mw->core.height - h) / 2;
X  
X!     XCopyArea(dpy, picture, win, mw->mailbox.normal_GC, 0, 0, w, h, x, y);
X  }
X  
X  
X--- 521,570 ----
X   * drawing code
X   */
X  static void
X! redraw_mailbox(m)
X! MailwatchWidget m;
X  {
X!     register Display	*dpy = XtDisplay(m);
X!     register Window	win = XtWindow(m);
X!     register int	x, y, w, h;
X!     Pixmap		picture;
X  
X  
X      XClearWindow(dpy, win);
X!     if (m->mailbox.flag_up) {			/* paint the "up" position */
X! 	picture = m->mailbox.flagup_pixmap;
X  	w = pix_up_w, h = pix_up_h;
X      } else {					/* paint the "down" position */
X! 	picture = m->mailbox.flagdown_pixmap;
X  	w = pix_dn_w, h = pix_dn_h;
X      }
X  
X      /* center the picture in the window */
X!     x = (m->core.width - w) / 2;
X!     y = (m->core.height - h) / 2;
X  
X!     XCopyArea(dpy, picture, win, m->mailbox.normal_GC, 0, 0, w, h, x, y);
X! 
X! /*
X! ** This hack exists because the font metrics LIE about the 'fixed' font width
X! */
X!     if (m->mailbox.useName) {
X!        h = m->mailbox.font->max_bounds.width - m->mailbox.font->max_bounds.lbearing;
X!        w = strlen(m->mailbox.username);
X!        h *= w;
X!        x = m->core.width - (h - 2);
X!        if (x < 2)
X!           x = 2;
X!        x /= 2;
X! 
X!        y = m->core.height - m->mailbox.font->descent;
X! 
X!        XFillRectangle(dpy, win, m->mailbox.invert_GC,
X!                       0, y - m->mailbox.font->ascent, m->core.width,
X!                       m->mailbox.font->ascent + m->mailbox.font->descent);
X! 
X!        XDrawString(dpy, win, m->mailbox.normal_GC, x, y, m->mailbox.username, w);
X!       }
X  }
X  
X  
X***************
X*** 516,519 ****
X   w->mailbox.flag_up = FALSE;
X   redraw_mailbox(w);
X  } /* reset_mailbox */
X- 
X--- 577,579 ----
X*** ../v1.1/MailwatchP.h	Mon Jun  4 09:46:28 1990
X--- MailwatchP.h	Mon Aug 27 11:09:17 1990
X***************
X*** 15,21 ****
X  typedef struct {			/* new fields for mailwatch widget */
X      Pixel	foreground_pixel;	/* color index of normal state fg */
X      GC		normal_GC;		/* normal GC to use */
X!     GC		invert_GC;		/* invert GC to use */
X      int		update;			/* seconds between updates */
X      String	filename;		/* filename to watch */
X      long	last_size;		/* size in bytes of mailboxname */
X--- 15,21 ----
X  typedef struct {			/* new fields for mailwatch widget */
X      Pixel	foreground_pixel;	/* color index of normal state fg */
X      GC		normal_GC;		/* normal GC to use */
X!     GC		invert_GC;		/* invert GC for FillRectangle call */
X      int		update;			/* seconds between updates */
X      String	filename;		/* filename to watch */
X      long	last_size;		/* size in bytes of mailboxname */
X***************
X*** 23,28 ****
X--- 23,31 ----
X      Boolean	reverseVideo;		/* do reverse video? */
X      Boolean	flag_up;		/* is the flag up? */
X      Boolean	bell;			/* ring the bell on new mail? */
X+     Boolean	useName;		/* add username to icon image? */
X+     String	username;		/* username of mailbox */
X+     XFontStruct *font;			/* font to use when displaying name */
X      String	mail;			/* author/subject/date info to "get" */
X      String	flagup;			/* path to alternate icon to use */
X      String	flagdown;		/* path to alternate icon to use */
X*** ../v1.1/actions.c	Mon Jun  4 09:48:34 1990
X--- actions.c	Mon Aug 27 11:09:18 1990
X***************
X*** 32,38 ****
X   * EVENT SHALL NATIONAL SEMICONDUCTOR CORPORATION BE LIABLE FOR ANY SPECIAL,
X   * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
X   * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
X!  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
X   * PERFORMANCE OF THIS SOFTWARE.
X   *
X   * The following software modules were created and are Copyrighted by National
X--- 32,38 ----
X   * EVENT SHALL NATIONAL SEMICONDUCTOR CORPORATION BE LIABLE FOR ANY SPECIAL,
X   * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
X   * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
X!  * OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
X   * PERFORMANCE OF THIS SOFTWARE.
X   *
X   * The following software modules were created and are Copyrighted by National
X***************
X*** 53,66 ****
X   * 13. MyNotify:
X   * 14. NextField:
X   * 15. PrintMsg:
X!  * 16. SetAliases:
X!  * 17. SetCursor:
X!  * 18. SetDirectory:
X!  * 19. SetFolders:
X!  * 20. SetHelp:
X!  * 21. SetMenu:
X!  * 22. SetPopup: and
X!  * 23. SetSelect.
X   *
X   * Author:  Michael C. Wagnitz - National Semiconductor Corporation
X   *
X--- 53,68 ----
X   * 13. MyNotify:
X   * 14. NextField:
X   * 15. PrintMsg:
X!  * 16. SavePos:
X!  * 17. SetAliases:
X!  * 18. SetCursor:
X!  * 19. SetDirectory:
X!  * 20. SetFolders:
X!  * 21. SetHelp:
X!  * 22. SetMenu:
X!  * 23. SetPopup:
X!  * 24. SetPos: and
X!  * 25. SetSelect.
X   *
X   * Author:  Michael C. Wagnitz - National Semiconductor Corporation
X   *
X***************
X*** 68,74 ****
X  
X  
X  #include "global.h"
X! #include <math.h>
X  #include <ctype.h>
X  #ifdef SUNOS_4
X  #include <dirent.h>
X--- 70,76 ----
X  
X  
X  #include "global.h"
X! #include "xmailregex.h"
X  #include <ctype.h>
X  #ifdef SUNOS_4
X  #include <dirent.h>
X***************
X*** 76,81 ****
X--- 78,84 ----
X  #include <sys/dir.h>
X  #endif
X  
X+ XtTextPosition SavedPos;
X  
X  /*
X  ** @(#)CheckInsert() - prevents the user from munging up the File: prompt.
X***************
X*** 222,229 ****
X  String		*params;
X  Cardinal	*num_params;
X  {
X!  int	i, n;
X  
X      strcpy(Command, "");
X      for (i = 0; i < *num_params; i++) {
X          strcat(Command, params[i]);
X--- 225,239 ----
X  String		*params;
X  Cardinal	*num_params;
X  {
X!  int		i, n;
X!  char		buf[BUFSIZ];
X!  Arg		args[1];
X!  LabelWidget	lw = (LabelWidget) WidgetOf(WidgetOf(WidgetOf(toplevel,
X! 					"topBox"), "titleBar"), "titleBar");
X  
X+  if (strcmp(params[0], "drop") == 0)
X+     DropIt(w, *params, NULL);
X+  else {
X      strcpy(Command, "");
X      for (i = 0; i < *num_params; i++) {
X          strcat(Command, params[i]);
X***************
X*** 230,250 ****
X          strcat(Command, " ");
X         }
X      if (i)
X!     Command[strlen(Command)-1] = '\0';	/* Drop the last trailing blank */
X      strcat(Command, "\n");
X  
X!  if (mailpid)				/* If connections are okay,... */
X!     writeMail(Command);
X!  else if (strcmp(Command, "file %\n") != 0)
X!          Bell("No mail\n");		/* If not 'new mail', complain */
X!       else {
X!          if (strcmp(mailargv[mailargc - 2], "-f") == 0) {
X!             mailargc -= 2;		/* throw away any folder argument */
X!             mailargv[mailargc] = NULL;	/* and NULL end of argument list */
X!            }
X!          callMail(mailargc, mailargv);	/* restart the mail connections */
X!          strcpy(Command, "Start");	/* Let em know we've re-started */
X!          UnsetNewmail(w, NULL, NULL);
X     }
X  } /* DoCmd */
X  
X--- 240,271 ----
X          strcat(Command, " ");
X         }
X      if (i)
X!        Command[strlen(Command)-1] = '\0'; /* Drop the last trailing blank */
X      strcat(Command, "\n");
X  
X!     if (mailpid) {			/* If connections are okay,... */
X!        if ((n = match(&command_pattern, Command)) != C_FILE && n != C_NEWMAIL)
X!           writeMail(Command);
X!        else {				/* check for commit of any changes */
X!           XtSetArg(args[0], XtNlabel, (XtArgVal) NULL);
X!           XtGetValues(lw, args, ONE);
X!           strcpy(buf, (char *)args[0].value);
X! 
X!           if (strcmp(&buf[strlen(buf)-7],"deleted") ||
X!               Confirm("COMMIT all changes to this folder"))
X!              writeMail(Command);
X!          }
X!       } else if (C_NEWMAIL != match(&command_pattern, Command))
X!                 Bell("No mail\n");	/* If not 'new mail', complain */
X!         else {
X!              if (strcmp(mailargv[mailargc - 2], "-f") == 0) {
X!                 mailargc -= 2;		/* throw away any folder argument */
X!                 mailargv[mailargc] = NULL; /* and NULL end of argument list */
X!                }
X!              callMail(mailargc, mailargv); /* restart the mail connections */
X!              strcpy(Command, "Start");	/* Let em know we've re-started */
X!              UnsetNewmail(w, NULL, NULL);
X!             }
X     }
X  } /* DoCmd */
X  
X***************
X*** 260,266 ****
X  String		*params;
X  Cardinal	*num_params;
X  {
X!  Done(w, *params, NULL);
X  } /* DoDone */
X  
X  
X--- 281,298 ----
X  String		*params;
X  Cardinal	*num_params;
X  {
X!  Widget		Popup = XtParent(XtParent(w));
X!  Widget		To    = WidgetOf(WidgetOf(Popup, "SubjCc"), "To");
X! 
X! 
X!  if (strcmp(params[0], "ReEdit") != 0)
X!     Done(w, *params, NULL);
X!  else {
X!     XtPopdown(Popup);
X!     editMail();
X!     XtPopup(Popup, XtGrabNone);
X!     XWarpPointer(XtDisplay(toplevel), None, XtWindow(To), 0, 0, 0, 0, 10, 5);
X!    }
X  } /* DoDone */
X  
X  
X***************
X*** 332,337 ****
X--- 364,370 ----
X         if (*params[0] != 'n' && *params[0] != '-') {
X            pos = XtTextGetInsertionPoint(iw);
X            num = PositionToMsgNumber(pos);	/* no current msg equals zero */
X+           pos = XtTextGetInsertionPoint(iw);
X            if (num && *params[0] == 'u' && IndexBuf[pos + 1] != 'D') num = 0;
X           }
X         if (num) sprintf(Command, "%s %d\n", params[0], num);
X***************
X*** 353,358 ****
X--- 386,395 ----
X  String		*params;
X  Cardinal	*num_params;
X  {
X+  char		buf[BUFSIZ];
X+  Arg		args[1];
X+  LabelWidget	lw = (LabelWidget) WidgetOf(WidgetOf(WidgetOf(toplevel,
X+ 					"topBox"), "titleBar"), "titleBar");
X   XtTextPosition pos;
X   char		*p;
X   Cardinal	n;
X***************
X*** 363,371 ****
X   else {
X      FileBuf[StartPos + n] = '\0';
X      p = FileBuf + StartPos;
X!     if (mailpid) {
X!        sprintf(Command, "file %s\n", p);
X!        writeMail(Command);
X        } else {
X  /*
X  ** We must first re-establish contact with the mail utility.
X--- 400,415 ----
X   else {
X      FileBuf[StartPos + n] = '\0';
X      p = FileBuf + StartPos;
X!     if (mailpid) {			/* check for commit of any changes */
X!        XtSetArg(args[0], XtNlabel, (XtArgVal) NULL);
X!        XtGetValues(lw, args, ONE);
X!        strcpy(buf, (char *)args[0].value);
X! 
X!        if (strcmp(&buf[strlen(buf) - 7], "deleted") ||
X!            Confirm("COMMIT all changes to this folder")) {
X!           sprintf(Command, "file %s\n", p);
X!           writeMail(Command);
X!          }
X        } else {
X  /*
X  ** We must first re-establish contact with the mail utility.
X***************
X*** 489,494 ****
X--- 533,553 ----
X  
X  
X  /*
X+ ** @(#)SavePos() - save the current insert position of the widget
X+ */
X+ /* ARGSUSED */
X+ XtActionProc
X+ SavePos(w, event, params, num_params)
X+ Widget		w;
X+ XEvent		*event;
X+ String		*params;
X+ Cardinal	*num_params;
X+ {
X+  SavedPos = XtTextGetInsertionPoint(w);
X+ } /* SavePos */
X+ 
X+ 
X+ /*
X  ** @(#)SetAliases() - create a menu list of alias names
X  */
X  /* ARGSUSED */
X***************
X*** 673,680 ****
X   if (! popup || popup->core.being_destroyed) {
X      p = GetMailEnv("folder");			/* returns NULL if none */
X      if (p && strlen(p)) {
X!        sprintf(foldir, "%s/%s/", getenv("HOME"), p);
X!        XtFree((char *)p);			/* p still has an address */
X        } else
X         strcpy(foldir, "");	/* If no folder variable, then no folders */
X      foldlen = strlen(foldir);
X--- 732,750 ----
X   if (! popup || popup->core.being_destroyed) {
X      p = GetMailEnv("folder");			/* returns NULL if none */
X      if (p && strlen(p)) {
X!        /*
X! 	* Don't prepend HOME if it starts with a slash or a .
X! 	*/
X!        if (index("/.", *p))
X! 	   strcpy(foldir, p);
X!        else
X! 	   sprintf(foldir, "%s/%s", getenv("HOME"), p);
X!        XtFree((char *)p);
X!        /*
X! 	* Make sure it ends with (only one) slash
X! 	*/
X!        if (LASTCH(foldir) != '/')
X!           strcat(foldir, "/");
X        } else
X         strcpy(foldir, "");	/* If no folder variable, then no folders */
X      foldlen = strlen(foldir);
X***************
X*** 699,705 ****
X                        }
X                      strcat(List, " ");
X                      strcat(List, dp->d_name);
X!                     if (++x % 6 == 0) {
X                         x = 0;
X                         strcat(List, "\n");
X                        }
X--- 769,775 ----
X                        }
X                      strcat(List, " ");
X                      strcat(List, dp->d_name);
X!                     if (++x % 4 == 0) {
X                         x = 0;
X                         strcat(List, "\n");
X                        }
X***************
X*** 709,720 ****
X              } /* end - if folder directory is readable */
X           } /* end - if mail process is running */
X        } /* end - if a folder value exists */
X  /*
X  ** determine proper label width by finding longest word length
X  */
X      strcpy(trans, "");
X      x = 0;
X!     if (p)				/* if folders exist and are readable */
X         for (p = List; *p; p++) {
X             if (*p == ' ' || *p == '\n' || *p == '\t') {
X                if (x) {
X--- 779,798 ----
X              } /* end - if folder directory is readable */
X           } /* end - if mail process is running */
X        } /* end - if a folder value exists */
X+ 
X+     if (List)				/* could be null if no current mail */
X+        if (O_BELL == match(&output_pattern, List)) {
X+           strcat(List, "\n");
X+           Bell(List);
X+           XtFree((char *)List);
X+           List = NULL;
X+          }
X  /*
X  ** determine proper label width by finding longest word length
X  */
X      strcpy(trans, "");
X      x = 0;
X!     if (List)				/* if folders exist and are readable */
X         for (p = List; *p; p++) {
X             if (*p == ' ' || *p == '\n' || *p == '\t') {
X                if (x) {
X***************
X*** 744,750 ****
X  /*
X  ** Now, make equal width command buttons which contain the folder names
X  */
X!        XtSetArg(args[0], XtNwidth, XTextWidth(TextFontStr, trans, n) + 14);
X         XtSetArg(args[1], XtNfont, TextFontStr);
X         XtSetArg(args[2], XtNtranslations, XtParseTranslationTable(fl_trans));
X         XtSetArg(args[3], XtNcallback, fl_callbacks);
X--- 822,828 ----
X  /*
X  ** Now, make equal width command buttons which contain the folder names
X  */
X!        XtSetArg(args[0], XtNwidth, XTextWidth(TextFontStr, trans, n) + 20);
X         XtSetArg(args[1], XtNfont, TextFontStr);
X         XtSetArg(args[2], XtNtranslations, XtParseTranslationTable(fl_trans));
X         XtSetArg(args[3], XtNcallback, fl_callbacks);
X***************
X*** 823,834 ****
X      if (! *foldir)
X         Bell("No value set for \"folder\"\n");
X      else {
X!        if (dirp && !mailpid) {
X!           Bell("No mail folders exist\n");
X!          } else {
X!           foldir[foldlen - 1] = '\0';
X!           sprintf(tmp, "%s not found\n", foldir);
X!           Bell(tmp);
X           }
X        }
X     } else {
X--- 901,914 ----
X      if (! *foldir)
X         Bell("No value set for \"folder\"\n");
X      else {
X!        if (dirp) {
X!           if (! mailpid) {
X!              Bell("No mail folders exist\n");
X!             } else {
X!              foldir[foldlen - 1] = '\0';
X!              sprintf(tmp, "%s not found\n", foldir);
X!              Bell(tmp);
X!             }
X           }
X        }
X     } else {
X***************
X*** 854,861 ****
X      XtSetValues(popup, (ArgList) args, 2);
X     }
X  
X!  XtFree((char *)List);
X! 
X  } /* SetFolders */
X  
X  
X--- 934,941 ----
X      XtSetValues(popup, (ArgList) args, 2);
X     }
X  
X!  if (List)
X!     XtFree((char *)List);
X  } /* SetFolders */
X  
X  
X***************
X*** 931,937 ****
X   static String m_Trans =
X  	"<Btn3Up>:	MenuPopdown(set_menu)";
X  
X!  static String list[] = { "alwaysignore", "autoprint", "hold", NULL };
X  
X  
X   menu = XtNameToWidget(parent, "set_menu");
X--- 1011,1017 ----
X   static String m_Trans =
X  	"<Btn3Up>:	MenuPopdown(set_menu)";
X  
X!  static String list[] = { "alwaysignore", "autoprint", "hold", "expert", NULL };
X  
X  
X   menu = XtNameToWidget(parent, "set_menu");
X***************
X*** 953,961 ****
X      XtSetArg(args[3], XtNtranslations, XtParseTranslationTable(b_Trans));
X      for (indx = 0; list[indx] != NULL; indx++) {
X          strcpy(label, "set ");
X!         if ((c = GetMailEnv(list[indx])) != NULL) {
X!            strcat(label, "no");
X!            XtFree(c);
X            }
X          strcat(label, list[indx]);		/* set window name by label */
X          strcpy(name, &label[4]);
X--- 1033,1046 ----
X      XtSetArg(args[3], XtNtranslations, XtParseTranslationTable(b_Trans));
X      for (indx = 0; list[indx] != NULL; indx++) {
X          strcpy(label, "set ");
X!         if (strcmp(list[indx], "expert") == 0) {
X!            if (XMail.expert)
X!               strcat(label, "no");
X!           } else {
X!            if ((c = GetMailEnv(list[indx])) != NULL) {
X!               strcat(label, "no");
X!               XtFree(c);
X!              }
X            }
X          strcat(label, list[indx]);		/* set window name by label */
X          strcpy(name, &label[4]);
X***************
X*** 1035,1081 ****
X  } /* SetPopup */
X  
X  
X  /* ARGSUSED */
X  /*
X! ** @(#)SetSelect() - highlight the index number of the selected message
X  */
X  XtActionProc
X  SetSelect(w, event, params, num_params)
X! Widget w;
X  XEvent *event;		/* unused */
X  String *params;		/* unused */
X  Cardinal *num_params;	/* unused */
X  {
X!  XClientMessageEvent	cm;
X!  XtTextPosition pos, left, right;
X!  String	s;
X! 
X! 
X!  pos = XtTextGetInsertionPoint(w);
X! 
X!  for (s = IndexBuf + pos; s > IndexBuf && *(s - 1) != '\n'; s--);
X! 
X!  pos = s - IndexBuf;
X! /*
X! ** use XSendEvent to remove any prior selection highlight
X! */
END_OF_FILE
if test 49821 -ne `wc -c <'Patch.02a'`; then
    echo shar: \"'Patch.02a'\" unpacked with wrong size!
fi
# end of 'Patch.02a'
fi
echo shar: End of archive 3 \(of 5\).
cp /dev/null ark3isdone
MISSING=""
for I in 1 2 3 4 5 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 5 archives.
    rm -f ark[1-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0

dan
----------------------------------------------------
O'Reilly && Associates   argv@sun.com / argv@ora.com
Opinions expressed reflect those of the author only.