[comp.mail.elm] EPS' Unofficial Patches, updated

epsilon@wet.UUCP (Eric P. Scott) (12/25/90)

The following context diffs to ELM 2.3PL10

	. Change default sort order for compatibility with other
	  MUAs (optional)
	. Fix ~v to properly invoke vi when elm is configured to
	  use "builtin" or "none" as the default editor
	. Even if already_has_text is true, if the alternate_editor
	  is "builtin" or "none" don't try to shell to it
	. Avoid creating extraneous process from ~! shell escape

*This does not include fixes to Configure for NeXT workstations.
For "Any additional cc flags?" specify -bsd
For "Any additional libraries?" specify -lsys_s
At "If you need to edit config.sh, do it as a shell escape here:"
Change d_voidsig from 'define' to 'undef'
Change passcat from 'cat /etc/passwd' to 'nidump passwd /'
  if you're not using YP/NIS, and don't have more than two levels
  of NetInfo hierarchy.  (Consult a NeXTpert otherwise!)

					-=EPS=-
-------
*** hdrs/elm.h.orig
--- hdrs/elm.h
***************
*** 142,148 ****
  int prompt_for_cc = 1;		/* flag: ask user for "cc:" value?  */
  int sig_dashes = 1;		/* flag: include dashes above sigs? */
  
! int sortby = REVERSE SENT_DATE;	/* how to sort incoming mail...     */
  
  long timeout = 600L;		/* timeout (secs) on main prompt    */
  
--- 142,148 ----
  int prompt_for_cc = 1;		/* flag: ask user for "cc:" value?  */
  int sig_dashes = 1;		/* flag: include dashes above sigs? */
  
! int sortby = MAILBOX_ORDER;	/* how to sort incoming mail...     */
  
  long timeout = 600L;		/* timeout (secs) on main prompt    */
  
*** hdrs/sysdefs.SH.orig
--- hdrs/sysdefs.SH
***************
*** 100,105 ****
--- 100,106 ----
  #define readmsg_file	".elm/readmsg"
  
  #define emacs_editor	"$emacs"
+ #define vi_editor	"$vi"
  
  #define default_editor	"$defeditor"
  #define mailhome	"$maildir/"
*** src/editmsg.c.orig
--- src/editmsg.c
***************
*** 72,78 ****
  	buffer[0] = '\0';
  
  	if (strcmp(editor, "builtin") == 0 || strcmp(editor, "none") == 0) {
! 	  if (already_has_text) 
  	    sprintf(buffer, "%s %s", alternative_editor, filename);
  	  else
  	    return(no_editor_edit_the_message(filename));
--- 72,79 ----
  	buffer[0] = '\0';
  
  	if (strcmp(editor, "builtin") == 0 || strcmp(editor, "none") == 0) {
! 	  if (already_has_text && strcmp(alternative_editor, "builtin") &&
! 	    strcmp(alternative_editor, "none")) 
  	    sprintf(buffer, "%s %s", alternative_editor, filename);
  	  else
  	    return(no_editor_edit_the_message(filename));
***************
*** 249,255 ****
  
  	       case 'v' : NewLine();
  			  strcpy(buffer, editor);
! 			  strcpy(editor, default_editor);
  			  fclose(edit_fd);
  			  (void) edit_the_message(filename,0);
  			  strcpy(editor, buffer);
--- 250,256 ----
  
  	       case 'v' : NewLine();
  			  strcpy(buffer, editor);
! 			  strcpy(editor, vi_editor);
  			  fclose(edit_fd);
  			  (void) edit_the_message(filename,0);
  			  strcpy(editor, buffer);
***************
*** 299,305 ****
  			   if (( old_raw = RawState()) == ON)
  			     Raw(OFF);
  			   if (strlen(buffer) < 3) 
! 			     (void) system_call(shell, USER_SHELL, TRUE, TRUE);
  			   else
  	                     (void) system_call((char *) buffer+2, USER_SHELL, TRUE, TRUE);
  			   if (old_raw == ON)
--- 300,306 ----
  			   if (( old_raw = RawState()) == ON)
  			     Raw(OFF);
  			   if (strlen(buffer) < 3) 
! 			     (void) system_call((char *)NULL, USER_SHELL, TRUE, TRUE);
  			   else
  	                     (void) system_call((char *) buffer+2, USER_SHELL, TRUE, TRUE);
  			   if (old_raw == ON)
*** src/syscall.c.orig
--- src/syscall.c
***************
*** 218,224 ****
  #endif
  
  	  /* Go for it. */
! 	  execl(sh, argv_zero(sh), "-c", string, (char *) 0);
  
  	  /* If exec fails, we write a byte to the pipe before exiting. */
  	  perror(sh);
--- 218,225 ----
  #endif
  
  	  /* Go for it. */
! 	  if (string) execl(sh, argv_zero(sh), "-c", string, (char *) 0);
! 	  else execl(sh, argv_zero(sh), (char *) 0);
  
  	  /* If exec fails, we write a byte to the pipe before exiting. */
  	  perror(sh);