elm 2.2 Patch #9

Syd Weinstein syd at dsinc.DSI.COM
Tue Jun 13 00:47:01 AEST 1989


Add missing quotes to the thankyou header line, minor spelling
corrections to Ref and Users guide.
From: lll-tis!ames!rutgers!cs.buffalo.edu!sigmast!dgy

Change the sleep in save to reduce time in tagging saves.  Now it will
only sleep for creating messages.  Thus, the message WILL sleep for
two seconds, on the 1st message copied to it.  This will let them know
that a new folder was used.  If the user tags say, 25 messages to move
to a new folder, it will sleep 2 seconds for the first message, and
then not sleep at all for the remaining 24.
From: Jeff Beadles <jeff%quark.wv.tek.com at RELAY.CS.NET>

If you type control-D (EOF) at the "Message: " prompt, answer went
into an infinite loop printing "Message: " on your screen.  The problem
is that on BSD systems (SunOS and Ultrix at least) an EOF on stdin
will cause all subsequent reads to return EOF (NULL for fgets).
You must call clearerr(stdin) to clear the EOF condition if you wish
to read from stdin again.
When answer receives and EOF indication it now treats it like an "exit"
command, like most Unix utilities (and mailers).  This will fix the EOF
looping problem (by exiting).
From: uunet!mitel!sce!cognos!geovision!beet!jgm (John McCarthy)

Fixed sigvec and sv_interrupt to only use sigvec when the System V
slow device interruption is available, else use signal.
From: Many, compiled by Syd

Fix makefiles to add .PRECIOUS to prevent loss of include files
From: Rob

Include the signature before editing if an external editor is going to be used.
Don't worry about the fact that we can't reliably determine which one to use.
From: zeeff at b-tech.ann-arbor.mi.us (Jon Zeeff)


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:
		sh 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 our:
	archive server.

	Syd Weinstein
	elm at DSI.COM

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

	Subject: patch list
	send index elm

Index: hdrs/patchlevel.h
Prereq: 8
*** ../elm2.2/hdrs/patchlevel.h	Wed May 24 21:15:42 1989
--- hdrs/patchlevel.h	Tue May 30 16:11:58 1989
***************
*** 1 ****
! #define PATCHLEVEL 8
--- 1 ----
! #define PATCHLEVEL 9

Index: Configure
Prereq: 2.40
*** ../elm2.2/Configure	Wed May 24 21:15:44 1989
--- Configure	Mon Jun 12 09:51:33 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.40 89/05/24 20:42:27 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.41 89/06/12 09:51:06 syd Exp $
  #
  # Yes, you may rip this off to use in other distribution packages.
  # (Note: this Configure script was generated automatically.  Rather than
***************
*** 3018,3026 ****
      $echo $n "system: [$dflt] $c"
      rp="Preferred troff/nroff program: [$dflt]"
      . myread
      if $test -f "$ans"; then
  	cont=''
- 	roff=$ans;
      else
  	roff=`loc "$ans" "" . $pth`
  	if $test -f "$roff"; then
--- 3018,3026 ----
      $echo $n "system: [$dflt] $c"
      rp="Preferred troff/nroff program: [$dflt]"
      . myread
+     roff=$ans;
      if $test -f "$ans"; then
  	cont=''
      else
  	roff=`loc "$ans" "" . $pth`
  	if $test -f "$roff"; then

Index: doc/Ref.guide
Prereq: 2.27
*** ../elm2.2/doc/Ref.guide	Wed May 24 21:15:47 1989
--- doc/Ref.guide	Wed May 31 14:48:05 1989
***************
*** 1,4 ****
! \" @(#)$Id: Ref.guide,v 2.27 89/05/24 19:12:40 syd Exp $
  \"
  \"  Reference guide to the Elm mail system.
  \"  format with 
--- 1,4 ----
! \" @(#)$Id: Ref.guide,v 2.29 89/05/31 14:47:10 syd Exp $
  \"
  \"  Reference guide to the Elm mail system.
  \"  format with 
***************
*** 12,17 ****
--- 12,27 ----
  \"  (C) Copyright 1988, 1989 Usenet Community Trust
  \"
  \"  $Log:	Ref.guide,v $
