[comp.emacs] Patches for MicroEmacs 3.10

zu@ethz.UUCP (Urs Zurbuchen) (05/02/89)

[No maintenance: Impossible to fix]

The following shell script includes some diff-files to apply to
MicroEmacs V3.10. It will give you the following features:
	- on MS-DOS and on Unix, a file is automatically backed-up before
	  saving the new file. No more problems with bad saves and/or
	  bad changes.
	  On ms-dos, the backup file is named 'old-file.~old-extension'.
	  On Unix, it's '#oldfilename'.
	  At the moment, there's no support for other operating systems.
	  But it should be relatively simple to add it to the function
	  'getbackupname()' in file.c
	- filename completion for Microsoft C
	- saves and restores current directory before and after a shell
	  escape (only done for ms-dos).
	- restores 25 screen line before doing a shell escape or running
	  another program from within emacs. Restores correct screen
	  resolution after coming back to emacs.
	- save current state of ^C handler after and restore it on exit.

		Hope this helps somebody,
			...urs

PS: Unfortunately, I don't have MicroEmacs V3.10 online on my Usenet
machine. I would have to upload it via 2400 baud public phone lines. And
it's more than 400K in .arc form, the sources alone. There's no use if
you send me mail asking if I could send you a copy. Sorry.

----------  cut here  -------------  cut here  ---------------
#! /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 1 (of 1)."
# Contents:  ESTRUCT.DIF ETYPE.DIF FILE.DIF IBMPC.DIF MSDOS.DIF readme
# Wrapped by ibmpc@laphroig.UUCP on Sun Apr 30 23:13:36 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f ESTRUCT.DIF -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"ESTRUCT.DIF\"
else
echo shar: Extracting \"ESTRUCT.DIF\" \(1273 characters\)
sed "s/^X//" >ESTRUCT.DIF <<'END_OF_ESTRUCT.DIF'
X*** org/estruct.h	Sun Mar 19 11:23:56 1989
X--- estruct.h	Sat Apr 22 23:54:10 1989
X***************
X*** 133,138
X  #define	COLOR	1	/* color commands and windows			*/
X  
X  #define FILOCK	0	/* file locking under unix BSD 4.2		*/
X  #define	ISRCH	1	/* Incremental searches like ITS EMACS		*/
X  #define	WORDPRO	1	/* Advanced word processing features		*/
X  #define	FLABEL	0	/* function key label code [HP150]		*/
X
X--- 133,141 -----
X  #define	COLOR	1	/* color commands and windows			*/
X  
X  #define FILOCK	0	/* file locking under unix BSD 4.2		*/
X+ 								   /* -- ZU */
X+ #define BACKUP	1	/* retain original file as backup (MSDOS, UNIX) */
X+ 								   /* -- UZ */
X  #define	ISRCH	1	/* Incremental searches like ITS EMACS		*/
X  #define	WORDPRO	1	/* Advanced word processing features		*/
X  #define	FLABEL	0	/* function key label code [HP150]		*/
X***************
X*** 553,558
X  	char	b_bname[NBUFN]; 	/* Buffer name			*/
X  #if	CRYPT
X  	char   b_key[NPAT];	       /* current encrypted key        */
X  #endif
X  }	BUFFER;
X  
X
X--- 556,564 -----
X  	char	b_bname[NBUFN]; 	/* Buffer name			*/
X  #if	CRYPT
X  	char   b_key[NPAT];	       /* current encrypted key        */
X+ #endif
X+ #if	BACKUP							   /* -- ZU */
X+ 	short	b_bupflg;		/* true if file was backed up	*/
X  #endif
X  }	BUFFER;
X  
X
END_OF_ESTRUCT.DIF
if test 1273 -ne `wc -c <ESTRUCT.DIF`; then
    echo shar: \"ESTRUCT.DIF\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f ETYPE.DIF -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"ETYPE.DIF\"
