elm 2.2 Patch #5

Syd Weinstein syd at dsinc.DSI.COM
Sat Apr 29 06:08:36 AEST 1989


Summary: This is an official patch for elm 2.2 system.  Please apply it.
Priority: LOW

This reinstates elm 2.1 functionality of saving a copy of an outbound
message by name only if the folder preexists, while keeping the new
functionality of allowing save-by-name to also occur regardless of
the preexistence of the folder.
From: Rob Bernardo <clib!rob>

Change Configure to use sgtty first if BSD and TERMIO first if not.
From: Syd

Fix:	From rn, say "| patch -p -N -d DIR", where DIR is your elm source
	directory.  Outside of rn, say "cd DIR; patch -p -N <thisarticle".
	If you don't have the patch program, apply the following by hand,
	or get patch (version 2.0, latest patchlevel).

	After patching:
		Configure -d
		make
		make install

	If patch indicates that patchlevel is the wrong version, you may need
	to apply one or more previous patches, or the patch may already
	have been applied.  See the patchlevel.h file to find out what has or
	has not been applied.  In any event, don't continue with the patch.

	If you are missing previous patches they can be obtained from me:

	Syd Weinstein
	syd at dsinc.UUCP

	The patches are available from the dsinc archive server
	Send the following message to archive-server at dsinc.UUCP for
	a list of available patches:

	Subject: patch list
	send index elm

Index: hdrs/patchlevel.h
Prereq: 4
*** ../elm2.2/hdrs/patchlevel.h	Wed Apr 26 12:11:59 1989
--- hdrs/patchlevel.h	Fri Apr 28 14:45:53 1989
***************
*** 1 ****
! #define PATCHLEVEL 4
--- 1 ----
! #define PATCHLEVEL 5

Index: Configure
Prereq: 2.38
*** ../elm2.2/Configure	Wed Apr 19 11:55:39 1989
--- Configure	Fri Apr 28 15:08:06 1989
***************
*** 8,14 ****
  # and edit it to reflect your system.  Some packages may include samples
  # of config.h for certain machines, so you might look for one of those.)
  #
! # $Header: /files/home/users/syd/elm/RCS/Configure,v 2.38 89/04/19 11:15:30 syd Exp $
  #
  # Yes, you may rip this off to use in other distribution packages.
  # (Note: this Configure script was generated automatically.  Rather than
--- 8,14 ----
  # and edit it to reflect your system.  Some packages may include samples
  # of config.h for certain machines, so you might look for one of those.)
  #
! # $Header: /files/home/users/syd/elm/RCS/Configure,v 2.39 89/04/28 15:07:28 syd Exp $
  #
  # Yes, you may rip this off to use in other distribution packages.
  # (Note: this Configure script was generated automatically.  Rather than
***************
*** 2358,2372 ****
  	    echo "termio.h not found--you could have problems."
  	fi
      fi
! elif $test -r /usr/include/termio.h ; then
!     d_termio="$define"
!     echo "termio.h found."
! elif $test -r /usr/include/sgtty.h ; then
!     d_termio="$undef"
!     echo "sgtty.h found."
  else
!     d_termio="$undef"
!     echo "Neither termio.h nor sgtty.h found--you could have problems."
  fi
  
  : see if struct tm is defined in sys/time.h
--- 2358,2385 ----
  	    echo "termio.h not found--you could have problems."
  	fi
      fi
! elif bsd ; then
!     if $test -r /usr/include/sgtty.h ; then
! 	d_termio="$undef"
! 	echo "sgtty.h found."
!     elif $test -r /usr/include/termio.h ; then
! 	d_termio="$define"
! 	echo "termio.h found."
!     else
! 	d_termio="$undef"
! 	echo "Neither termio.h nor sgtty.h found--you could have problems."
!     fi
  else
!     if $test -r /usr/include/termio.h ; then
! 	d_termio="$define"
! 	echo "termio.h found."
!     elif $test -r /usr/include/sgtty.h ; then
! 	d_termio="$undef"
! 	echo "sgtty.h found."
!     else
! 	d_termio="$undef"
! 	echo "Neither termio.h nor sgtty.h found--you could have problems."
!     fi
  fi
  
  : see if struct tm is defined in sys/time.h