+ \" Revision 2.29  89/05/31  14:47:10  syd
+ \" Minor spelling changes
+ \" From: Dave Yearke
+ \" 
+ \" Revision 2.28  89/05/25  17:11:09  syd
+ \" Finally, the patch everyone has asked for.  The 'q' command prompts just like
+ \" the 'c' and '$' commands.  That is, the "ask" option is honored on the 'q'
+ \" command.  The 'Q' command is retained, and never prompts.
+ \" From: chip at ateng.ateng.com (Chip Salzenberg)
+ \" 
  \" Revision 2.27  89/05/24  19:12:40  syd
  \" make commands look transparent to mailer to avoid mis interpretation
  \" From: Phil Hochstetler
***************
*** 369,375 ****
  default answer be \f2Yes\f1 (i.e., alwayskeep = ON).)
  
  .lp arrow* 1.0i
! Sometimes your are forced to use a slow, or ``dumb'' terminal.  In this
  case, you can force the current message pointer to be the ``->''
  sequence rather than the inverse bar.  (Note that this is
  overridden by the similar `-a' command line option,
--- 379,385 ----
  default answer be \f2Yes\f1 (i.e., alwayskeep = ON).)
  
  .lp arrow* 1.0i
! Sometimes you are forced to use a slow, or ``dumb'' terminal.  In this
  case, you can force the current message pointer to be the ``->''
  sequence rather than the inverse bar.  (Note that this is
  overridden by the similar `-a' command line option,
***************
*** 378,389 ****
  .lp ask 1.0i
  This allows you to tell the \f2elm\f1 system that 
  you'd rather not be asked ``Delete Mail?'' and such each time you 
! 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
--- 388,398 ----
  .lp ask 1.0i
  This allows you to tell the \f2elm\f1 system that 
  you'd rather not be asked ``Delete Mail?'' and such each time you 
! quit, 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' instead of `q', you will
! never be questioned, regardless of how you have \f2ask\f1 set.)
  (The default is ON, i.e. to ask the questions.)
  
  .lp askcc 1.0i
***************
*** 1245,1256 ****
  
  .lp \h'24p'q 66p
  Quit.  If you in the pager, you are returned to the index screen. If you are
! on the index screen, \f2elm\f1 quits altogether,
! but first prompts you for the disposition of the messages in
! the current folder.  If any messages are marked for deletion,
! it will ask if you want them deleted.  If the current folder is your
! incoming mailbox, you will also be
! asked if read messages should be stored in your \f2receivedmail\f1 folder,
  and if unread messages should be kept in the incoming mailbox.
  The default answers to these questions are set by the \f2.elm/elmrc\f1
  options \f2alwaysdelete\fP, \f2alwaysstore\fP, and \f2alwayskeep\fP.
--- 1254,1265 ----
  
  .lp \h'24p'q 66p
  Quit.  If you in the pager, you are returned to the index screen. If you are
! on the index screen, \f2elm\f1 quits altogether.  However, if you have the
! option \f2ask\fP set, \f2elm\f1 first prompts you for the disposition of the
! messages in the current folder.  If any messages are marked for deletion, it
! will ask if you want them deleted.  If the current folder is your incoming
! mailbox, you will also be asked if read messages should be stored in your
! \f2receivedmail\f1 folder,
  and if unread messages should be kept in the incoming mailbox.
  The default answers to these questions are set by the \f2.elm/elmrc\f1
  options \f2alwaysdelete\fP, \f2alwaysstore\fP, and \f2alwayskeep\fP.
***************
*** 1259,1265 ****
  
  .lp \h'24p'Q 66p
  Quick quit.  This behaves similar to the `q' command except that
! you are not prompted for answers to the message disposition questions.
  \f2Elm\f1 will dispose of messages according to the values you
  have set for \f2alwaysdelete\f1, \f2alwaysstore\f1, and \f2alwayskeep\f1
  in your \f2.elm/elmrc\f1 file.
--- 1268,1274 ----
  
  .lp \h'24p'Q 66p
  Quick quit.  This behaves similar to the `q' command except that
! you are never prompted for answers to the message disposition questions.
  \f2Elm\f1 will dispose of messages according to the values you
  have set for \f2alwaysdelete\f1, \f2alwaysstore\f1, and \f2alwayskeep\f1
  in your \f2.elm/elmrc\f1 file.