else
echo shar: Extracting \"ETYPE.DIF\" \(888 characters\)
sed "s/^X//" >ETYPE.DIF <<'END_OF_ETYPE.DIF'
X*** org/etype.h	Tue Feb 14 10:55:44 1989
X--- etype.h	Sat Apr 22 23:10:18 1989
X***************
X*** 205,210
X  PASCAL NEAR forwsearch();
X  PASCAL NEAR forwword();
X  PASCAL NEAR freewhile();
X  PASCAL NEAR getccol();
X  PASCAL NEAR getcline();
X  PASCAL NEAR getcmd();
X
X--- 205,211 -----
X  PASCAL NEAR forwsearch();
X  PASCAL NEAR forwword();
X  PASCAL NEAR freewhile();
X+ PASCAL NEAR getbackupname();					   /* -- ZU */
X  PASCAL NEAR getccol();
X  PASCAL NEAR getcline();
X  PASCAL NEAR getcmd();
X***************
X*** 254,259
X  PASCAL NEAR lowrite();
X  PASCAL NEAR macarg();
X  PASCAL NEAR macrotokey();
X  PASCAL NEAR makelist();
X  PASCAL NEAR makelit();
X  PASCAL NEAR mcclear();
X
X--- 255,261 -----
X  PASCAL NEAR lowrite();
X  PASCAL NEAR macarg();
X  PASCAL NEAR macrotokey();
X+ PASCAL NEAR makebackup();					   /* -- ZU */
X  PASCAL NEAR makelist();
X  PASCAL NEAR makelit();
X  PASCAL NEAR mcclear();
X
END_OF_ETYPE.DIF
if test 888 -ne `wc -c <ETYPE.DIF`; then
    echo shar: \"ETYPE.DIF\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f FILE.DIF -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"FILE.DIF\"