Index: doc/Ref.guide
Prereq: 2.24
*** ../elm2.2/doc/Ref.guide	Wed Apr 26 12:12:00 1989
--- doc/Ref.guide	Fri Apr 28 14:48:12 1989
***************
*** 1,4 ****
! \" @(#)$Id: Ref.guide,v 2.24 89/04/26 11:39:03 syd Exp $
  \"
  \"  Reference guide to the Elm mail system.
  \"  format with 
--- 1,4 ----
! \" @(#)$Id: Ref.guide,v 2.25 89/04/28 14:48:06 syd Exp $
  \"
  \"  Reference guide to the Elm mail system.
  \"  format with 
***************
*** 12,17 ****
--- 12,24 ----
  \"  (C) Copyright 1988, 1989 Usenet Community Trust
  \"
  \"  $Log:	Ref.guide,v $
+ \" Revision 2.25  89/04/28  14:48:06  syd
+ \" This reinstates elm 2.1 functionality of saving a copy of an outbound
+ \" message by name only if the folder preexists, while keeping the new
+ \" functionality of allowing save-by-name to also occur regardless of
+ \" the preexistence of the folder.
+ \" From: Rob Bernardo <clib!rob>
+ \" 
  \" Revision 2.24  89/04/26  11:39:03  syd
  \" Fix the pattern-matching feature of ~f/~m in the builtin editor
  \" and fix the documentation for the builtin editor in the Reference Guide.
***************
*** 238,250 ****
  This is the folder to which a copy of outgoing mail is automatically
  saved.  This will only be done if the \f2copy\f1 flag
  is turned on (see below).  Also note that if the \f2savename\f1 feature
! (see below) is enabled then this folder will be ignored since the program
! will save to a folder that has the same name as the login
  of the person you're sending to.
  Whether or not a copy is saved, and to what folder, can be changed just
  prior to sending a message, see below.
  (The default is "=sent", that is,
! a folder called \f2received\f1 in your \f2maildir\f1 directory).
  
  .lp shell 1.0i
  This defines the shell to use when doing ``!'' escapes and
--- 245,257 ----
  This is the folder to which a copy of outgoing mail is automatically
  saved.  This will only be done if the \f2copy\f1 flag
  is turned on (see below).  Also note that if the \f2savename\f1 feature
! (see below) is enabled then this folder may be ignored since the program
! may save to a folder that has the same name as the login
  of the person you're sending to.
  Whether or not a copy is saved, and to what folder, can be changed just
  prior to sending a message, see below.
  (The default is "=sent", that is,
! a folder called \f2sent\f1 in your \f2maildir\f1 directory).
  
  .lp shell 1.0i
  This defines the shell to use when doing ``!'' escapes and
***************
*** 366,373 ****
  resynchronize a folder or change folders,
  and instead it should just use the values of
  ``alwaysdelete'', ``alwaysstore'', and ``awayskeep'' without prompting.
! Note that when you quit \f2elm\fP, if you use `q', you will be asked
! these questions, and if you use `Q', you won't.
  (The default is ON, i.e. to ask the questions.)
  
  .lp askcc 1.0i
--- 373,381 ----
  resynchronize a folder or change folders,
  and instead it should just use the values of
  ``alwaysdelete'', ``alwaysstore'', and ``awayskeep'' without prompting.
! (Note that when you quit \f2elm\fP, if you use `q', you will always be asked
! these questions, and if you use `Q', you will never, regardless of how
! you have \f2ask\f1 set.)
  (The default is ON, i.e. to ask the questions.)
  
  .lp askcc 1.0i
***************
*** 392,397 ****
--- 400,410 ----
  a message, see below.
  (The default is OFF.)
  
+ .lp forcename 1.0i
+ This, in combination with the \f2savename\f1 option, governs
+ how a copy of an outgoing message will be saved.  (See \f2savename\f1 below
+ for details.)  (The default is OFF.)
+ 
  .lp keep 1.0i
  The mail system has a habit of deleting folders when you've
  removed everything from them.  With this option turned on, it will
***************
*** 481,492 ****
  list only.
  .ef
  
! In practice, this means that important people that you communicate
  with (those that you tend to save mail from) have folders that are
  actually \f2a recorded log of the discussion in both directions\f1
  and those others (random mailings) are all stuffed in the \f2sentmail\f1
! folder for easy perusal and removal. (The default is ON.)
  
  .lp softkeys 1.0i
  If on, this tells \f2elm\f1 that you have an HP terminal with the
  HP 2622 function key protocol and that you'd like to have them available
--- 494,512 ----
  list only.
  .ef
  