Index: doc/Users.guide
Prereq: 2.16
*** ../elm2.2/doc/Users.guide	Wed May 24 21:15:48 1989
--- doc/Users.guide	Wed May 31 14:48:20 1989
***************
*** 1,4 ****
! \" @(#)$Id: Users.guide,v 2.16 89/05/24 18:43:35 syd Exp $
  \"
  \"  Users guide to the ELM mail system.
  \"  format with:
--- 1,4 ----
! \" @(#)$Id: Users.guide,v 2.19 89/05/31 14:48:05 syd Exp $
  \"
  \"  Users guide to the ELM mail system.
  \"  format with:
***************
*** 12,17 ****
--- 12,30 ----
  \"  (C) Copyright 1988, 1989 Usenet Community Trust
  \"
  \"  $Log:	Users.guide,v $
+ \" Revision 2.19  89/05/31  14:48:05  syd
+ \" Minor spelling change
+ \" From: Dave Yearke
+ \" 
+ \" Revision 2.18  89/05/30  15:59:13  syd
+ \" Add missing quotes
+ \" 
+ \" Revision 2.17  89/05/25  17:11:18  syd
+ \" Finally, the patch everyone has asked for.  The 'q' command prompts just like
+ \" the 'c' and '$' commands.  That is, the "ask" option is honored on the 'q'
+ \" command.  The 'Q' command is retained, and never prompts.
+ \" From: chip at ateng.ateng.com (Chip Salzenberg)
+ \" 
  \" Revision 2.16  89/05/24  18:43:35  syd
  \" A troff directive was missing its leading dot.
  \" From: uunet!munnari!itd.dsto.oz.au!ksh (Ken Hayman 6340)
***************
*** 491,497 ****
  .lp \h'18p'p 90p
  Print current message or tagged messages.
  .lp \h'18p'q 90p