else
echo shar: Extracting \"FILE.DIF\" \(6329 characters\)
sed "s/^X//" >FILE.DIF <<'END_OF_FILE.DIF'
X*** org/file.c	Sun Feb 12 14:50:02 1989
X--- file.c	Sun Apr 23 23:45:14 1989
X***************
X*** 231,236
X  	if ((s=bclear(bp)) != TRUE)		/* Might be old.	*/
X  		return(s);
X  	bp->b_flag &= ~(BFINVS|BFCHG);
X  	strcpy(bp->b_fname, fname);
X  
X  	/* let a user macro get hold of things...if he wants */
X
X--- 232,240 -----
X  	if ((s=bclear(bp)) != TRUE)		/* Might be old.	*/
X  		return(s);
X  	bp->b_flag &= ~(BFINVS|BFCHG);
X+ #if	BACKUP
X+ 	curbp->b_bupflg = FALSE;		/* no backup file yet	*/
X+ #endif
X  	strcpy(bp->b_fname, fname);
X  
X  	/* let a user macro get hold of things...if he wants */
X***************
X*** 427,432
X  	if ((s=writeout(fname)) == TRUE) {
X  		strcpy(curbp->b_fname, fname);
X  		curbp->b_flag &= ~BFCHG;
X  		/* Update mode lines.	*/
X  		upmode();
X  	}
X
X--- 431,439 -----
X  	if ((s=writeout(fname)) == TRUE) {
X  		strcpy(curbp->b_fname, fname);
X  		curbp->b_flag &= ~BFCHG;
X+ #if	BACKUP
X+ 		curbp->b_bupflg = TRUE;
X+ #endif
X  		/* Update mode lines.	*/
X  		upmode();
X  	}
X***************
X*** 477,482
X  
X  	if ((s=writeout(curbp->b_fname)) == TRUE) {
X  		curbp->b_flag &= ~BFCHG;
X  		/* Update mode lines.	*/
X  		upmode();
X  	}
X
X--- 484,492 -----
X  
X  	if ((s=writeout(curbp->b_fname)) == TRUE) {
X  		curbp->b_flag &= ~BFCHG;
X+ #if	BACKUP
X+ 		curbp->b_bupflg = TRUE;
X+ #endif
X  		/* Update mode lines.	*/
X  		upmode();
X  	}
X***************
X*** 487,493
X   * This function performs the details of file writing. It uses
X   * the file management routines in the "fileio.c" package. The
X   * number of lines written is displayed. Several errors are
X!  * posible, and cause writeout to return a FALSE result. When
X   * $ssave is TRUE,  the buffer is written out to a temporary
X   * file, and then the old file is unlinked and the temporary
X   * renamed to the original name.  Before the file is written,
X
X--- 497,503 -----
X   * This function performs the details of file writing. It uses
X   * the file management routines in the "fileio.c" package. The
X   * number of lines written is displayed. Several errors are
X!  * possible, and cause writeout to return a FALSE result. When
X   * $ssave is TRUE,  the buffer is written out to a temporary
X   * file, and then the old file is unlinked and the temporary
X   * renamed to the original name.  Before the file is written,
X***************
X*** 585,590
X  		if (sflag) {
X  			/* erase original file */
X  			/* rename temporary file to original name */
X  			if (unlink(fn) == 0 && rename(tname, fn) == 0)
X  				;
X  			else {
X
X--- 595,602 -----
X  		if (sflag) {
X  			/* erase original file */
X  			/* rename temporary file to original name */
X+ #if	!BACKUP
X+ 								   /* -- ZU */
X  			if (unlink(fn) == 0 && rename(tname, fn) == 0)
X  #else
X  			if (makebackup(fn) == TRUE && rename(tname, fn) == 0)
X***************
X*** 586,591
X  			/* erase original file */
X  			/* rename temporary file to original name */
X  			if (unlink(fn) == 0 && rename(tname, fn) == 0)
X  				;
X  			else {
X  				strcat(buf, TEXT150);
X
X--- 598,607 -----
X  #if	!BACKUP
X  								   /* -- ZU */
X  			if (unlink(fn) == 0 && rename(tname, fn) == 0)
X+ #else
X+ 			if (makebackup(fn) == TRUE && rename(tname, fn) == 0)
X+ 								   /* -- UZ */
X+ #endif
X  				;
X  			else {
X  				strcat(buf, TEXT150);
X***************
X*** 742,744
X  		return(FALSE);
X  	return(TRUE);
X  }
X
X--- 758,865 -----
X  		return(FALSE);
X  	return(TRUE);
X  }
X+ 
X+ 								   /* -- ZU */
X+ /* Make a backup file.
X+  * This is done by renaming the original file to a new name.
X+  * The name of the backup file is defined as follows:
X+  *
X+  * MSDOS: The base file name remains untouched, the extension has a tilde (~)
X+  *	  as its first character and the other characters moved one place
X+  *	  to the right.
X+  * UNIX:  The first character is a '#'. The rest of the name is moved one
X+  *	  place to the right. The length of the filename may not exceed 14
X+  *	  characters (for BSD the limit is 255).
X+  *
X+  * No other operating system supported by now.
X+  */
X+ #if	BACKUP
X+ 
X+ PASCAL NEAR makebackup( filename )
X+ char	*filename;
X+ {
X+ 	char	backupname[NFILEN];
X+ 
X+ #if	MSDOS | V7 | USG | HPUX | BSD | SUN | XENIX
X+ 	if( curbp->b_bupflg ) {			/* already backed up  */
X+ 		if( unlink( filename ) == 0 )
X+ 			return( TRUE );
X+ 		else
X+ 			return( FALSE );
X+ 	}
X+ 
X+ 	getbackupname( backupname, filename );
X+ 
X+ 	if( !fexist( filename ))		/* no original file - */
X+ 		return( TRUE );			/* nothing to backup  */
X+ 
X+ 	if( fexist( backupname ))
X+ 		if( unlink( backupname ))	/* file is readonly */
X+ 			return( FALSE );
X+ 
X+ 	if( rename( filename, backupname ) != 0 )
X+ 		return( FALSE );
X+ 
X+ 	return( TRUE );
X+ #else			/* for all other operating systems return fail */
X+ 	return( FALSE );
X+ #endif	/* MSDOS | V7 | USG | HPUX | BSD | SUN | XENIX */
X+ }
X+ 
X+ /* Make the name of the backup file according to the original file name
X+  * This routines knows about the filename possibilities of the different
X+  * operating systems.
X+  */
X+ PASCAL NEAR getbackupname( backup, file )
X+ char	*backup;
X+ char	*file;
X+ {
X+ 	char	temp[NFILEN];
X+ 	int	index;
X+ 	char	*dotpos;
X+ 
X+ 	strcpy( backup, file );
X+ #if	MSDOS
X+ 	for( index = strlen( backup ) -1; index >= 0 && backup[index] != '.';
X+ 								index-- )
X+ 		;
X+ 	if( index < 0 )
X+ 		strcat( backup, ".~" );
X+ 	else {
X+ 		strcpy( temp, &backup[index +1] );
X+ 		backup[index +1] = '~';	/* first char of new extension	*/
X+ 		temp[2] = '\0';		/* extension is at most 3 chars	*/
X+ 		strcpy( &backup[index +2], temp );
X+ 	}
X+ #endif	/* MSDOS */
X+ 
X+ #if	V7 | USG | HPUX | BSD | SUN | XENIX
X+ 	strcpy( temp, "#" );
X+ 	for( index = strlen( backup ) -1; index >= 0 && backup[index] != '/';
X+ 								index-- )
X+ 		;
X+ 	if( index >= 0 )
X+ 	    	strcat( temp, &backup[index +1] );
X+ 	else
X+ 		strncat( temp, backup, NFILEN -1 );
X+ #if	BSD	/* BSD allows filenames	up to 255 characters	*/
X+ #if	NFILEN < 255
X+ 	if( strlen( temp ) > NFILEN )
X+ 		temp[NFILEN] = '\0';
X+ #else
X+ 	if( strlen( temp ) > 255 )
X+ 		temp[256] = '\0';
X+ #endif
X+ #else		/* other Unixes allow only 14 characters	*/
X+ 	if( strlen( temp ) > 13 )
X+ 		temp[ 14] = '\0';
X+ #endif
X+ 	if( index >= 0 )
X+ 		strncpy( &backup[index +1], temp, NFILEN - strlen( backup ) -1 );
X+ 	else
X+ 		strncpy( backup, temp, NFILEN - strlen( backup ) -1 );
X+ #endif	/* V7 | USG | HPUX | BSD | SUN | XENIX */
X+ }
X+ 
X+ #endif	/* BACKUP */
X+ 								   /* -- UZ */
X
END_OF_FILE.DIF
if test 6329 -ne `wc -c <FILE.DIF`; then
    echo shar: \"FILE.DIF\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f IBMPC.DIF -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"IBMPC.DIF\"
else
echo shar: Extracting \"IBMPC.DIF\" \(1173 characters\)
sed "s/^X//" >IBMPC.DIF <<'END_OF_IBMPC.DIF'
X*** org/ibmpc.c	Tue Jan 17 15:13:48 1989
X--- ibmpc.c	Sun Apr 23 18:09:16 1989
X***************
X*** 298,303
X  	ttclose();
X  }
X  
X  PASCAL NEAR ibmkopen()	/* open the keyboard */
X  
X  {
X
X--- 298,305 -----
X  	ttclose();
X  }
X  
X+ static CtrlC_State;						   /* -- ZU */
X+ 
X  PASCAL NEAR ibmkopen()	/* open the keyboard */
X  
X  {
X***************
X*** 301,306
X  PASCAL NEAR ibmkopen()	/* open the keyboard */
X  
X  {
X  	rg.x.ax = 0x3301;
X  	rg.h.dl = 0x00;
X  	intdos(&rg, &rg);
X
X--- 303,311 -----
X  PASCAL NEAR ibmkopen()	/* open the keyboard */
X  
X  {
X+ 	rg.x.ax = 0x3300;					   /* -- ZU */
X+ 	intdos( &rg, &rg );					   /*     . */
X+ 	CtrlC_State = rg.h.dl;					   /* -- UZ */
X  	rg.x.ax = 0x3301;
X  	rg.h.dl = 0x00;
X  	intdos(&rg, &rg);
X***************
X*** 309,314
X  PASCAL NEAR ibmkclose() /* close the keyboard */
X  
X  {
X  }
X  
X  PASCAL NEAR scinit(type) /* initialize the screen head pointers */
X
X--- 314,322 -----
X  PASCAL NEAR ibmkclose() /* close the keyboard */
X  
X  {
X+ 	rg.x.ax = 0x3301;					   /* -- ZU */
X+ 	rg.h.dl = CtrlC_State;					   /*     . */
X+ 	intdos(&rg, &rg);					   /* -- UZ */
X  }
X  
X  PASCAL NEAR scinit(type) /* initialize the screen head pointers */
X
END_OF_IBMPC.DIF
if test 1173 -ne `wc -c <IBMPC.DIF`; then
    echo shar: \"IBMPC.DIF\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f MSDOS.DIF -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"MSDOS.DIF\"
else
echo shar: Extracting \"MSDOS.DIF\" \(9544 characters\)
sed "s/^X//" >MSDOS.DIF <<'END_OF_MSDOS.DIF'
X*** org/msdos.c	Thu Mar 09 13:37:02 1989
X--- msdos.c	Wed Apr 26 22:43:48 1989
X***************
X*** 11,16
X  #ifdef	MSDOS
X  #include        "edef.h"
X  #include	"elang.h"
X  
X  /* The Mouse driver only works with typeahead defined */
X  #if	MOUSE
X
X--- 11,17 -----
X  #ifdef	MSDOS
X  #include        "edef.h"
X  #include	"elang.h"
X+ #include	<direct.h>
X  
X  /* The Mouse driver only works with typeahead defined */
X  #if	MOUSE
X***************
X*** 26,31
X  struct ffblk fileblock;	/* structure for directory searches */
X  #endif
X  
X  #if     LATTICE | MSC | DTL | TURBO | AZTEC | MWC
X  union REGS rg;		/* cpu register for use of DOS calls */
X  struct SREGS segreg;	/* cpu segment registers	     */
X
X--- 27,38 -----
X  struct ffblk fileblock;	/* structure for directory searches */
X  #endif
X  
X+ #if  MSC
X+ #include <dos.h>
X+ 
X+ struct find_t fileblock;
X+ #endif
X+ 
X  #if     LATTICE | MSC | DTL | TURBO | AZTEC | MWC
X  union REGS rg;		/* cpu register for use of DOS calls */
X  struct SREGS segreg;	/* cpu segment registers	     */
X***************
X*** 358,363
X  PASCAL NEAR spawncli(f, n)
X  
X  {
X  	/* don't allow this command if restricted */
X  	if (restflag)
X  		return(resterr());
X
X--- 365,372 -----
X  PASCAL NEAR spawncli(f, n)
X  
X  {
X+ 	char	OldScreenResolution[NBUFN];			   /* -- ZU */
X+ 
X  	/* don't allow this command if restricted */
X  	if (restflag)
X  		return(resterr());
X***************
X*** 362,367
X  	if (restflag)
X  		return(resterr());
X  
X          movecursor(term.t_nrow, 0);             /* Seek to last line.   */
X          TTflush();
X  	TTkclose();
X
X--- 371,378 -----
X  	if (restflag)
X  		return(resterr());
X  
X+ 	strcpy( OldScreenResolution, sres );			   /* -- ZU */
X+ 
X          movecursor(term.t_nrow, 0);             /* Seek to last line.   */
X          TTflush();
X  	TTkclose();
X***************
X*** 365,370
X          movecursor(term.t_nrow, 0);             /* Seek to last line.   */
X          TTflush();
X  	TTkclose();
X  	shellprog("");
X  	TTkopen();
X          sgarbf = TRUE;
X
X--- 376,383 -----
X          movecursor(term.t_nrow, 0);             /* Seek to last line.   */
X          TTflush();
X  	TTkclose();
X+ 
X+ 	TTclose();						   /* -- ZU */
X  	shellprog("");
X  
X  	TTopen();						   /* -- ZU */
X***************
X*** 366,371
X          TTflush();
X  	TTkclose();
X  	shellprog("");
X  	TTkopen();
X          sgarbf = TRUE;
X          return(TRUE);
X
X--- 379,389 -----
X  
X  	TTclose();						   /* -- ZU */
X  	shellprog("");
X+ 
X+ 	TTopen();						   /* -- ZU */
X+ 	strcpy( sres, OldScreenResolution );			   /*     . */
X+ 	TTrez( sres );						   /* -- UZ */
X+ 
X  	TTkopen();
X          sgarbf = TRUE;
X          return(TRUE);
X***************
X*** 412,417
X  {
X          register int s;
X          char line[NLINE];
X  
X  	/* don't allow this command if restricted */
X  	if (restflag)
X
X--- 430,436 -----
X  {
X          register int s;
X          char line[NLINE];
X+ 	char OldScreenResolution[NBUFN];			   /* -- ZU */
X  
X  
X  	/* don't allow this command if restricted */
X***************
X*** 413,418
X          register int s;
X          char line[NLINE];
X  
X  	/* don't allow this command if restricted */
X  	if (restflag)
X  		return(resterr());
X
X--- 432,438 -----
X          char line[NLINE];
X  	char OldScreenResolution[NBUFN];			   /* -- ZU */
X  
X+ 
X  	/* don't allow this command if restricted */
X  	if (restflag)
X  		return(resterr());
X***************
X*** 419,424
X  
X          if ((s=mlreply("$", line, NLINE)) != TRUE)
X                  return(s);
X  	movecursor(term.t_nrow - 1, 0);
X  	TTkclose();
X          execprog(line);
X
X--- 439,447 -----
X  
X          if ((s=mlreply("$", line, NLINE)) != TRUE)
X                  return(s);
X+ 
X+ 	strcpy( OldScreenResolution, sres );			   /* -- ZU */
X+ 
X  	movecursor(term.t_nrow - 1, 0);
X  	TTkclose();
X  	TTclose();						   /* -- ZU */
X***************
X*** 421,426
X                  return(s);
X  	movecursor(term.t_nrow - 1, 0);
X  	TTkclose();
X          execprog(line);
X  	TTkopen();
X  	/* if we are interactive, pause here */
X
X--- 444,450 -----
X  
X  	movecursor(term.t_nrow - 1, 0);
X  	TTkclose();
X+ 	TTclose();						   /* -- ZU */
X          execprog(line);
X  	TTopen();						   /* -- ZU */
X  	strcpy( sres, OldScreenResolution );			   /*     . */
X***************
X*** 422,427
X  	movecursor(term.t_nrow - 1, 0);
X  	TTkclose();
X          execprog(line);
X  	TTkopen();
X  	/* if we are interactive, pause here */
X  	if (clexec == FALSE) {
X
X--- 446,454 -----
X  	TTkclose();
X  	TTclose();						   /* -- ZU */
X          execprog(line);
X+ 	TTopen();						   /* -- ZU */
X+ 	strcpy( sres, OldScreenResolution );			   /*     . */
X+ 	TTrez( sres );						   /* -- UZ */
X  	TTkopen();
X  	/* if we are interactive, pause here */
X  	if (clexec == FALSE) {
X***************
X*** 661,666
X  	char f2[38];		/* FCB2 area (not initialized */
X  	char prog[NSTRING];	/* program filespec */
X  	char tail[NSTRING];	/* command tail with length byte */
X  	union REGS regs;	/* parameters for dos call  */
X  #if	MWC == 0
X  	struct SREGS segreg;	/* segment registers for dis call */
X
X--- 688,694 -----
X  	char f2[38];		/* FCB2 area (not initialized */
X  	char prog[NSTRING];	/* program filespec */
X  	char tail[NSTRING];	/* command tail with length byte */
X+ 	char curdir[NFILEN];	/* current directory save space */
X  	union REGS regs;	/* parameters for dos call  */
X  #if	MWC == 0
X  	struct SREGS segreg;	/* segment registers for dis call */
X***************
X*** 694,699
X  		}
X  	strcpy(prog, sp);
X  
X  #if	MWC == 0
X  	/* get a pointer to this PSPs environment segment number */
X  	segread(&segreg);
X
X--- 722,729 -----
X  		}
X  	strcpy(prog, sp);
X  
X+ 	getcwd( curdir, 66 );		/* save current directory */
X+ 
X  #if	MWC == 0
X  	/* get a pointer to this PSPs environment segment number */
X  	segread(&segreg);
X***************
X*** 760,765
X  	} else
X  		rval = -_doserrno;	/* failed child call */
X  #endif
X  	return((rval < 0) ? FALSE : TRUE);
X  }
X  
X
X--- 790,797 -----
X  	} else
X  		rval = -_doserrno;	/* failed child call */
X  #endif
X+ 	chdir( curdir );		/* restore current directory */
X+ 
X  	return((rval < 0) ? FALSE : TRUE);
X  }
X  
X***************
X*** 879,885
X  	return(ALTD | c);
X  }
X  
X! #if	COMPLET & (TURBO)
X  /*	FILE Directory routines		*/
X  
X  char path[NFILEN];	/* path of file to find */
X
X--- 911,917 -----
X  	return(ALTD | c);
X  }
X  
X! #if	COMPLET & (TURBO | MSC)
X  /*	FILE Directory routines		*/
X  
X  char path[NFILEN];	/* path of file to find */
X***************
X*** 924,929
X  		strcat(fname, ".*");
X  
X  	/* and call for the first file */
X  	if (findfirst(fname, &fileblock, 0) == -1)
X  		return(NULL);
X  
X
X--- 956,962 -----
X  		strcat(fname, ".*");
X  
X  	/* and call for the first file */
X+ #if	TURBO
X  	if (findfirst(fname, &fileblock, 0) == -1)
X  		return(NULL);
X  #endif
X***************
X*** 926,931
X  	/* and call for the first file */
X  	if (findfirst(fname, &fileblock, 0) == -1)
X  		return(NULL);
X  
X  	/* return the first file name! */
X  	strcpy(rbuf, path);
X
X--- 959,969 -----
X  #if	TURBO
X  	if (findfirst(fname, &fileblock, 0) == -1)
X  		return(NULL);
X+ #endif
X+ #if	MSC
X+ 	if (_dos_findfirst(fname, _A_NORMAL, &fileblock) != 0)
X+ 		return(NULL);
X+ #endif
X  
X  
X  	/* return the first file name! */
X***************
X*** 927,932
X  	if (findfirst(fname, &fileblock, 0) == -1)
X  		return(NULL);
X  
X  	/* return the first file name! */
X  	strcpy(rbuf, path);
X  	strcat(rbuf, fileblock.ff_name);
X
X--- 965,971 -----
X  		return(NULL);
X  #endif
X  
X+ 
X  	/* return the first file name! */
X  	strcpy(rbuf, path);
X  #if	TURBO
X***************
X*** 929,934
X  
X  	/* return the first file name! */
X  	strcpy(rbuf, path);
X  	strcat(rbuf, fileblock.ff_name);
X  	mklower(rbuf);
X  	return(rbuf);
X
X--- 968,974 -----
X  
X  	/* return the first file name! */
X  	strcpy(rbuf, path);
X+ #if	TURBO
X  	strcat(rbuf, fileblock.ff_name);
X  #endif
X  #if	MSC
X***************
X*** 930,935
X  	/* return the first file name! */
X  	strcpy(rbuf, path);
X  	strcat(rbuf, fileblock.ff_name);
X  	mklower(rbuf);
X  	return(rbuf);
X  }
X
X--- 970,979 -----
X  	strcpy(rbuf, path);
X  #if	TURBO
X  	strcat(rbuf, fileblock.ff_name);
X+ #endif
X+ #if	MSC
X+ 	strcat(rbuf, fileblock.name);
X+ #endif
X  	mklower(rbuf);
X  	return(rbuf);
X  }
X***************
X*** 943,948
X  	char fname[NFILEN];		/* file/path for DOS call */
X  
X  	/* and call for the first file */
X  	if (findnext(&fileblock) == -1)
X  		return(NULL);
X  
X
X--- 987,993 -----
X  	char fname[NFILEN];		/* file/path for DOS call */
X  
X  	/* and call for the first file */
X+ #if	TURBO
X  	if (findnext(&fileblock) == -1)
X  		return(NULL);
X  #endif
X***************
X*** 945,950
X  	/* and call for the first file */
X  	if (findnext(&fileblock) == -1)
X  		return(NULL);
X  
X  	/* return the first file name! */
X  	strcpy(rbuf, path);
X
X--- 990,1000 -----
X  #if	TURBO
X  	if (findnext(&fileblock) == -1)
X  		return(NULL);
X+ #endif
X+ #if	MSC
X+ 	if (_dos_findnext(&fileblock) != 0)
X+ 		return(NULL);
X+ #endif
X  
X  	/* return the first file name! */
X  	strcpy(rbuf, path);
X***************
X*** 948,953
X  
X  	/* return the first file name! */
X  	strcpy(rbuf, path);
X  	strcat(rbuf, fileblock.ff_name);
X  	mklower(rbuf);
X  	return(rbuf);
X
X--- 998,1004 -----
X  
X  	/* return the first file name! */
X  	strcpy(rbuf, path);
X+ #if	TURBO
X  	strcat(rbuf, fileblock.ff_name);
X  #endif
X  #if	MSC
X***************
X*** 949,954
X  	/* return the first file name! */
X  	strcpy(rbuf, path);
X  	strcat(rbuf, fileblock.ff_name);
X  	mklower(rbuf);
X  	return(rbuf);
X  }
X
X--- 1000,1009 -----
X  	strcpy(rbuf, path);
X  #if	TURBO
X  	strcat(rbuf, fileblock.ff_name);
X+ #endif
X+ #if	MSC
X+ 	strcat(rbuf, fileblock.name);
X+ #endif
X  	mklower(rbuf);
X  	return(rbuf);
X  }
X
END_OF_MSDOS.DIF
if test 9544 -ne `wc -c <MSDOS.DIF`; then
    echo shar: \"MSDOS.DIF\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f readme -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"readme\"