! If \f2forcename\f1 is off (see above), the copy will be saved to
! that folder only if the folder already exists.  In practice,
! this means that important people that you communicate
  with (those that you tend to save mail from) have folders that are
  actually \f2a recorded log of the discussion in both directions\f1
  and those others (random mailings) are all stuffed in the \f2sentmail\f1
! folder for easy perusal and removal.
  
+ Otherwise, if you always want to save copies of outgoing messages
+ in separate folders by recipient login name,
+ you'll want to set \f2forcename\f1 to on.  (The
+ default for \f2savename\f1 is ON.)
+ 
  .lp softkeys 1.0i
  If on, this tells \f2elm\f1 that you have an HP terminal with the
  HP 2622 function key protocol and that you'd like to have them available
***************
*** 658,663 ****
--- 678,687 ----
    # save messages, incoming and outbound, by login name of sender/recipient?
    savename = ON
  
+   # save outbound messages by login name of sender even if the associated
+   # folder doesn't already exist?
+   forcename = OFF
+ 
    # are we running on an HP terminal and want HOME, PREV, NEXT, etc...?
    # (this implies "keypad=ON" too)
    softkeys = OFF
***************
*** 1284,1300 ****
  options appears:
  
  .lp \h'24p'c 66p
! Specify folder for saving copy to.  This allows you to override the
! \f2copy\f1 and \f2savename\f1 options of your \f2.elm/elmrc\f1 file.  It
! prompts you for the name of the folder were a copy of the outgoing message
! is to be saved.  The default displayed is taken from those two \f2.elm/elmrc\f1
  options and can be changed.  This command also allows you to
! use `>' for your \f2receivedmail\f1 folder and
! `<' for your \f2sentmail\f1 folder, and `=' to mean ``save by name''. (See the
! the \f2savename\f1 option above).  (Since you could next enter
  the \f2edit headers\f1 command and change the recipients
  of your message, the name of the folder under the
! ``save by name'' option is established later when you enter the \f2send\f1
  command.)  You can also enter `?' at the prompt
  to list the names of your folders.
  
--- 1308,1327 ----
  options appears:
  
  .lp \h'24p'c 66p
! Specify folder for saving a copy to.  This allows you to override the
! \f2copy\f1, \f2forcename\f1 and \f2savename\f1 options
! of your \f2.elm/elmrc\f1 file.  It prompts you for the name
! of the folder where a copy of the outgoing message is to be saved.  The
! default displayed is taken from those three \f2.elm/elmrc\f1
  options and can be changed.  This command also allows you to
! use `>' for your \f2receivedmail\f1 folder
! and `<' for your \f2sentmail\f1 folder,
! and `=?' to mean ``conditionally save by name''
! and `=' to mean ``unconditionally save by name''. (See the \f2savename\f1
! option above for details on saving by name.)  (Since you could next enter
  the \f2edit headers\f1 command and change the recipients
  of your message, the name of the folder under the
! two ``save by name'' options is not established until you enter the \f2send\f1
  command.)  You can also enter `?' at the prompt
  to list the names of your folders.
  

Index: doc/elmrc-info
Prereq: 2.9
*** ../elm2.2/doc/elmrc-info	Sat Mar 25 21:01:07 1989
--- doc/elmrc-info	Fri Apr 28 14:48:14 1989
***************
*** 1,4 ****
! #@(#)$Id: elmrc-info,v 2.9 89/03/25 21:00:41 syd Exp $
  # Elm Version 2.2
  # For yes/no settings with ?, ON means yes, OFF means no
  
--- 1,4 ----
! #@(#)$Id: elmrc-info,v 2.10 89/04/28 14:48:13 syd Exp $
  # Elm Version 2.2
  # For yes/no settings with ?, ON means yes, OFF means no
  
***************
*** 67,72 ****
--- 67,76 ----
  
  savename
  # save messages, incoming and outbound, by login name of sender/recipient?
+ 
+ forcename
+ # save outbound messages by login name of sender even if the associated
+ # folder doesn't already exist?
  
  movepage
  # when using the page commands (+ - <NEXT> <PREV>) change the current

Index: doc/elmrc.samp
Prereq: 2.8
*** ../elm2.2/doc/elmrc.samp	Fri Mar 31 09:39:05 1989
--- doc/elmrc.samp	Fri Apr 28 14:48:16 1989
***************
*** 1,4 ****
! #@(#)$Id: elmrc.samp,v 2.8 89/03/31 09:38:57 syd Exp $
  #
  # .elm/elmrc - options file for the ELM mail system
  #