! Quit \(em prompting for messages to delete, store, or keep.
  .lp \h'18p'Q 90p
  Quick quit \(em like quit but without prompting.
  .lp "\h'18p'<control>-Q, DEL" 90p
--- 504,510 ----
  .lp \h'18p'p 90p
  Print current message or tagged messages.
  .lp \h'18p'q 90p
! Quit \(em maybe prompting for messages to delete, store, or keep.
  .lp \h'18p'Q 90p
  Quick quit \(em like quit but without prompting.
  .lp "\h'18p'<control>-Q, DEL" 90p
***************
*** 745,751 ****
  system, namely to `send only' and to send files (batchmail).
  
  To send a message to someone without any of the associated 
! overhead of reading in a mail folder. you can invoke the
  mailer with the name(s) of the people to send to.  For example:
  .nf
    $ \f3elm dave_taylor\f1
--- 758,764 ----
  system, namely to `send only' and to send files (batchmail).
  
  To send a message to someone without any of the associated 
! overhead of reading in a mail folder, you can invoke the
  mailer with the name(s) of the people to send to.  For example:
  .nf
    $ \f3elm dave_taylor\f1
***************
*** 999,1005 ****
  .br
  .ne 5
  .sp
! .hn 1 Credits and So on Part II - The Usenet Elm Development Group
  
  As coordinator of the Elm Development Group, I must add to the credits.
  This group of volunteers has taken the Elm code from Dave Taylor and
--- 1012,1018 ----
  .br
  .ne 5
  .sp
! .hn 1 "Credits and So on Part II - The Usenet Elm Development Group"
  
  As coordinator of the Elm Development Group, I must add to the credits.
  This group of volunteers has taken the Elm code from Dave Taylor and

Index: doc/elm-help.0
*** ../elm2.2/doc/elm-help.0	Thu Mar 30 10:27:34 1989
--- doc/elm-help.0	Thu May 25 17:11:27 1989
***************
*** 39,45 ****
                                          then increment
             o                    Change ELM options
             p                    Print current message or tagged messages
!            q                    Quit with prompting for deleting, storing,
                                          and keeping messages
             Q                    Quick quit - no prompting
             r                    Reply to current message
--- 39,45 ----
                                          then increment
             o                    Change ELM options
             p                    Print current message or tagged messages
!            q                    Quit, maybe prompting for deleting, storing,
                                          and keeping messages
             Q                    Quick quit - no prompting
             r                    Reply to current message

Index: filter/Makefile.SH
Prereq: 2.11
*** ../elm2.2/filter/Makefile.SH	Thu Mar 30 10:33:53 1989
--- filter/Makefile.SH	Fri Jun  2 16:19:26 1989
***************
*** 16,22 ****
  echo "Extracting filter/Makefile (with variable substitutions)"
  cat >Makefile <<!GROK!THIS!
  #
! # @(#)$Id: Makefile.SH,v 2.11 89/03/25 21:45:09 syd Exp $
  #  Makefile for the Elm system filter program
  #
  #	Copyright (c) 1986, 1987 Dave Taylor
--- 16,22 ----
  echo "Extracting filter/Makefile (with variable substitutions)"
  cat >Makefile <<!GROK!THIS!
  #
! # @(#)$Id: Makefile.SH,v 2.12 89/06/02 16:19:05 syd Exp $
  #  Makefile for the Elm system filter program
  #
  #	Copyright (c) 1986, 1987 Dave Taylor
***************
*** 28,33 ****
--- 28,37 ----
  #			dsinc!elm
  #
  #  $Log:	Makefile.SH,v $
+ # Revision 2.12  89/06/02  16:19:05  syd
+ # Add .PRECIOUS to prevent loss of include files on interrupt
+ # From: Rob
+ # 
  # Revision 2.11  89/03/25  21:45:09  syd
  # Initial 2.2 Release checkin
  # 
***************
*** 125,130 ****
--- 129,136 ----
  
  # Dependencies and rules
  #	Dependencies of header files upon other header files they include
+ .PRECIOUS:		$(INCLDIR)/defs.h $(INCLDIR)/elm.h $(INCLDIR)/headers.h
+ 
  $(INCLDIR)/defs.h:	$(INCLDIR)/../config.h $(INCLDIR)/sysdefs.h
  			$(CHMOD) u+w $@
  			$(TOUCH) $@

Index: src/Makefile.SH
Prereq: 2.16
*** ../elm2.2/src/Makefile.SH	Mon Apr 24 20:04:00 1989
--- src/Makefile.SH	Fri Jun  2 16:19:29 1989
***************
*** 15,21 ****
  
  echo "Extracting src/Makefile (with variable substitutions)"
  cat >Makefile <<!GROK!THIS!
! # $Id: Makefile.SH,v 2.16 89/04/24 18:46:32 syd Exp $
  #
  #  Makefile for the ELM mail program.
  #
--- 15,21 ----
  
  echo "Extracting src/Makefile (with variable substitutions)"
  cat >Makefile <<!GROK!THIS!
! # $Id: Makefile.SH,v 2.17 89/06/02 16:19:26 syd Exp $
  #
  #  Makefile for the ELM mail program.
  #
***************
*** 28,33 ****
--- 28,37 ----
  #			dsinc!elm
  #
  # $Log:	Makefile.SH,v $
+ # Revision 2.17  89/06/02  16:19:26  syd
+ # Add .PRECIOUS to prevent loss of include files on interrupt
+ # From: Rob
+ # 
  # Revision 2.16  89/04/24  18:46:32  syd
  # When checking to see if an address is in a list of addresses: (1) ignore
  # case, and (2) make sure the comparison is not just a random inclusion
***************
*** 232,237 ****
--- 236,243 ----
  
  # Dependencies and rules
  #	Dependencies of header files upon other header files they include
+ .PRECIOUS:		$(INCLDIR)/defs.h $(INCLDIR)/elm.h $(INCLDIR)/headers.h
+ 
  $(INCLDIR)/defs.h:	$(INCLDIR)/../config.h $(INCLDIR)/sysdefs.h
  			$(CHMOD) u+w $@
  			$(TOUCH) $@

Index: src/file.c
Prereq: 2.21
*** ../elm2.2/src/file.c	Wed Apr 26 16:44:44 1989
--- src/file.c	Tue May 30 16:04:14 1989
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: file.c,v 2.21 89/04/26 16:43:56 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 ----
  
! static char rcsid[] = "@(#)$Id: file.c,v 2.22 89/05/30 16:03:09 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,24 ----
   *
   *******************************************************************************
   * $Log:	file.c,v $
+  * Revision 2.22  89/05/30  16:03:09  syd
+  * remove sleep on appended to file save messages to try and reduce
+  * tagged save time
+  * From: Jeff Beadles
+  * 
   * Revision 2.21  89/04/26  16:43:56  syd
   * This enables elm to properly expand ~/[path] and ~logname/[path];
   * formerly "~" and "~/" were both expanded as the current user's home
***************
*** 254,260 ****
  	if (! silently)
  	  show_new_status(number);	/* update screen, if needed */
  
! 	if (pause && ! silently) sleep(2);
  }
  
  int
--- 259,266 ----
  	if (! silently)
  	  show_new_status(number);	/* update screen, if needed */
  
! 	if (pause && (!silently) && (!appending))
! 	  sleep(2);
  }
  
  int

Index: src/init.c
Prereq: 2.29
*** ../elm2.2/src/init.c	Wed May 24 21:15:51 1989
--- src/init.c	Wed May 31 14:15:34 1989
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: init.c,v 2.29 89/05/24 18:57:32 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 2.29 $   $State: Exp $
   *
   * 			Copyright (c) 1986, 1987 Dave Taylor
   * 			Copyright (c) 1988, 1989 USENET Community Trust
--- 1,8 ----
  
! static char rcsid[] = "@(#)$Id: init.c,v 2.30 89/05/31 14:14:50 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 2.30 $   $State: Exp $
   *
   * 			Copyright (c) 1986, 1987 Dave Taylor
   * 			Copyright (c) 1988, 1989 USENET Community Trust
***************
*** 14,19 ****
--- 14,24 ----
   *
   *******************************************************************************
   * $Log:	init.c,v $
+  * Revision 2.30  89/05/31  14:14:50  syd
+  * Fix sigvec usage to only be used where SV_INTERRUPT and SIGVEC are defined
+  * signal is better unless the sigvec provides interrupt capability as in SV.
+  * From: Many people, compiled by Syd
+  * 
   * Revision 2.29  89/05/24  18:57:32  syd
   * Add SIGVEC symbol as some systems use sigvec in kernel but not for user
   * tasks.
***************
*** 113,119 ****
  #endif
  #endif
  
! #ifdef SIGVEC
  	struct sigvec alarm_vec;
  #endif
  	char     buffer[SLEN], *cp;
--- 118,124 ----
  #endif
  #endif
  
! #if defined(SIGVEC) & defined(SV_INTERRUPT)
  	struct sigvec alarm_vec;
  #endif
  	char     buffer[SLEN], *cp;
***************
*** 216,222 ****
    "\n*** Elm-Internal Signal Handlers Disabled due to debug level %d ***\n\n",
  		    debug));
  	}