else
echo shar: Extracting \"readme\" \(863 characters\)
sed "s/^X//" >readme <<'END_OF_readme'
XNew features:
X	- automatically create a backup file
X		UNIX:	backup file has name: #<old_file_name>
X		MSDOS:	backup file has name: <old_name>.~<old_extension>
X
X		changed files:
X			estruct.h
X			etype.h
X			file.c
X
X	- save state of Ctrl-C interrupt (break on/off)
X		changed file:
X			ibmpc.c
X
X	- filename completion routines for Microsoft C
X		changed file:
X			msdos.c
X
X	- Corrected bug when working in 43 line EGA and/or 50 line VGA mode
X	  Executing a program (including a subshell) didn't restore the
X	  25 line DOS mode before spawning. Now restores original screen
X	  resolution after Emacs again gets control.
X		changed file:
X			msdos.c
X
X	- save current directory before spawning to a subshell and restore it
X	  after Emacs again gets control. A file save after a CD in subshell
X	  saves to the correct directory. Only done for ms-dos.
X		changed file:
X			msdos.c
END_OF_readme
if test 863 -ne `wc -c <readme`; then
    echo shar: \"readme\" unpacked with wrong size!
fi
# end of overwriting check
fi
echo shar: End of archive 1 \(of 1\).
cp /dev/null ark1isdone
MISSING=""
for I in 1 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 1 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