--- 1,4 ----
! #@(#)$Id: elmrc.samp,v 2.9 89/04/28 14:48:15 syd Exp $
  #
  # .elm/elmrc - options file for the ELM mail system
  #
***************
*** 113,118 ****
--- 113,122 ----
  
  # save messages, incoming and outbound, by login name of sender/recipient?
  savename = ON
+ 
+ # save outbound messages by login name of sender even if the associated
+ # folder doesn't already exist?
+ forcename = OFF
  
  # are we running on an HP terminal and want HOME, PREV, NEXT, etc...?
  # (this implies "keypad=ON" too)

Index: hdrs/elm.h
Prereq: 2.21
*** ../elm2.2/hdrs/elm.h	Thu Mar 30 10:34:30 1989
--- hdrs/elm.h	Fri Apr 28 14:48:17 1989
***************
*** 1,8 ****
  
! /* $Id: elm.h,v 2.21 89/03/25 21:45:26 syd Exp $ */
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 2.21 $   $State: Exp $
   *
   * 			Copyright (c) 1986, 1987 Dave Taylor
   * 			Copyright (c) 1988, 1989 USENET Community Trust
--- 1,8 ----
  
! /* $Id: elm.h,v 2.22 89/04/28 14:48:16 syd Exp $ */
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 2.22 $   $State: Exp $
   *
   * 			Copyright (c) 1986, 1987 Dave Taylor
   * 			Copyright (c) 1988, 1989 USENET Community Trust
***************
*** 14,19 ****
--- 14,26 ----
   *
   *******************************************************************************
   * $Log:	elm.h,v $
+  * Revision 2.22  89/04/28  14:48:16  syd
+  * This reinstates elm 2.1 functionality of saving a copy of an outbound
+  * message by name only if the folder preexists, while keeping the new
+  * functionality of allowing save-by-name to also occur regardless of
+  * the preexistence of the folder.
+  * From: Rob Bernardo <clib!rob>
+  * 
   * Revision 2.21  89/03/25  21:45:26  syd
   * Initial 2.2 Release checkin
   * 
***************
*** 110,115 ****
--- 117,123 ----
  int hp_terminal = 0;		/* flag: are we on HP term?	    */
  int hp_softkeys = 0;		/* flag: are there softkeys?        */
  int save_by_name = 1;		/* flag: save mail by login name?   */
+ int force_name = 0;		/* flag: save by name forced?	    */
  int mail_only = 0;		/* flag: send mail then leave?      */
  int check_only = 0;		/* flag: check aliases then leave?  */
  int batch_only = 0;		/* flag: send without prompting?    */

Index: hdrs/headers.h
Prereq: 2.18
*** ../elm2.2/hdrs/headers.h	Thu Mar 30 10:34:38 1989
--- hdrs/headers.h	Fri Apr 28 14:48:19 1989
***************
*** 1,8 ****
  
! /* $Id: headers.h,v 2.18 89/03/25 21:45:31 syd Exp $ */
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 2.18 $   $State: Exp $
   *
   * 			Copyright (c) 1986, 1987 Dave Taylor
   * 			Copyright (c) 1988, 1989 USENET Community Trust
--- 1,8 ----
  
! /* $Id: headers.h,v 2.19 89/04/28 14:48:18 syd Exp $ */
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 2.19 $   $State: Exp $
   *
   * 			Copyright (c) 1986, 1987 Dave Taylor
   * 			Copyright (c) 1988, 1989 USENET Community Trust
***************
*** 14,19 ****
--- 14,26 ----
   *
   *******************************************************************************
   * $Log:	headers.h,v $
+  * Revision 2.19  89/04/28  14:48:18  syd
+  * This reinstates elm 2.1 functionality of saving a copy of an outbound
+  * message by name only if the folder preexists, while keeping the new
+  * functionality of allowing save-by-name to also occur regardless of
+  * the preexistence of the folder.
+  * From: Rob Bernardo <clib!rob>
+  * 
   * Revision 2.18  89/03/25  21:45:31  syd
   * Initial 2.2 Release checkin
   * 
***************
*** 108,113 ****
--- 115,121 ----
  extern int  hp_terminal;	/* flag: are we on an hp terminal?    */
  extern int  hp_softkeys;	/* flag: are there softkeys?          */
  extern int  save_by_name;  	/* flag: save mail by login name?     */