! #ifdef SIGVEC
  	alarm_vec.sv_handler = alarm_signal;
  	alarm_vec.sv_flags = SV_INTERRUPT;
  	sigvec (SIGALRM, &alarm_vec, (struct sigvec *)0);	/* Process Timer Alarm	    */
--- 221,227 ----
    "\n*** Elm-Internal Signal Handlers Disabled due to debug level %d ***\n\n",
  		    debug));
  	}
! #if defined(SIGVEC) & defined(SV_INTERRUPT)
  	alarm_vec.sv_handler = alarm_signal;
  	alarm_vec.sv_flags = SV_INTERRUPT;
  	sigvec (SIGALRM, &alarm_vec, (struct sigvec *)0);	/* Process Timer Alarm	    */

Index: src/leavembox.c
Prereq: 2.26
*** ../elm2.2/src/leavembox.c	Thu Mar 30 11:10:43 1989
--- src/leavembox.c	Thu May 25 17:11:08 1989
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: leavembox.c,v 2.26 89/03/25 21:46:33 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: leavembox.c,v 2.27 89/05/25 17:11:05 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,25 ----
   *
   *******************************************************************************
   * $Log:	leavembox.c,v $
+  * Revision 2.27  89/05/25  17:11:05  syd
+  * Finally, the patch everyone has asked for.  The 'q' command prompts just like
+  * the 'c' and '$' commands.  That is, the "ask" option is honored on the 'q'
+  * command.  The 'Q' command is retained, and never prompts.
+  * From: chip at ateng.ateng.com (Chip Salzenberg)
+  * 
   * Revision 2.26  89/03/25  21:46:33  syd
   * Initial 2.2 Release checkin
   * 
***************
*** 73,86 ****
  		Also we don't remove NEW status so that it can be preserved
  		across the resync.
  
! 	    If "quitting" prompting for user input is based on truth of
! 	    	"prompt". Otherwise prompting is dependent upon the variable
! 		question_me, as set by an elmrc option.
! 		This is because when called as part of quitting, the user
! 		selects run-time between the 'q' and 'Q' commands to tell
! 		elm whether s/he wants to be prompted or not. This would
! 		render use of the elmrc option moot (i.e. overridden).
! 		Prompted quit vs quick quit.
  	**/
  
  	FILE *temp;
--- 79,90 ----
  		Also we don't remove NEW status so that it can be preserved
  		across the resync.
  
! 	    If "quitting" and "prompt" is false, then no prompting is done.
! 		Otherwise prompting is dependent upon the variable
! 		question_me, as set by an elmrc option.  This behavior makes
! 		the 'q' command prompt just like 'c' and '$', while
! 		retaining the 'Q' command for a quick exit that never
! 		prompts.
  	**/
  
  	FILE *temp;
***************
*** 103,109 ****
  	if (message_count == 0)
  	  return(0);	/* nothing changed */
  
! 	ask_questions = (quitting ? prompt : question_me);
  
  	/* YES or NO on softkeys */
  	if (hp_softkeys && ask_questions) {
--- 107,113 ----
  	if (message_count == 0)
  	  return(0);	/* nothing changed */
  
! 	ask_questions = ((quitting && !prompt) ? FALSE : question_me);
  
  	/* YES or NO on softkeys */
  	if (hp_softkeys && ask_questions) {

Index: src/mailmsg2.c
Prereq: 2.33
*** ../elm2.2/src/mailmsg2.c	Wed May 24 21:15:52 1989
--- src/mailmsg2.c	Mon Jun 12 09:49:28 1989
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 2.33 89/05/24 19:01:19 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 2.33 $   $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.34 89/06/12 09:49:25 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 2.34 $   $State: Exp $
   *
   * 			Copyright (c) 1986, 1987 Dave Taylor
   * 			Copyright (c) 1988, 1989 USENET Community Trust
***************
*** 14,19 ****
--- 14,24 ----
   *
   *******************************************************************************
   * $Log:	mailmsg2.c,v $
+  * Revision 2.34  89/06/12  09:49:25  syd
+  * Include the signature before editing if an external editor is going to be used.
+  * Don't worry about the fact that we can't reliably determine which one to use.
+  * From: zeeff at b-tech.ann-arbor.mi.us (Jon Zeeff)
+  * 
   * Revision 2.33  89/05/24  19:01:19  syd
   * Fixes the signature code to work for fully qualified local addresses.  Also
   * fixes the problem that signatures can't really be determined until after the
***************
*** 107,112 ****
--- 112,118 ----
  	int ch;
  	register int retransmit = FALSE; 
  	int      already_has_text = FALSE;		/* we need an ADDRESS */
+ 	int	 signature_done = FALSE;
  	int	 need_redraw = 0;
  
  	static int cancelled_msg = 0;
***************
*** 172,177 ****
--- 178,193 ----
  	  else
  	    copy_message("", reply, noheader, FALSE, FALSE);
  
+         /* append signature now if we are going to use an external editor */
+ 	/* Don't worry about the remote/local determination too much */
+ 
+         if (already_has_text || 
+            (strcmp(editor,"builtin") != 0 && strcmp(editor,"none") != 0)) {
+ 	     signature_done = TRUE;
+              if (!retransmit && copy_msg != FORM) 
+ 	       already_has_text |= append_sig(reply);
+ 	}
+ 
  	if (! retransmit && copy_msg != FORM)
  	  if (reply != NULL)
  	    (void) fclose(reply);	/* on replies, it won't be open! */
***************
*** 312,367 ****
  
  	  copy_message_across(reply, real_reply, FALSE);
  
!           /* Append signature */
  
! 	  if (!batch_only && !retransmit && copy_msg != FORM
!               && (local_signature[0] || remote_signature[0])) {
  
-             char filename2[SLEN];
- 	    char *sig;
- 
-   	    if (strchr(expanded_to, '!') || strchr(expanded_cc,'!'))
-               sig = remote_signature;		/* ! always means remote */
-             else {
- 	      /* check each @ for @thissite.domain */
- 	      /* if any one is different than this, then use remote sig */
- 	      int len;
- 	      char *ptr;
- 	      char sitename[SLEN];
- 	      sprintf(sitename,"@%s%s",hostname,hostdomain);
- 	      len = strlen(sitename);
-               sig = local_signature;
-               for (ptr = strchr(expanded_to,'@'); ptr;  /* check To: list */
- 	          ptr = strchr(ptr+1,'@')) {
- 		if (strncmp(ptr,sitename,len) != 0
- 		    || (*(ptr+len) != ',' && *(ptr+len) != 0
- 		    && *(ptr+len) != ' ')) {
- 	          sig = remote_signature;
-                   break;
-                 }
-               }
-               if (sig == local_signature)		   /* still local? */ 
-                 for (ptr = strchr(expanded_cc,'@'); ptr;   /* check Cc: */
- 		    ptr = strchr(ptr+1,'@')) {
- 		  if (strncmp(ptr,sitename,len) != 0
- 		      || (*(ptr+len) != ',' && *(ptr+len) != 0 
- 		      && *(ptr+len) != ' ')) {
- 	            sig = remote_signature;
-                     break;
-                   }
-                 }
-             }
- 
-             if (sig[0]) {  /* if there is a signature file */
- 	      fprintf(real_reply, "\n-- \n");  /* News 2.11 compatibility? */
- 	      if (sig[0] != '/')
- 	        sprintf(filename2, "%s/%s", home, sig);
- 	      else
- 	        strcpy(filename2, sig);
- 	      (void) append(real_reply, filename2);
-             }
-           }
- 
  	  fclose(real_reply);
  
  	  if (cc[0] != '\0')  				         /* copies! */
--- 328,338 ----
  
  	  copy_message_across(reply, real_reply, FALSE);
  
!           /* Append signature if not done earlier */
  
!           if (!signature_done && !retransmit && copy_msg != FORM)
!                append_sig(real_reply);
  
  	  fclose(real_reply);
  
  	  if (cc[0] != '\0')  				         /* copies! */
***************
*** 829,832 ****
--- 800,875 ----
  	fflush(stdout);
  
  	return(TRUE);
+ }
+ 
+ 
+ int
+ append_sig(file)
+ FILE *file;
+ {
+ 	/* Append the correct signature file to file.  Return TRUE if
+            we append anything.  */
+ 
+         /* Look at the to and cc list to determine which one to use */
+ 
+ 	/* We could check the bcc list too, but we don't want people to
+            know about bcc, even indirectly */
+ 
+ 	/* Some people claim that  user at anything.same_domain should be 
+ 	   considered local.  Since it's not the same machine, better be 
+            safe and use the remote sig (presumably it has more complete
+            information).  You can't necessarily finger someone in the
+            same domain. */
+ 
+ 	  if (!batch_only && (local_signature[0] || remote_signature[0])) {
+ 
+             char filename2[SLEN];
+ 	    char *sig;
+ 
+   	    if (strchr(expanded_to, '!') || strchr(expanded_cc,'!'))
+               sig = remote_signature;		/* ! always means remote */
+             else {
+ 	      /* check each @ for @thissite.domain */
+ 	      /* if any one is different than this, then use remote sig */
+ 	      int len;
+ 	      char *ptr;
+ 	      char sitename[SLEN];
+ 	      sprintf(sitename,"@%s%s",hostname,hostdomain);
+ 	      len = strlen(sitename);
+               sig = local_signature;
+               for (ptr = strchr(expanded_to,'@'); ptr;  /* check To: list */
+ 	          ptr = strchr(ptr+1,'@')) {
+ 		if (strncmp(ptr,sitename,len) != 0
+ 		    || (*(ptr+len) != ',' && *(ptr+len) != 0
+ 		    && *(ptr+len) != ' ')) {
+ 	          sig = remote_signature;
+                   break;
+                 }
+               }
+               if (sig == local_signature)		   /* still local? */ 
+                 for (ptr = strchr(expanded_cc,'@'); ptr;   /* check Cc: */
+ 		    ptr = strchr(ptr+1,'@')) {
+ 		  if (strncmp(ptr,sitename,len) != 0
+ 		      || (*(ptr+len) != ',' && *(ptr+len) != 0 
+ 		      && *(ptr+len) != ' ')) {
+ 	            sig = remote_signature;
+                     break;
+                   }
+                 }
+             }
+ 
+             if (sig[0]) {  /* if there is a signature file */
+ 	      fprintf(file, "\n-- \n");  /* News 2.11 compatibility? */
+ 	      if (sig[0] != '/')
+ 	        sprintf(filename2, "%s/%s", home, sig);
+ 	      else
+ 	        strcpy(filename2, sig);
+ 	      (void) append(file, filename2);
+ 
+               return TRUE;
+             }
+           }
+ 
+ return FALSE;
+ 
  }

Index: utils/Makefile.SH
Prereq: 2.20
*** ../elm2.2/utils/Makefile.SH	Wed May 24 21:15:54 1989
--- utils/Makefile.SH	Fri Jun  2 16:19:31 1989
***************
*** 16,22 ****
  echo "Extracting utils/Makefile (with variable substitutions)"
  cat >Makefile <<!GROK!THIS!
  
! # @(#)$Id: Makefile.SH,v 2.20 89/05/24 19:35:48 syd Exp $
  #
  #  Makefile for the Elm system utilities
  #
--- 16,22 ----
  echo "Extracting utils/Makefile (with variable substitutions)"
  cat >Makefile <<!GROK!THIS!
  
! # @(#)$Id: Makefile.SH,v 2.21 89/06/02 16:19:29 syd Exp $
  #
  #  Makefile for the Elm system utilities
  #
***************
*** 29,34 ****
--- 29,38 ----
  #			dsinc!elm
  #
  # $Log:	Makefile.SH,v $
+ # Revision 2.21  89/06/02  16:19:29  syd
+ # Add .PRECIOUS to prevent loss of include files on interrupt
+ # From: Rob
+ # 
  # Revision 2.20  89/05/24  19:35:48  syd
  # Fix some of the remote install files
  # From: David Newall
***************
*** 229,234 ****
--- 233,240 ----
  
  # Dependencies and rules
  #	Dependencies and rules for compiling and linting C programs
+ .PRECIOUS:		$(INCLDIR)/defs.h $(INCLDIR)/elm.h $(INCLDIR)/headers.h
+ 
  $(BIN)/answer:		$(ANSWER_OBJ)
  			$(CC) $(LFLAGS) -o $@ $(ANSWER_OBJ) $(LIB2)
  

Index: utils/answer.c
Prereq: 2.5
*** ../elm2.2/utils/answer.c	Thu Mar 30 10:37:59 1989
--- utils/answer.c	Tue May 30 16:10:11 1989
***************
*** 1,8 ****
  
! static char rcsid[] = "@(#)$Id: answer.c,v 2.5 89/03/25 21:47:38 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 2.5 $   $State: Exp $
   *
   * 			Copyright (c) 1986, 1987 Dave Taylor
   * 			Copyright (c) 1988, 1989 USENET Community Trust
--- 1,8 ----
  
! static char rcsid[] = "@(#)$Id: answer.c,v 2.6 89/05/30 16:09:54 syd Exp $";
  
  /*******************************************************************************
!  *  The Elm Mail System  -  $Revision: 2.6 $   $State: Exp $
   *
   * 			Copyright (c) 1986, 1987 Dave Taylor
   * 			Copyright (c) 1988, 1989 USENET Community Trust
***************
*** 14,19 ****
--- 14,23 ----
   *
   *******************************************************************************
   * $Log:	answer.c,v $
+  * Revision 2.6  89/05/30  16:09:54  syd
+  * Fix message prompt looping on EOF
+  * From: John McCarthy
+  * 
   * Revision 2.5  89/03/25  21:47:38  syd
   * Initial 2.2 Release checkin
   * 
***************
*** 62,72 ****
  	  printf("\n-------------------------------------------------------------------------------\n");
  
  prompt:   printf("\nMessage to: ");
! 	  if (fgets(user_name, SLEN, stdin) == NULL || user_name[0] == '\0')
  	    goto prompt;
  	  
  	  cp = &user_name[strlen(user_name)-1];
  	  if(*cp == '\n') *cp = '\0';
  
  	  if ((strcmp(user_name,"quit") == 0) ||
  	      (strcmp(user_name,"exit") == 0) ||
--- 66,82 ----
  	  printf("\n-------------------------------------------------------------------------------\n");
  
  prompt:   printf("\nMessage to: ");
! 	  if (fgets(user_name, SLEN, stdin) == NULL) {
! 		putchar('\n');
! 		exit(0);
! 	  }
! 	  if(user_name[0] == '\0')
  	    goto prompt;
  	  
  	  cp = &user_name[strlen(user_name)-1];
  	  if(*cp == '\n') *cp = '\0';
+ 	  if(user_name[0] == '\0')
+ 		goto prompt;
  
  	  if ((strcmp(user_name,"quit") == 0) ||
  	      (strcmp(user_name,"exit") == 0) ||


-- 
=====================================================================
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