+ extern int  force_name;		/* flag: save by name forced?	      */
  extern int  mail_only;		/* flag: send mail then leave?        */
  extern int  check_only;		/* flag: check aliases and leave?     */
  extern int  batch_only;		/* flag: send without prompting?      */

Index: hdrs/save_opts.h
Prereq: 2.9
*** ../elm2.2/hdrs/save_opts.h	Thu Mar 30 10:34:41 1989
--- hdrs/save_opts.h	Fri Apr 28 14:48:20 1989
***************
*** 1,8 ****
  
! /* @(#)$Id: save_opts.h,v 2.9 89/03/25 21:45:33 syd Exp $ */
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 2.9 $   $State: Exp $
   *
   * 			Copyright (c) 1986, 1987 Dave Taylor
   * 			Copyright (c) 1988, 1989 USENET Community Trust
--- 1,8 ----
  
! /* @(#)$Id: save_opts.h,v 2.10 89/04/28 14:48:19 syd Exp $ */
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 2.10 $   $State: Exp $
   *
   * 			Copyright (c) 1986, 1987 Dave Taylor
   * 			Copyright (c) 1988, 1989 USENET Community Trust
***************
*** 14,19 ****
--- 14,26 ----
   *
   *******************************************************************************
   * $Log:	save_opts.h,v $
+  * Revision 2.10  89/04/28  14:48:19  syd
+  * This reinstates elm 2.1 functionality of saving a copy of an outbound
+  * message by name only if the folder preexists, while keeping the new
+  * functionality of allowing save-by-name to also occur regardless of
+  * the preexistence of the folder.
+  * From: Rob Bernardo <clib!rob>
+  * 
   * Revision 2.9  89/03/25  21:45:33  syd
   * Initial 2.2 Release checkin
   * 
***************
*** 37,72 ****
  #define COPY			10
  #define EDITOR			11
  #define ESCAPECHAR		12
! #define FORMS			13
! #define FULLNAME		14
! #define KEEPEMPTY		15
! #define KEYPAD			16
! #define LOCALSIGNATURE		17
! #define MAILDIR			18
! #define MENU			19
! #define MOVEPAGE		20
! #define NAMES			21
! #define NOHEADER		22
! #define PAGER			23
! #define POINTNEW		24
! #define PREFIX			25
! #define PRINT			26
! #define PROMPTAFTER		27
! #define RECEIVEDMAIL		28
! #define REMOTESIGNATURE		29
! #define RESOLVE			30
! #define SAVENAME		31
! #define SENTMAIL		32
! #define SHELL			33
! #define SIGNATURE		34
! #define SOFTKEYS		35
! #define SORTBY			36
! #define TIMEOUT			37
! #define TITLES			38
! #define USERLEVEL		39
! #define WARNINGS		40
! #define WEED			41
! #define WEEDOUT			42
  
  #define NUMBER_OF_SAVEABLE_OPTIONS	WEEDOUT+1
  
--- 44,80 ----
  #define COPY			10
  #define EDITOR			11
  #define ESCAPECHAR		12
! #define FORCENAME		13
! #define FORMS			14
! #define FULLNAME		15
! #define KEEPEMPTY		16
! #define KEYPAD			17
! #define LOCALSIGNATURE		18
! #define MAILDIR			19
! #define MENU			20
! #define MOVEPAGE		21
! #define NAMES			22
! #define NOHEADER		23
! #define PAGER			24
! #define POINTNEW		25
! #define PREFIX			26
! #define PRINT			27
! #define PROMPTAFTER		28
! #define RECEIVEDMAIL		29
! #define REMOTESIGNATURE		30
! #define RESOLVE			31
! #define SAVENAME		32
! #define SENTMAIL		33
! #define SHELL			34
! #define SIGNATURE		35
! #define SOFTKEYS		36
! #define SORTBY			37
! #define TIMEOUT			38
! #define TITLES			39
! #define USERLEVEL		40
! #define WARNINGS		41
! #define WEED			42
! #define WEEDOUT			43
  
  #define NUMBER_OF_SAVEABLE_OPTIONS	WEEDOUT+1
  
***************
*** 88,93 ****
--- 96,102 ----
   { "copy", -1L },          	
   { "editor", -1L },
   { "escape", -1L }, 	  
+  { "forcename", -1L },         	
   { "forms", -1L },         	
   { "fullname", -1L },
   { "keepempty", -1L }, 	  

Index: src/mailmsg2.c
Prereq: 2.30
*** ../elm2.2/src/mailmsg2.c	Mon Apr 24 21:25:20 1989
--- src/mailmsg2.c	Fri Apr 28 14:48:23 1989
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 2.30 89/04/24 21:18:49 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 2.30 $   $State: Exp $
   *
   * 			Copyright (c) 1986, 1987 Dave Taylor
   * 			Copyright (c) 1988, 1989 USENET Community Trust
--- 1,8 ----
  
! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 2.31 89/04/28 14:48:21 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 2.31 $   $State: Exp $
   *
   * 			Copyright (c) 1986, 1987 Dave Taylor
   * 			Copyright (c) 1988, 1989 USENET Community Trust
***************
*** 14,19 ****
--- 14,26 ----
   *
   *******************************************************************************
   * $Log:	mailmsg2.c,v $
+  * Revision 2.31  89/04/28  14:48:21  syd
+  * This reinstates elm 2.1 functionality of saving a copy of an outbound
+  * message by name only if the folder preexists, while keeping the new
+  * functionality of allowing save-by-name to also occur regardless of
+  * the preexistence of the folder.
+  * From: Rob Bernardo <clib!rob>
+  * 
   * Revision 2.30  89/04/24  21:18:49  syd
   * This fixes a number of bugs with the builtin editor. (1) It used to use
   * stdio functions and not curses functions to write to the screen causing
***************
*** 184,193 ****
  
  	/* calculate default save_file name */
  	if(auto_cc) {
! 	  if(save_by_name)
! 	    strcpy(copy_file, "=");	/* signals save by 'to' logname */
! 	  else
  	    strcpy(copy_file, "<");	/* signals save to sentmail */
  	} else *copy_file = '\0';	/* signals to not save a copy */
  
  
--- 191,205 ----
  
  	/* calculate default save_file name */
  	if(auto_cc) {
! 	  if(save_by_name) {
! 	    if(force_name) {
! 	      strcpy(copy_file, "=");	/* signals save by 'to' logname */
! 	    } else {
! 	      strcpy(copy_file, "=?");	/* conditional save by 'to' logname */
! 	    }
! 	  } else {
  	    strcpy(copy_file, "<");	/* signals save to sentmail */
+ 	  }
  	} else *copy_file = '\0';	/* signals to not save a copy */
  
  

Index: src/read_rc.c
Prereq: 2.26
*** ../elm2.2/src/read_rc.c	Thu Mar 30 10:37:01 1989
--- src/read_rc.c	Fri Apr 28 14:48:30 1989
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: read_rc.c,v 2.26 89/03/29 15:47:27 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 2.26 $   $State: Exp $
   *
   * 			Copyright (c) 1986, 1987 Dave Taylor
   * 			Copyright (c) 1988, 1989 USENET Community Trust
--- 1,8 ----
  
! static char rcsid[] = "@(#)$Id: read_rc.c,v 2.27 89/04/28 14:48:27 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 2.27 $   $State: Exp $
   *
   * 			Copyright (c) 1986, 1987 Dave Taylor
   * 			Copyright (c) 1988, 1989 USENET Community Trust
***************
*** 14,19 ****
--- 14,26 ----
   *
   *******************************************************************************
   * $Log:	read_rc.c,v $
+  * Revision 2.27  89/04/28  14:48:27  syd
+  * This reinstates elm 2.1 functionality of saving a copy of an outbound
+  * message by name only if the folder preexists, while keeping the new
+  * functionality of allowing save-by-name to also occur regardless of
+  * the preexistence of the folder.
+  * From: Rob Bernardo <clib!rob>
+  * 
   * Revision 2.26  89/03/29  15:47:27  syd
   * Enable backwards compatibility with the elmrc option "alwaysleave"
   * that we obsoleted recently.
***************
*** 67,72 ****
--- 74,80 ----
  	noheader    [on|off]
  	titles      [on|off]
  	savebyname  [on|off]
+ 	forcename   [on|off]
  	movepage    [on|off]
  	pointnew    [on|off]
  	hpkeypad    [on|off]
***************
*** 407,412 ****
--- 415,424 ----
  	      save_by_name = is_it_on(word2);
  	      last = NOTWEEDOUT;
  	    }
+ 	    else if (equal(word1, "forcename")) {
+ 	      force_name = is_it_on(word2);
+ 	      last = NOTWEEDOUT;
+ 	    }
  	    else if (equal(word1, "movepage") || equal(word1, "page") ||
  		     equal(word1, "movewhenpaged")) {
  	      move_when_paged = is_it_on(word2);
***************
*** 823,830 ****
  
  	fprintf(debugfile, "title_msgs   = %s ", on_off(title_messages));
  	fprintf(debugfile, "hp_terminal    = %s ", on_off(hp_terminal));
! 	fprintf(debugfile, "hp_softkeys    = %s ", on_off(hp_softkeys));
! 	fprintf(debugfile, "save_by_name = %s\n", on_off(save_by_name));
  
  	fprintf(debugfile, "move_paged   = %s ", on_off(move_when_paged));
  	fprintf(debugfile, "point_to_new   = %s ", on_off(point_to_new));
--- 835,844 ----
  
  	fprintf(debugfile, "title_msgs   = %s ", on_off(title_messages));
  	fprintf(debugfile, "hp_terminal    = %s ", on_off(hp_terminal));
! 	fprintf(debugfile, "hp_softkeys    = %s\n", on_off(hp_softkeys));
! 
! 	fprintf(debugfile, "save_by_name = %s ", on_off(save_by_name));
! 	fprintf(debugfile, "force_name = %s\n", on_off(force_name));
  
  	fprintf(debugfile, "move_paged   = %s ", on_off(move_when_paged));
  	fprintf(debugfile, "point_to_new   = %s ", on_off(point_to_new));

Index: src/save_opts.c
Prereq: 2.17
*** ../elm2.2/src/save_opts.c	Thu Mar 30 10:37:16 1989
--- src/save_opts.c	Fri Apr 28 14:48:32 1989
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: save_opts.c,v 2.17 89/03/25 21:47:09 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 2.17 $   $State: Exp $
   *
   * 			Copyright (c) 1986, 1987 Dave Taylor
   * 			Copyright (c) 1988, 1989 USENET Community Trust
--- 1,8 ----
  
! static char rcsid[] = "@(#)$Id: save_opts.c,v 2.18 89/04/28 14:48:31 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 2.18 $   $State: Exp $
   *
   * 			Copyright (c) 1986, 1987 Dave Taylor
   * 			Copyright (c) 1988, 1989 USENET Community Trust
***************
*** 14,19 ****
--- 14,26 ----
   *
   *******************************************************************************
   * $Log:	save_opts.c,v $
+  * Revision 2.18  89/04/28  14:48:31  syd
+  * This reinstates elm 2.1 functionality of saving a copy of an outbound
+  * message by name only if the folder preexists, while keeping the new
+  * functionality of allowing save-by-name to also occur regardless of
+  * the preexistence of the folder.
+  * From: Rob Bernardo <clib!rob>
+  * 
   * Revision 2.17  89/03/25  21:47:09  syd
   * Initial 2.2 Release checkin
   * 
***************
*** 153,158 ****
--- 160,166 ----
  	save_option_number(BOUNCEBACK, bounceback, newelmrc);
  
  	save_option_on_off(COPY, auto_cc, newelmrc);
+ 	save_option_on_off(FORCENAME, force_name, newelmrc);
  	save_option_on_off(FORMS, (allow_forms != NO), newelmrc);
  	save_option_on_off(KEEPEMPTY, keep_empty_files, newelmrc);
  	save_option_on_off(KEYPAD, hp_terminal, newelmrc);

Index: src/savecopy.c
Prereq: 2.17
*** ../elm2.2/src/savecopy.c	Mon Apr 24 21:20:00 1989
--- src/savecopy.c	Fri Apr 28 14:48:34 1989
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: savecopy.c,v 2.17 89/04/24 20:47:08 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 2.17 $   $State: Exp $
   *
   * 			Copyright (c) 1986, 1987 Dave Taylor
   * 			Copyright (c) 1988, 1989 USENET Community Trust
--- 1,8 ----
  
! static char rcsid[] = "@(#)$Id: savecopy.c,v 2.18 89/04/28 14:48:32 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 2.18 $   $State: Exp $
   *
   * 			Copyright (c) 1986, 1987 Dave Taylor
   * 			Copyright (c) 1988, 1989 USENET Community Trust
***************
*** 14,19 ****
--- 14,26 ----
   *
   *******************************************************************************
   * $Log:	savecopy.c,v $
+  * Revision 2.18  89/04/28  14:48:32  syd
+  * This reinstates elm 2.1 functionality of saving a copy of an outbound
+  * message by name only if the folder preexists, while keeping the new
+  * functionality of allowing save-by-name to also occur regardless of
+  * the preexistence of the folder.
+  * From: Rob Bernardo <clib!rob>
+  * 
   * Revision 2.17  89/04/24  20:47:08  syd
   * Change includes for consistency
   * From: Jim Brown <jim at umigw.miami.edu>
***************
*** 71,77 ****
  	strcpy(savename, copy_file);
  
  	/* if save-by-name wanted */
! 	if(strcmp(copy_file, "=") == 0) {
  
  	  get_return_name(to, buffer, TRUE);	/* determine 'to' login */
  	  if (strlen(buffer) == 0) {
--- 78,84 ----
  	strcpy(savename, copy_file);
  
  	/* if save-by-name wanted */
! 	if((strcmp(copy_file, "=") == 0)  || (strcmp(copy_file, "=?") == 0)) {
  
  	  get_return_name(to, buffer, TRUE);	/* determine 'to' login */
  	  if (strlen(buffer) == 0) {
***************
*** 90,95 ****
--- 97,113 ----
  
  	expand_filename(savename, TRUE);	/* expand special chars */
  
+ 	/* If saving conditionally by logname but folder doesn't exist
+ 	 * save to sent folder instead. */
+ 	if((strcmp(copy_file, "=?") == 0)
+ 	      && (access(savename, ACCESS_EXISTS) != 0)) {
+ 	  dprint(5, (debugfile,
+ 	    "Conditional save by name: file %s doesn't exist - using \"<\".\n",
+ 	    savename));
+ 	  strcpy(savename, "<");
+ 	  expand_filename(savename, TRUE);
+ 	}
+ 
  	if ((errno = can_open(savename, "a"))) {
  	  dprint(2, (debugfile,
  	  "Error: attempt to autosave to a file that can't be appended to!\n"));
***************
*** 161,170 ****
        return("<no save>");
      else if(!fn[1]) {
        if(*fn == '=')
! 	return("<save by name>");
        else if(*fn == '<')
  	return("<\"sent\" folder>");
!     }
      return(fn);
  }
  
--- 179,190 ----
        return("<no save>");
      else if(!fn[1]) {
        if(*fn == '=')
! 	return("<unconditionally save by name>");
        else if(*fn == '<')
  	return("<\"sent\" folder>");
!     } else if ((fn[0] == '=') && (fn[1] == '?'))
!       return("<conditionally save by name>");
! 
      return(fn);
  }
  
***************
*** 217,229 ****
        /* give help and list folders */
        redraw = TRUE;
        if(!*helpmsg) 	/* help message not yet formulated */
! 	sprintf(helpmsg, "%s%s%s%s%s%s%s%s",
!           "\n\r\n\rEnter: <nothing> to not save a copy of the message,\n\r",
! 	  "       '=' to save by name",
! 	  " (depends upon whom the message is to, in the end),\n\r",
! 	  "       '<' to save in your \"sent\" folder (", sent_mail, "),\n\r",
! 	  "       or a filename",
! 	  " (leading '=' denotes your folder directory).\n\r");
        list_folders(4, helpmsg);
        PutLine0(LINES-2, 0, NCF_PROMPT);
  
--- 237,252 ----
        /* give help and list folders */
        redraw = TRUE;
        if(!*helpmsg) 	/* help message not yet formulated */
!         sprintf(helpmsg,
! 	"\n\r%s\n\r%s%s%s\n\r%s\n\r%s\n\r%s\n\r%s\n\r%s\n\r\n\r",
! 	"Enter: <nothing> to not save a copy of the message,",
! 	"       '<'       to save in your \"sent\" folder (", sent_mail, "),",
! 	"       '='       to save by name (the folder name depends on whom the",
! 	"                     message is to, in the end),",
! 	"       '=?'      to save by name if the folder already exists,",
! 	"                     and if not, to your \"sent\" folder,",
! 	"       or a filename (a leading '=' denotes your folder directory).");
! 
        list_folders(4, helpmsg);
        PutLine0(LINES-2, 0, NCF_PROMPT);
  

-- 
=====================================================================
Sydney S. Weinstein, CDP, CCP                   Elm Coordinator
Datacomp Systems, Inc.				Voice: (215) 947-9900
syd at DSI.COM or {bpa,vu-vlsi}!dsinc!syd	        FAX:   (215) 938-0235



More information about the Comp.sources.bugs mailing list