10-Nov-87 09:08:35-MST,3760;000000000001 Mail-From: BEEBE created at 10-Nov-87 09:08:34 Return-Path: Received: from cs.utah.edu by SCIENCE.UTAH.EDU with TCP; Sun 8 Nov 87 12:38:54-MST Received: by cs.utah.edu (5.54/utah-2.0-cs) id AA07284; Sun, 8 Nov 87 12:38:12 MST From: news@cs.utah.edu (Netnews Owner) Reply-To: toylnd!dca@cs.utah.edu (David C. Albrecht) To: comp-emacs@cs.utah.edu Subject: Mod to micro emacs 3.8i Message-Id: <180@toylnd.UUCP> Date: 31 Oct 87 08:49:43 GMT Organization: Dave & Anne in Charlottesville, VA ReSent-Date: Tue 10 Nov 87 09:08:34-MST ReSent-From: "Nelson H.F. Beebe" ReSent-To: debar@SCIENCE.UTAH.EDU, beebe@SCIENCE.UTAH.EDU ReSent-Message-ID: <12349518018.16.BEEBE@SCIENCE.UTAH.EDU> I use micro emacs v3.8 regularly on a uVAXEN, a AT&T 3b1, and an Amiga. One of the things I noticed was that while it is regularly quite speedy, that splitting a window onto a single buffer really makes it bog down. A little poking around and I realised why. Basically when the same buffer appears on more than one window it causes a total redisplay on any alterations even when they effect only one line and even if that line doesn't appear in the window. Ack. I tend to split windows on one buffer alot. Therefore using my 5 minute study of micro emacs I proceeded to make this hack. Seems to be pretty clean code, hate to muck it up, hate the slow insertion worse. I would appreciate if more guru'esq types would respond if said hack will cause any problems. It does, however, speed windows split onto a single file up to the point where if the line you are altering doesn't appear in the split window there is no visible degradation and even if it does it is still faster than the old method. Basically me3.8 uses a routine called lchange to set the flags in the window buffer when a buffer is altered. lchange can be found in line.c. previously it said: if (curbp->b_nwnd != 1) /* Ensure hard. */ flag = WFHARD; i.e. always cause redisplay on multiply referenced buffers. WFEDIT seems to be alterations occuring only on one line so I changed this to. if (curbp->b_nwnd != 1 && flag != WFEDIT) /* Ensure hard. */ flag = WFHARD; Ok. Now the routine 'update' refreshes the screen this can be found in display.c. In update, there is a line which tests the flag for updating one line and if it is set updates it. if ((wp->w_flag & ~WFMODE) == WFEDIT) updone(wp); /* update EDITed line */ Basically, updone searches the window for the line at wp->w_dotp so that it can find it in the virtual screen. Only the current window, however, has the alteration just made at w_dotp. Therefore I added the w_dotp parameter to updone instead of having it extract it from wp and supplied the w_dotp for the current window. Thusly: if ((wp->w_flag & ~WFMODE) == WFEDIT) updone(wp, curwp->w_dotp); /* update EDITed line */ Of course I altered updone to read: updone(wp, upd) WINDOW *wp; /* window to update current line in */ register LINE *upd; /* line to update */ And the search part which read: /* search down the line we want */ lp = wp->w_linep; sline = wp->w_toprow; while (lp != wp->w_dotp) { ++sline; lp = lforw(lp); } I altered to exit if the line doesn't appear on the screen and to use my new upd parameter. /* search down the line we want */ lp = wp->w_linep; sline = wp->w_toprow; i = wp->w_ntrows; while (i-- && lp != upd) { ++sline; lp = lforw(lp); } if (i < 0) return; /* line doesn't appear on screen */ I tried to get it to break and haven't suceeded yet. David Albrecht 10-Nov-87 09:13:01-MST,2812;000000000000 Mail-From: BEEBE created at 10-Nov-87 09:13:00 Return-Path: Received: from cs.utah.edu by SCIENCE.UTAH.EDU with TCP; Tue 10 Nov 87 08:36:26-MST Received: by cs.utah.edu (5.54/utah-2.0-cs) id AA05481; Tue, 10 Nov 87 08:35:45 MST From: news@cs.utah.edu (Netnews Owner) Reply-To: steinmetz.steinmetz!davidsen@cs.utah.edu (William E. Davidsen Jr) To: comp-emacs@cs.utah.edu Subject: Fixes and enhancements to MicroEMACS 3.9e Message-Id: <7804@steinmetz.steinmetz.UUCP> Date: 9 Nov 87 21:53:40 GMT Organization: GE Corp. R & D, Schenectady,NY Keywords: memacs, fix Cc: ndw@j.cc.purdue.edu ReSent-Date: Tue 10 Nov 87 09:13:00-MST ReSent-From: "Nelson H.F. Beebe" ReSent-To: beebe@SCIENCE.UTAH.EDU, debar@SCIENCE.UTAH.EDU ReSent-Message-ID: <12349518826.16.BEEBE@SCIENCE.UTAH.EDU> A few small fixes to the new version 3.9e, shortly to be posted to the net somewhere. I will post my first set of fixes to the documentation in a few days. If you run a SysII/SysV system be sure to grab the fix in termio! This posting has one VMS enhancement, and several small changes. I have only run it on a few SysV machines, and only a few hours total. Looks *really* good. -- Reason for change: Addition of this change allows the emacs.rc file to be in the login directory rather than the current directory. Could also be "sys$login:[bin]" or something like that. Changes to epath.h: 70a71 > "sys$login:", Reason for change: When the VT100 option is selected there is a missing "{". Rather than put it in both places, which messes up my formatter, I placed it on a line by itself. Second change allows RETURN to be a quoted character in search or replace strings without being turned into a newline. This makes adding or deleting returns from files much easier. Changes to input.c: 357c357 < if (c == metac) { --- > if (c == metac) 358a359 > { 413c414 < if (c == (CTRL | 0x4d)) --- > if (c == (CTRL | 0x4d) && !quotef) Reason for change: When the USG (SysIII/V) option is selected, stdin is placed in polling mode without setting the flag to indicate that this has been done. This causes all input to be done in polling mode, making CPU time = the clock time. While this is not obvious on a single user system, on a large system it is not acceptable. This change sets the polling flag when polling mode is used. There was also some code to loop on input, caused by the polling flag error. I removed it. Changes to termio.c: 431,432c431 < while (read(0, &kbdq, 1) != 1) < ; --- > read(0, &kbdq, 1); 489a489 > kbdpoll = TRUE; -- bill davidsen (wedu@ge-crd.arpa) {uunet | philabs | seismo}!steinmetz!crdos1!davidsen "Stupidity, like virtue, is its own reward" -me 25-Nov-87 22:15:15-MST,2469;000000000000 Return-Path: Received: from cs.utah.edu by SCIENCE.UTAH.EDU with TCP; Wed 25 Nov 87 22:15:13-MST Received: by cs.utah.edu (5.54/utah-2.0-cs) id AA10615; Wed, 25 Nov 87 22:14:38 MST From: news@cs.utah.edu (Netnews Owner) Reply-To: steinmetz.steinmetz!davidsen@cs.utah.edu (William E. Davidsen Jr) To: comp-emacs@cs.utah.edu Subject: Re: MicroEMACS works but eats CPU on SysV Message-Id: <7986@steinmetz.steinmetz.UUCP> Date: 25 Nov 87 21:05:48 GMT References: <1107@sugar.UUCP> <422@cimcor.UUCP> Organization: General Electric CRD, Schenectady, NY Keywords: MicroEMACS, Microport, USG I posted this once before and mailed a copy to the author. This is the fix for the polling in SysV as well as some other bugs. Each fix is carefully documented describing what it fixes. ---------------------------------------------------------------- Reason for change: Addition of this change allows the emacs.rc file to be in the login directory rather than the current directory. Could also be "sys$login:[bin]" or something like that. Changes to epath.h: 70a71 > "sys$login:", Reason for change: When the VT100 option is selected there is a missing "{". Rather than put it in both places, which messes up my formatter, I placed it on a line by itself. Second change allows RETURN to be a quoted character in search or replace strings without being turned into a newline. This makes adding or deleting returns from files much easier. Changes to input.c: 357c357 < if (c == metac) { --- > if (c == metac) 358a359 > { 413c414 < if (c == (CTRL | 0x4d)) --- > if (c == (CTRL | 0x4d) && !quotef) Reason for change: When the USG (SysIII/V) option is selected, stdin is placed in polling mode without setting the flag to indicate that this has been done. This causes all input to be done in polling mode, making CPU time = the clock time. While this is not obvious on a single user system, on a large system it is not acceptable. This change sets the polling flag when polling mode is used. There was also some code to loop on input, caused by the polling flag error. I removed it. Changes to termio.c: 431,432c431 < while (read(0, &kbdq, 1) != 1) < ; --- > read(0, &kbdq, 1); 489a489 > kbdpoll = TRUE; -- bill davidsen (wedu@ge-crd.arpa) {uunet | philabs | seismo}!steinmetz!crdos1!davidsen "Stupidity, like virtue, is its own reward" -me 25-Nov-87 22:15:55-MST,3068;000000000000 Return-Path: Received: from cs.utah.edu by SCIENCE.UTAH.EDU with TCP; Wed 25 Nov 87 22:15:52-MST Received: by cs.utah.edu (5.54/utah-2.0-cs) id AA10676; Wed, 25 Nov 87 22:15:17 MST From: news@cs.utah.edu (Netnews Owner) Reply-To: karl@mumble.cis.ohio-state.edu (Karl Kleinpaste) To: comp-emacs@cs.utah.edu Subject: Re: MicroEMACS works but eats CPU on SysV Message-Id: <2268@tut.cis.ohio-state.edu> Date: 25 Nov 87 16:22:20 GMT References: <1107@sugar.UUCP> <422@cimcor.UUCP> Sender: news@tut.cis.ohio-state.edu In-Reply-To: mike@cimcor.UUCP's message of 23 Nov 87 20:59:44 GMT This is a bug for which Bill Davidsen (davidsen@steinmetz) posted a fix a week or so before 3.9e itself was posted. Here's the report as he distributed it to comp.emacs on 9 Nov. Note that there are 3 fixes here. The last is the one for SysV. From: davidsen@steinmetz.steinmetz.UUCP (William E. Davidsen Jr) Newsgroups: comp.emacs Subject: Fixes and enhancements to MicroEMACS 3.9e Date: 9 Nov 87 21:53:40 GMT Organization: GE Corp. R & D, Schenectady,NY A few small fixes to the new version 3.9e, shortly to be posted to the net somewhere. I will post my first set of fixes to the documentation in a few days. If you run a SysII/SysV system be sure to grab the fix in termio! This posting has one VMS enhancement, and several small changes. I have only run it on a few SysV machines, and only a few hours total. Looks *really* good. -- Reason for change: Addition of this change allows the emacs.rc file to be in the login directory rather than the current directory. Could also be "sys$login:[bin]" or something like that. Changes to epath.h: 70a71 > "sys$login:", Reason for change: When the VT100 option is selected there is a missing "{". Rather than put it in both places, which messes up my formatter, I placed it on a line by itself. Second change allows RETURN to be a quoted character in search or replace strings without being turned into a newline. This makes adding or deleting returns from files much easier. Changes to input.c: 357c357 < if (c == metac) { --- > if (c == metac) 358a359 > { 413c414 < if (c == (CTRL | 0x4d)) --- > if (c == (CTRL | 0x4d) && !quotef) Reason for change: When the USG (SysIII/V) option is selected, stdin is placed in polling mode without setting the flag to indicate that this has been done. This causes all input to be done in polling mode, making CPU time = the clock time. While this is not obvious on a single user system, on a large system it is not acceptable. This change sets the polling flag when polling mode is used. There was also some code to loop on input, caused by the polling flag error. I removed it. Changes to termio.c: 431,432c431 < while (read(0, &kbdq, 1) != 1) < ; --- > read(0, &kbdq, 1); 489a489 > kbdpoll = TRUE; -- bill davidsen (wedu@ge-crd.arpa) {uunet | philabs | seismo}!steinmetz!crdos1!davidsen "Stupidity, like virtue, is its own reward" -me -=- Karl 28-Nov-87 20:06:38-MST,3596;000000000001 Return-Path: Received: from cs.utah.edu by SCIENCE.UTAH.EDU with TCP; Sat 28 Nov 87 20:06:34-MST Received: by cs.utah.edu (5.54/utah-2.0-cs) id AA18840; Sat, 28 Nov 87 20:06:48 MST From: news@cs.utah.edu (Netnews Owner) Reply-To: sugar!karl@cs.utah.edu (Karl Lehenbauer) To: comp-emacs@cs.utah.edu Subject: MicroEMACS 3.9e patch for bug in pipe-command ^X-@, others Message-Id: <1124@sugar.UUCP> Date: 28 Nov 87 05:09:28 GMT Organization: Sugar Land UNIX - Houston, TX Here are some context diffs for MicroEMACS 3.9e. The most important one is a fix for a bug in pipe-command (^X-@) that caused it to not work a lot (all versions). There are a couple of trivial error message changes that one may or may not think are useful. Finally, there is a hack for Unix for pipe-command to write stderr output to the command buffer as well as standard output. This is a trivial change to make the message "Can not delete this window" tell you why, too, as in "Can not delete the only window": *** window.orig Fri Nov 27 02:25:46 1987 --- window.c Fri Nov 27 02:26:11 1987 *************** *** 252,254 if (wheadp->w_wndp == NULL) { ! mlwrite("Can not delete this window"); return(FALSE); --- 252,254 ----- if (wheadp->w_wndp == NULL) { ! mlwrite("Can not delete the only window"); return(FALSE); This is also a trivial change to make the "Buffer is being displayed" error message explain what EMACS was trying to do, as in "Can't delete buffer - it is being displayed": *** buffer.orig Fri Nov 27 16:02:28 1987 --- buffer.c Fri Nov 27 16:03:00 1987 *************** *** 146,148 if (bp->b_nwnd != 0) { /* Error if on screen. */ ! mlwrite("Buffer is being displayed"); return (FALSE); --- 146,148 ----- if (bp->b_nwnd != 0) { /* Error if on screen. */ ! mlwrite("Can't delete buffer - it is being displayed"); return (FALSE); This is a tricky one. When doing pipe-command, ^X-@, the code is supposed to delete the buffer "command" prior to starting the subshell. To do this, it first has to remove the window from the screen. Unfortunately, the existing version removes the current window rather than command window. This patch fixes it in a not-certain-to-be-perfect-way. Specifically, ^X-@ still won't work if command is the only window. Also, I don't know if the "curbp = wp->w_bufp" is necessary or not. The second little hack causes stderr output in commands executed by pipe-command (^X-@) to go into the output buffer, too. This way, one can write uEMACS macros to crack error messages from the C compiler and such, just like the big boys :-) Ultimately I think it should direct error output into a different buffer (named stderr perhaps?) Then, the cool one-key "make" macro could look at the exit status and see if the stderr window was needed, etc. etc. etc. *** spawn.orig Fri Nov 27 02:07:41 1987 --- spawn.c Fri Nov 27 15:57:03 1987 *************** *** 382,384 if (wp->w_bufp == bp) { ! onlywind(FALSE, 1); break; --- 382,387 ----- if (wp->w_bufp == bp) { ! /* still fails if command is only window on screen */ ! curwp = wp; ! curbp = wp->w_bufp; ! delwind(FALSE, 1); break; *************** *** 426,427 strcat(line,filnam); system(line); --- 429,431 ----- strcat(line,filnam); + strcat(line," 2>&1"); /* get stderr, too */ system(line); -- 28-Nov-87 23:06:55-MST,4847;000000000000 Return-Path: Received: from cs.utah.edu by SCIENCE.UTAH.EDU with TCP; Sat 28 Nov 87 23:06:53-MST Received: by cs.utah.edu (5.54/utah-2.0-cs) id AA21812; Sat, 28 Nov 87 23:07:06 MST From: news@cs.utah.edu (Netnews Owner) Reply-To: sugar!karl@cs.utah.edu (Karl Lehenbauer) To: comp-unix-xenix@cs.utah.edu, comp-emacs@cs.utah.edu Subject: Hack for MicroEMACS to support fkeys/keypad under Message-Id: <1132@sugar.UUCP> Date: 29 Nov 87 00:39:50 GMT Organization: Sugar Land UNIX - Houston, TX Keywords: Microport MicroEMACS function keys hack This is a context diff of a hack to make MicroEMACS function keys work under Microport Unix System V/286. You also have to replace your ANSI keyboard mappings, defined in '/etc/rc.d/keybrd.rc' with one I've included as a shell archive at the end. Yes, it's gross, but it makes the function, arrow keys, and miscellaneous keypad keys work. Consult keybrd.rc for their definitions. This adds a Microport entry to estruct.h for #if's: *** estruct.orig Fri Nov 27 20:37:19 1987 --- estruct.h Fri Nov 27 20:37:06 1987 *************** *** 49,50 #define FINDER 0 /* Macintosh OS */ --- 49,51 ----- #define FINDER 0 /* Macintosh OS */ + #define MICROPORT 1 /* Sys V/286, set USG too */ This causes uEMACS to recognize ASCII decimal character 31 (^_) as a function key prefix character. It was the only I could figure out that uEMACS didn't use for something that @#$%&* /etc/setkey would accept (/etc/setkey doesn't conform to its manpage, either. Perhaps Microport sysv/286 2.2 will. *** input.orig Thu Nov 26 20:00:35 1987 --- input.c Fri Nov 27 20:29:47 1987 *************** *** 305,306 #if AMIGA --- 305,313 ----- + #if MICROPORT + if (c == 31) { /* Apply SPEC prefix, it's control underscore */ + c = tgetc(); + return(SPEC | c); + } + #endif + #if AMIGA --------------------- Here's the shar for keybrd.rc. There are probably better mappings for some of these. I don't know 'cuz I'm new to EMACS. ------------------- cut here ------------------- : #! /bin/sh # This is a shell archive, created on Sugar Land Unix (..!uunet!nuchat!sugar) # (bbs: 713-933-2440) by karl (Karl Lehenbauer) on Sat Nov 28 16:24:35 1987 # Remove anything before the "#! /bin/sh" line, then unpack it by saving # it into a file and typing "sh file". If you do not have sh, you need # unshar, a dearchiving program which is widely available. In the absolute # wost case, you can crack the files out by hand. # If the archive is complete, you will see the message "End of archive." # at the end. # This archive contains the following files... # 'keybrd.rc' # To extract them, run the following through /bin/sh echo x - keybrd.rc sed 's/^X//' > keybrd.rc << '//END_OF_FILE' X: /bin/sh X# @(#) MicroEMACS keybrd.rc X# set up the keyboard as hacked for MicroEMACS X# X/etc/setkey ins "^C" # insert character X/etc/setkey up "^P" # up cursor X/etc/setkey down "^N" # down cursor X/etc/setkey left "^B" # left (backward) cursor X/etc/setkey right "^F" # right (forward) cursor X/etc/setkey shift left "^[B" # left word X/etc/setkey shift right "^[F" # right word X/etc/setkey home "^[<" # go to start of file X/etc/setkey end "^[>" # go to end of file X/etc/setkey alt ins "^A^M^B" # insert line X/etc/setkey alt del "^A^[ ^N^W" # delete line X/etc/setkey ctrl del "^D" # delete character X/etc/setkey ctrl up "^X^P" # scroll up X/etc/setkey ctrl down "^X^N" # scroll down X/etc/setkey pgup "^Z" # page up X/etc/setkey pgdn "^V" # page down X#/etc/setkey shift tab "^[[Z" # backtab X#/etc/setkey prtsc "^[[i" # copy to primary aux dev (print screen) X/etc/setkey ctrl left "^[3^[B" # jump left X/etc/setkey ctrl right "^[3^[F" # jump right X/etc/setkey f1 "^_;" # function 1 X/etc/setkey f2 "^_<" # function 2 X/etc/setkey f3 "^_=" # function 3 X/etc/setkey f4 "^_>" # function 4 X/etc/setkey f5 "^_?" # function 5 X/etc/setkey f6 "^_@" # function 6 X/etc/setkey f7 "^_A" # function 7 X/etc/setkey f8 "^_B" # function 8 X/etc/setkey f9 "^_C" # function 9 X/etc/setkey f10 "^_D" # function 10 X/etc/setkey shift f1 "^_T" # function 1 shifted X/etc/setkey shift f2 "^_U" # function 2 shifted X/etc/setkey shift f3 "^_V" # function 3 shifted X/etc/setkey shift f4 "^_W" # function 4 shifted X/etc/setkey shift f5 "^_X" # function 5 shifted X/etc/setkey shift f6 "^_Y" # function 6 shifted X/etc/setkey shift f7 "^_Z" # function 7 shifted X/etc/setkey shift f8 "^_[" # function 8 shifted X/etc/setkey shift f9 "^_\\" # function 9 shifted X/etc/setkey shift f10 "^_]" # function 10 shifted X X/etc/setkey alt f10 "^[xhelp^M" # get help //END_OF_FILE echo "End of archive." # end of archive. exit 0 -- 30-Nov-87 04:06:57-MST,2684;000000000000 Return-Path: Received: from cs.utah.edu by SCIENCE.UTAH.EDU with TCP; Mon 30 Nov 87 04:06:56-MST Received: by cs.utah.edu (5.54/utah-2.0-cs) id AA21088; Mon, 30 Nov 87 04:07:08 MST From: news@cs.utah.edu (Netnews Owner) Reply-To: sugar!karl@cs.utah.edu (Karl Lehenbauer) To: comp-emacs@cs.utah.edu Subject: Bug fixes for MicroEMACS 3.9e string functions Message-Id: <1133@sugar.UUCP> Date: 29 Nov 87 08:10:02 GMT Organization: Sugar Land UNIX - Houston, TX Keywords: MicroEMACS &left &right &mid There are bugs in the C code for the execution of &left, &right and &mid. Symptom: &left, &right and &mid return too many characters. The extra characters are garbage. Analysis: The existing code apparently relies on strnchar writing a \0 to the end of the destination string in all cases, if it is to work at all. The System V manual entry for String (3C) says "The result will not be null-terminated if the length of s2 (the source string) is n or more." strnchar definitely works this way on my Unix SysV system. One solution: Here are the context diffs for some patches to eval.c that cause uEMACS to write the null byte at the end of the result string as it should. What you need to do: If it works allright for you, you needn't necessarily pick this up. I know Dan Lawrence reads comp.emacs. Presumably he'll pick this up or do some equivalent. You'll need to have it soon or you won't be able use many of the super-cool macro packages that I'm sure people will be posting ;-) Ta. (Hey Dan, great work!) *** eval.orig Sat Nov 28 18:36:23 1987 --- eval.c Sat Nov 28 20:19:18 1987 *************** *** 33,34 char *xlat(); /* translate a char string */ #if ENVFUNC --- 33,35 ----- char *xlat(); /* translate a char string */ + int itmp; /* tmp variable */ #if ENVFUNC *************** *** 76,78 return(strcat(result, arg2)); ! case UFLEFT: return(strncpy(result, arg1, atoi(arg2))); case UFRIGHT: return(strcpy(result, --- 77,80 ----- return(strcat(result, arg2)); ! case UFLEFT: result[(itmp = atoi(arg2))] = '\0'; ! return(strncpy(result, arg1, itmp)); case UFRIGHT: return(strcpy(result, *************** *** 79,82 &arg1[(strlen(arg1) - atoi(arg2))])); ! case UFMID: return(strncpy(result, &arg1[atoi(arg2)-1], ! atoi(arg3))); case UFNOT: return(ltos(stol(arg1) == FALSE)); --- 81,85 ----- &arg1[(strlen(arg1) - atoi(arg2))])); ! case UFMID: result[(itmp = atoi(arg3))] = '\0'; ! return(strncpy(result, &arg1[atoi(arg2)-1], ! itmp)); case UFNOT: return(ltos(stol(arg1) == FALSE)); -- 30-Nov-87 04:07:20-MST,3747;000000000000 Return-Path: Received: from cs.utah.edu by SCIENCE.UTAH.EDU with TCP; Mon 30 Nov 87 04:07:18-MST Received: by cs.utah.edu (5.54/utah-2.0-cs) id AA21119; Mon, 30 Nov 87 04:07:30 MST From: news@cs.utah.edu (Netnews Owner) Reply-To: sugar!karl@cs.utah.edu (Karl Lehenbauer) To: comp-emacs@cs.utah.edu Subject: Diffs so MicroEMACS 3.9e can set environment vars Message-Id: <1134@sugar.UUCP> Date: 29 Nov 87 11:47:46 GMT Organization: Sugar Land UNIX - Houston, TX Keywords: MicroEMACS set o.s. environment vars Am I having fun yet? Here's the context diffs for a new command, 'set-environment', which lets one set environment variables within uEMACS (you can already read them with the &env function) Usage: set-environment environment_variable_name value example: set-environment HOME "/usr/karl" cooler example: set-environment PATH &cat &env PATH ":/usr/local/bin" Note that the code is well behaved in that it follows the uEMACS #ifdef for environment variable support, ENVFUNC. 'putenv' is the key library routine that must exist for this to work. *** efunc.orig Sun Nov 29 01:45:11 1987 --- efunc.h Sun Nov 29 01:51:51 1987 *************** *** 196,197 #endif #if PROC --- 196,200 ----- #endif + #if ENVFUNC + extern int setenv(); /* set o.s. environment variable */ + #endif #if PROC *************** *** 389,390 {"set", setvar}, #if CRYPT --- 392,396 ----- {"set", setvar}, + #if ENVFUNC + {"set-environment", setenv}, + #endif #if CRYPT *** eval.orig Sat Nov 28 18:36:23 1987 --- eval.c Sun Nov 29 02:58:08 1987 *************** *** 31,36 static char result[2 * NSTRING]; /* string result */ char *flook(); /* look file up on path */ char *xlat(); /* translate a char string */ #if ENVFUNC char *getenv(); /* get environment string */ #endif --- 31,37 ----- static char result[2 * NSTRING]; /* string result */ char *flook(); /* look file up on path */ char *xlat(); /* translate a char string */ + int itmp; /* tmp variable */ #if ENVFUNC char *getenv(); /* get environment string */ #endif *************** *** 334,339 /* and return it */ return(status); } findvar(var, vd, size) /* find a variables type and name */ --- 337,384 ----- /* and return it */ return(status); } + + #if ENVFUNC + int setenv(f, n) /* set an o.s. environment variable */ + int f; /* default flag */ + int n; /* numeric arg (can overide prompted value) */ + { + register int status; /* status return */ + VDESC vd; /* variable num/type */ + char var[NVSIZE+1]; /* name of variable to fetch */ + char value[NSTRING]; /* value to set variable to */ + char *envstr; + + /* first get the variable to set.. */ + if (clexec == FALSE) { + status = mlreply("Environment variable to set: ", &var[0], NVSIZE); + if (status != TRUE) + return(status); + } else { /* macro line argument */ + /* grab token and skip it */ + execstr = token(execstr, var, NVSIZE + 1); + } + + /* var contains the variable name text */ + + /* get the value for that variable */ + if (f == TRUE) + strcpy(value, itoa(n)); + else { + status = mlreply("Value: ", &value[0], NSTRING); + if (status != TRUE) + return(status); + } + + /* allocate memory for the new environment variable */ + if ((envstr = malloc(strlen(var) + strlen(value) + 2)) == NULL) + return(FALSE); + /* format the environment string */ + sprintf(envstr,"%s=%s",var,value); + /* and set the appropriate value */ + return(!putenv(envstr)); + } + #endif findvar(var, vd, size) /* find a variables type and name */ -- 1-Dec-87 12:13:21-MST,1614;000000000000 Return-Path: Received: from cs.utah.edu by SCIENCE.UTAH.EDU with TCP; Tue 1 Dec 87 12:13:15-MST Received: by cs.utah.edu (5.54/utah-2.0-cs) id AA13484; Tue, 1 Dec 87 12:13:21 MST From: news@cs.utah.edu (Netnews Owner) Reply-To: sam@ncsuvx.ncsu.edu (Mr. Sam Moore) To: comp-emacs@cs.utah.edu Subject: MicroEmacs 3.9e VT100 Key Mapping? Message-Id: <1280@ncsuvx.ncsu.edu> Date: 1 Dec 87 15:25:17 GMT Organization: NCSU Computing Center, Raleigh, NC I have MicroEmacs version 3.9e running on a MicroVax(Ultrix) and on a VAX(VMS). On both I want to use the function keys and cursor keys. I compiled in the VT100 define. And I tried to map some keys in the autoload script file. I was unsuccessful. Does anyone know how to do this? Does anyone have any script files other than those in the distribution? If so, I would like to see them. Also, the VT100 define caused a compiler error in the input.c file in the function getcmd(). Unless I have compiled with the wrong options, it seems that there is a missing brace, {. If this is old news and there are fixes out there somewhere, please let me know. Fron file input.c in function getcmd(): /* process META prefix */ #if VT100 /* if ESC must be recognized.... change this to a 1 */ if (c == metac || c == (CTRL | '[')) <-----------| #else | if (c == metac) { |-- No brace. #endif Thanks, Sam Moore NCSU Computing Center - Raleigh, NC sam@ncsuvx (internet) sam@ncsuvax (bitnet) samm@ncsuvm (bitnet) 1-Dec-87 14:09:50-MST,1193;000000000000 Return-Path: Received: from cs.utah.edu by SCIENCE.UTAH.EDU with TCP; Tue 1 Dec 87 14:09:28-MST Received: by cs.utah.edu (5.54/utah-2.0-cs) id AA18519; Tue, 1 Dec 87 14:09:37 MST From: news@cs.utah.edu (Netnews Owner) Reply-To: nev@edison.ge.com (Niles VanDenburg) To: comp-emacs@cs.utah.edu Subject: MicroEMACS 3.9e VMS type-ahead Message-Id: <1244@edison.GE.COM> Date: 30 Nov 87 19:12:04 GMT Organization: General Electric Company, Charlottesville, VA Keywords: VMS, MicroEMACS, type-ahead addition to MicroEMACS 3.9e to give the usual type-ahead capability when running under VMS Add to termio.c after line 493: #if VMS int status; int iosb[2]; int cnt[2]; static int count = 0; if (count == 0) { status = SYS$QIOW(EFN, iochan, IO$_SENSEMODE|IO$M_TYPEAHDCNT, iosb, 0, 0, cnt, 0, 0, 0, 0, 0); if (status != SS$_NORMAL) { exit(status); } count = cnt[0] & 0xFFFF; } else { --count; } return (count != 0); #endif flames -> hades Niles VanDenburg nev@edison.GE.COM 1-Dec-87 16:11:29-MST,3257;000000000000 Return-Path: Received: from cs.utah.edu by SCIENCE.UTAH.EDU with TCP; Tue 1 Dec 87 16:11:21-MST Received: by cs.utah.edu (5.54/utah-2.0-cs) id AA24975; Tue, 1 Dec 87 16:11:22 MST From: news@cs.utah.edu (Netnews Owner) Reply-To: windley@iris.ucdavis.edu (Phil Windley) To: comp-emacs@cs.utah.edu Subject: Re: MicroEmacs 3.9e VT100 Key Mapping? Message-Id: <620@ucdavis.ucdavis.edu> Date: 1 Dec 87 20:23:00 GMT References: <1280@ncsuvx.ncsu.edu> Sender: uucp@ucdavis.ucdavis.edu Organization: U.C. Davis - College of Engineering In article <1280@ncsuvx.ncsu.edu> sam@ncsuvx.ncsu.edu (Mr. Sam Moore) writes: > >I have MicroEmacs version 3.9e running on a MicroVax(Ultrix) and on a >VAX(VMS). On both I want to use the function keys and cursor keys. I >compiled in the VT100 define. And I tried to map some keys in the >autoload script file. I was unsuccessful. Does anyone know how to do >this? Does anyone have any script files other than those in the distribution? >If so, I would like to see them. I will add my vt100.cmd file to the end of this. Its not perfect yet, but it does work. > > Unless I have compiled with the wrong options, it seems >that there is a missing brace, {. If this is old news and there are fixes >out there somewhere, please let me know. > Yes there is a missing brace. Just add it and everything will work fine. One more point. The command file that follows has a line which says 'write-message "~e="'. This sends an escape-= to the terminal to turn on the alternate keypad. The ~e is not standard memacs. I had to modify the function token() in the file exec.c so that ~e output an escape character. This allows you to program the vt100 from within a command file. I'm not sure if this will cause other problems. It seems to me that there must be a goos reason for leaving it out, but maybe not. Phil Windley Robotics Research Lab University of California, Davis ----------------------- vt100.cmd ----------------------------------- ;;; for vt100. ;;; alternate keypad mode. write-message "~e=" ;;; bind alternate keypad. ; bind-to-key FNp ; 0 bind-to-key end-of-line FNq ; 1 bind-to-key next-line FNr ; 2 bind-to-key next-page FNs ; 3 bind-to-key backward-character FNt ; 4 ; bind-to-key FNu ; 5 bind-to-key forward-character FNv ; 6 bind-to-key beginning-of-line FNw ; 7 bind-to-key previous-line FNx ; 8 bind-to-key previous-page FNy ; 9 bind-to-key end-of-file FNl ; , bind-to-key beginning-of-file FNm ; - bind-to-key delete-next-character FNn ; . ; bind-to-key FNM ; enter ;;; function keys bind-to-key set-mark FNP ; pf1 (default) bind-to-key copy-region FNQ ; pf2 (default) bind-to-key kill-region FNR ; pf3 (default) bind-to-key yank FNS ; pf4 (default) Phil Windley Robotics Research Lab University of California, Davis 1-Dec-87 22:06:07-MST,2332;000000000000 Return-Path: Received: from cs.utah.edu by SCIENCE.UTAH.EDU with TCP; Tue 1 Dec 87 22:06:04-MST Received: by cs.utah.edu (5.54/utah-2.0-cs) id AA05359; Tue, 1 Dec 87 22:06:00 MST From: news@cs.utah.edu (Netnews Owner) Reply-To: dasys1!manes@cs.utah.edu (Steve Manes) To: comp-unix-xenix@cs.utah.edu, comp-emacs@cs.utah.edu Subject: Re: Hack for MicroEMACS to support fkeys/keypad under Message-Id: <2119@dasys1.UUCP> Date: 1 Dec 87 18:07:01 GMT References: <1132@sugar.UUCP> Organization: Datamerica Systems, NYC Keywords: Microport MicroEMACS function keys hack In article <1132@sugar.UUCP> karl@sugar.UUCP (Karl Lehenbauer) writes: >This is a context diff of a hack to make MicroEMACS function keys work under >Microport Unix System V/286. You also have to replace your ANSI keyboard >mappings, defined in '/etc/rc.d/keybrd.rc' with one I've included as a >shell archive at the end. Yes, it's gross, but it makes the function, >arrow keys, and miscellaneous keypad keys work. Consult keybrd.rc >for their definitions. It's not necessary to add a new protocol code character to make uEMACS work with Microport UNIX. I modified Daniel's code to allow it to use Microport's standard ANSI escape codes as follows. This is the beginning of his function 'get1key' in file 'input.c': get1key() int c; #if AMIGA int d; #endif #if UPORT static int gotmeta; #endif /* get a keystroke */ c = tgetc(); #ifdef UPORT if (gotmeta && c == '[' || c == 'O')) { gotmeta = FALSE; return( (c == '[') ? (SPEC | tgetc()) : (META | SPEC | tgetc()) ); } gotmeta = (c == 0x1b) ? TRUE : FALSE; #endif and in the function 'getcmd': ... ... /* process META prefix */ if (c == metac) { c = get1key(); #ifdef UPORT if (c & SPEC) return(c); #endif ... ... This allows Microport function keys to be attached to M-FNx keys. You'll also need to do the 'bind.c' patch mentioned earlier in the discussion to enable both upper and lowercase function key codes. -- +----------------------------------------------------------------------- + Steve Manes Roxy Recorders, Inc. NYC + decvax!philabs!cmcl2!hombre!magpie!manes Magpie BBS: 212-420-0527 + uunet!iuvax!bsu-cs!zoo-hq!magpie!manes 300/1200/2400 2-Dec-87 15:08:07-MST,12495;000000000000 Return-Path: Received: from cs.utah.edu by SCIENCE.UTAH.EDU with TCP; Wed 2 Dec 87 15:07:56-MST Received: by cs.utah.edu (5.54/utah-2.0-cs) id AA04776; Wed, 2 Dec 87 15:06:30 MST From: news@cs.utah.edu (Netnews Owner) Reply-To: rebel!george@cs.utah.edu (George M. Sipe) To: comp-emacs@cs.utah.edu, comp-sources-bugs@cs.utah.edu Subject: *CORRECTION* MicroEMACS 3.9e standout bugs (fix) Message-Id: <20380@rebel.UUCP> Date: 2 Dec 87 18:33:42 GMT Organization: Tolerant Systems, Atlanta GA Keywords: MicroEMACS standout patch_correction Summary: patch to fix standout on embedded attribute terminals (This patch is a repost WITH CORRECTION. The standout patches which I recently posted for MicroEMACS 3.9e contained an error for display.c. This was traced to the conversion of the patches from 3.8l. The patch program made a patch with 'fuzz factor 2' which I missed and as luck would have it the patch went into the wrong place. That incorrectly patched file was then used as the basis for the last posting. Below is a full reposting of the corrected patches. If this is the first time you are applying the standout patches, you can simply invoke patch: 'patch v_text[term.t_ncol]; while (cp1 < cp3) { TTputc(*cp1); ++ttcol; --- 658,672 ----- /* scan through the line and dump it to the screen and the virtual screen array */ ! #if TERMCAP & FIXSG & REVSTA ! if (req && SG > 0) { /* Skip over 'spaces' */ ! ttcol += SG; ! cp1 += SG; ! cp2 += SG; ! cp3 = &vp1->v_text[term.t_ncol-SG]; ! } else ! #endif ! cp3 = &vp1->v_text[term.t_ncol]; while (cp1 < cp3) { TTputc(*cp1); ++ttcol; *************** *** 702,707 cp3 = &vp1->v_text[term.t_ncol]; cp4 = &vp2->v_text[term.t_ncol]; while (cp3[-1] == cp4[-1]) { --cp3; --cp4; --- 713,725 ----- cp3 = &vp1->v_text[term.t_ncol]; cp4 = &vp2->v_text[term.t_ncol]; + #if TERMCAP & FIXSG & REVSTA + if (req && SG > 0) /* Adjust for 'spaces' */ + sook = (cp1 - &vp1->v_text[0]) > 0; + else + sook = FALSE; + #endif + while (cp3[-1] == cp4[-1]) { --cp3; --cp4; *************** *** 722,727 movecursor(row, cp1 - &vp1->v_text[0]); /* Go to start of line. */ #if REVSTA TTrev(rev); #endif --- 740,748 ----- movecursor(row, cp1 - &vp1->v_text[0]); /* Go to start of line. */ #if REVSTA + #if TERMCAP & FIXSG + if (!sook) TTrev(rev); + #else TTrev(rev); #endif #endif *************** *** 724,729 #if REVSTA TTrev(rev); #endif while (cp1 != cp5) { /* Ordinary. */ TTputc(*cp1); --- 745,751 ----- #else TTrev(rev); #endif + #endif while (cp1 != cp5) { /* Ordinary. */ TTputc(*cp1); *************** *** 737,742 *cp2++ = *cp1++; } #if REVSTA TTrev(FALSE); #endif vp1->v_flag &= ~VFCHG; /* flag this line as updated */ --- 759,767 ----- *cp2++ = *cp1++; } #if REVSTA + #if TERMCAP & FIXSG + if (!sook) TTrev(FALSE); + #else TTrev(FALSE); #endif #endif *************** *** 739,744 #if REVSTA TTrev(FALSE); #endif vp1->v_flag &= ~VFCHG; /* flag this line as updated */ return(TRUE); #endif --- 764,770 ----- #else TTrev(FALSE); #endif + #endif vp1->v_flag &= ~VFCHG; /* flag this line as updated */ return(TRUE); #endif *************** *** 780,785 #endif lchar = '-'; bp = wp->w_bufp; if ((bp->b_flag&BFTRUNC) != 0) vtputc('#'); --- 806,815 ----- #endif lchar = '-'; + #if TERMCAP & FIXSG & REVSTA + if (revexist && SG > 0) /* Initial spaces. */ + for (i = 0; i < SG; ++i) vtputc(' '); + #endif bp = wp->w_bufp; if ((bp->b_flag&BFTRUNC) != 0) vtputc('#'); *************** *** 870,875 ++n; } while (n < term.t_ncol) /* Pad to full width. */ { vtputc(lchar); --- 900,909 ----- ++n; } + #if TERMCAP & FIXSG & REVSTA + if (revexist && SG > 0) /* Adjust for standouts. */ + n += SG * 3; + #endif while (n < term.t_ncol) /* Pad to full width. */ { vtputc(lchar); *************** *** 875,880 vtputc(lchar); ++n; } } upmode() /* update all the mode lines */ --- 909,923 ----- vtputc(lchar); ++n; } + #if TERMCAP & FIXSG & REVSTA + /* The 'so' position will show as a reverse space, while the 'se' + position will be a normal space. To balance the (visible) + reverse spaces at each end of the mode line, twice as many + spaces must exist at the end than do at the beginning. + */ + if (revexist && SG > 0) /* Trailing spaces. */ + for (i = 0; i < SG * 2; ++i) vtputc(' '); + #endif } upmode() /* update all the mode lines */ *** edef.h_orig Wed Nov 25 15:12:52 1987 --- edef.h Wed Nov 25 15:12:51 1987 *************** *** 125,130 char tap[NPAT]; /* Reversed pattern array. */ char rpat[NPAT]; /* replacement pattern */ /* The variable matchlen holds the length of the matched * string - used by the replace functions. * The variable patmatch holds the string that satisfies --- 125,134 ----- char tap[NPAT]; /* Reversed pattern array. */ char rpat[NPAT]; /* replacement pattern */ + #if FIXSG & REVSTA + int SG; /* number of standout glitches */ + #endif + /* The variable matchlen holds the length of the matched * string - used by the replace functions. * The variable patmatch holds the string that satisfies *************** *** 263,268 extern char pat[]; /* Search pattern */ extern char tap[]; /* Reversed pattern array. */ extern char rpat[]; /* replacement pattern */ extern unsigned int matchlen; extern unsigned int mlenold; --- 267,276 ----- extern char pat[]; /* Search pattern */ extern char tap[]; /* Reversed pattern array. */ extern char rpat[]; /* replacement pattern */ + + #if FIXSG & REVSTA + extern int SG; /* number of standout glitches */ + #endif extern unsigned int matchlen; extern unsigned int mlenold; *** estruct.h_orig Wed Nov 25 15:12:21 1987 --- estruct.h Wed Nov 25 15:12:19 1987 *************** *** 74,79 #define VT52 0 /* VT52 terminal (Zenith). */ #define RAINBOW 0 /* Use Rainbow fast video. */ #define TERMCAP 0 /* Use TERMCAP */ #define IBMPC 1 /* IBM-PC CGA/MONO/EGA driver */ #define DG10 0 /* Data General system/10 */ #define TIPC 0 /* TI Profesional PC driver */ --- 79,85 ----- #define VT52 0 /* VT52 terminal (Zenith). */ #define RAINBOW 0 /* Use Rainbow fast video. */ #define TERMCAP 0 /* Use TERMCAP */ + #define FIXSG TERMCAP /* Fix stand-out glitch */ #define IBMPC 1 /* IBM-PC CGA/MONO/EGA driver */ #define DG10 0 /* Data General system/10 */ #define TIPC 0 /* TI Profesional PC driver */ *** tcap.c_orig Wed Nov 25 15:12:54 1987 --- tcap.c Wed Nov 25 15:12:53 1987 *************** *** 117,122 SO = tgetstr("so", &p); if (SO != NULL) revexist = TRUE; if(CL == NULL || CM == NULL || UP == NULL) { --- 117,125 ----- SO = tgetstr("so", &p); if (SO != NULL) revexist = TRUE; + #if FIXSG & REVSTA + SG = tgetnum("sg"); /* standout glitch */ + #endif if(CL == NULL || CM == NULL || UP == NULL) { *************** *** 167,173 int state; /* FALSE = normal video, TRUE = reverse video */ { ! static int revstate = FALSE; if (state) { if (SO != NULL) putpad(SO); --- 170,178 ----- int state; /* FALSE = normal video, TRUE = reverse video */ { ! static int oldstate = TRUE + TRUE; ! if (state == oldstate) return; ! oldstate = state; if (state) { if (SO != NULL) putpad(SO); ---------------------cut here-------------CUT HERE-------------------- #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create: # display.c_fix # This archive created: Wed Dec 2 13:09:43 1987 export PATH; PATH=/bin:/usr/bin:$PATH if test -f 'display.c_fix' then echo shar: "will not over-write existing file 'display.c_fix'" else sed 's/^X//' << \SHAR_EOF > 'display.c_fix' XNotice: This patch is for those people who have already patched display.c Xwith the previously posted standout patch which contains an error. The Xpurpose of this patch is to correct that error. YOU SHOULD NOT APPLY THIS XPATCH IF YOU DID NOT APPLY THE PREVIOUS ONE. IF YOU RETAINED THE ORIGINAL XSOURCE TO display.c THEN YOU SHOULD NOT NEED THIS PATCH AT ALL. X X*** display.c_bad Wed Dec 2 13:05:17 1987 X--- display.c Wed Dec 2 13:06:20 1987 X*************** X*** 806,811 X #endif X lchar = '-'; X X bp = wp->w_bufp; X if ((bp->b_flag&BFTRUNC) != 0) X vtputc('#'); X X--- 806,815 ----- X #endif X lchar = '-'; X X+ #if TERMCAP & FIXSG & REVSTA X+ if (revexist && SG > 0) /* Initial spaces. */ X+ for (i = 0; i < SG; ++i) vtputc(' '); X+ #endif X bp = wp->w_bufp; X if ((bp->b_flag&BFTRUNC) != 0) X vtputc('#'); X*************** X*** 855,864 X n += 8; X #endif X X- #if TERMCAP & FIXSG & REVSTA X- if (revexist && SG > 0) /* Initial spaces. */ X- for (i = 0; i < SG; ++i) vtputc(' '); X- #endif X vtputc(lchar); X vtputc(lchar); X vtputc(' '); X X--- 859,864 ----- X n += 8; X #endif X X vtputc(lchar); X vtputc(lchar); X vtputc(' '); SHAR_EOF fi exit 0 # End of shell archive -- George M. Sipe, Phone: (404) 662-1533 Tolerant Systems, 6961 Peachtree Industrial, Norcross, GA 30071 UUCP: ...!{decvax,hplabs,ihnp4,linus,rutgers,seismo}!gatech!rebel!george 12-Dec-87 10:03:05-MST,1252;000000000000 Return-Path: Received: from cs.utah.edu by SCIENCE.UTAH.EDU with TCP; Sat 12 Dec 87 10:03:03-MST Received: by cs.utah.edu (5.54/utah-2.0-cs) id AA01469; Sat, 12 Dec 87 01:04:03 MST From: news@cs.utah.edu (Netnews Owner) Reply-To: karl@mumble.cis.ohio-state.edu (Karl Kleinpaste) To: comp-emacs@cs.utah.edu Subject: Re: MicroEmacs 3.9e Fix Message-Id: <3107@tut.cis.ohio-state.edu> Date: 11 Dec 87 12:47:11 GMT References: <1880@cup.portal.com> Sender: news@tut.cis.ohio-state.edu Distribution: usa In-Reply-To: David_Bat_Masterson@cup.portal.com's message of 9 Dec 87 17:46:53 GMT David_Bat_Masterson@cup.portal.com writes: [Bug in last cursor command to screen under a SysV machine not working.] I believe the fix for this was to change all the TCSETAs in ioctl() calls to TCSETAWs. Does anyone see any flaws with this type of idea? No flaws at all, it's a definite you-should-do-that fix. The timing problem comes from the fact that there are characters in-queue at the time that MicroEMACS is processing the TCSETA, and the TCSETA blasts its changes onto the device instantly, causing an (inadvertent) flush of the queue. TCSETAW will wait for the queue to drain on its own. -=- Karl 14-Dec-87 20:10:08-MST,1139;000000000000 Return-Path: Received: from cs.utah.edu by SCIENCE.UTAH.EDU with TCP; Mon 14 Dec 87 20:09:59-MST Received: by cs.utah.edu (5.54/utah-2.0-cs) id AA05017; Mon, 14 Dec 87 20:05:36 MST From: news@cs.utah.edu (Netnews Owner) Reply-To: awylie@pyr1.cs.ucl.ac.uk To: comp-emacs@cs.utah.edu Subject: me3.9e MSC spawn problem + fix Message-Id: <35800001@pyr1.cs.ucl.ac.uk> Date: 1 Dec 87 09:54:00 GMT Nf-Id: #N:pyr1.cs.ucl.ac.uk:35800001:000:596 Nf-From: pyr1.cs.ucl.ac.uk!awylie Dec 1 09:54:00 1987 There is a problem in MicroEmacs 3.9e when compiled with the flags MSDOS and MSC, under Microsoft-C. The DOS shell commands like ^X! do not work. Looking in spawn.c and tracing down to execprog.c, there are 3 cases selected by #if AZTEC #if LATTICE and #if TURBO in which the actual DOS interrupts are done to create a child process and do the shell command. There is no case for MSC!!! This can be fixed by using the LATTICE case (change #if LATTICE to #if LATTICE|MSC ) and by changing the error return line from rval = -_oserr; to rval = -regs.x.ax; Andrew Wylie awylie@uk.ac.ucl.cs 19-Dec-87 23:07:03-MST,40005;000000000000 Return-Path: Received: from cs.utah.edu by SCIENCE.UTAH.EDU with TCP; Sat 19 Dec 87 23:06:49-MST Received: by cs.utah.edu (5.54/utah-2.0-cs) id AA08638; Sat, 19 Dec 87 23:05:22 MST From: news@cs.utah.edu (Netnews Owner) Reply-To: mosys!nortond@cs.utah.edu (Daniel A. Norton) To: comp-emacs@cs.utah.edu Subject: Diffs for MicroEMACS and MSC Message-Id: <209@mosys.UUCP> Date: 19 Dec 87 21:33:35 GMT Organization: Momentum Systems Corp., Cherry Hill, NJ Archive-name: uemacs/msc-diffs Here are the diffs that I mentioned for MSC and MicroEMACS. If you have MSC 5.0, you can also use the Makefile that is in this archive. Make sure that you do not select intrinsic function generation with MSC 5.0. The file patch.msc contains context diffs suitable for input to patch, with the exception that I have converted spaces to tabs in the original where useful to reduce the size of this shar. -- Daniel A. Norton nortond@mosys.UUCP c/o Momentum Systems Corporation ...uunet!mosys!nortond 2 Keystone Avenue Cherry Hill, NJ 08003 609/424-0734 --------------------------Cut Here-------------------------- : #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create the files: # Changes.msc # Makefile.msc # patch.msc # # This archive created: Sat Dec 19 15:24:22 1987 # if test -f 'Changes.msc' then echo shar: will not over-write existing "'Changes.msc'" else echo extracting "'Changes.msc'" sed 's/^X//' > Changes.msc <<'SHAR_EOF' X 001 - Changed routines whose names conflict with standard Xlibrary routines. Apparently, the authors did not like the way Xthe standard routines worked and created new ones with the same Xnames. This is a pet peeve of mine, since someone looking Xthrough such code does not really know right-away that he is Xlooking at a bastardized version of the function. Functions Xaffected are: X Old Name New Name X ltoa fmtlong X itoa itods X strncpy xstrncpy X atoi dstoi X XThe diffs file is fairly large with these changes. You may Xprefer to do global substitutes on the original to the new names. X X X 002 - For some odd reason, the "malloc" function is Xdeclared throughout the sources. Since it is already defined in Xedef.h, I have removed the duplicate declarations. Besides, the Xredefinitions conflict with the definitions provided by the Xstandard include file in MSC. X X X 003 - For the MSC version, I have changed edef.h to Xinclude the standard include files "stdlib.h" and "string.h". X X X 004 - Have added a capability to create a backup file Xwhen saving a file to disk. The suffix of the old version of the Xfile is changed to .BAK. The environment variable "$backup" is Xadded. When it is set (non-zero), the backup file is created. XWhen is reset (zero), the operation is as before. On startup, Xthe backup flag is turned off. It may be turned on with the X"emacs.rc" file. This feature is enabled by the compile-time Xflag DOSBAK. X X X 005 - Unfortunately, the MSC compilers vary between Xversions enough to warrant three additional compile-time Xvariables: MSC3, MSC4, and MSC5, to indicate the version of the XMSC compiler. X X X 006 - EMACS seems to run faster in a network environment Xif the file is opened in binary mode and CR characters are Xappended manually by EMACS. It is faster when the file is written, Xthat is. X X 007 - Since MS-DOS does not distinguish between case in Xfile names, EMACS is changed to do the same. Previously, it was Xforcing the name to lower case. Now you can "emacs Makefile" and Xthe name will display as "Makefile", rather than "makefile". X X X 008 - The spawn.c routines did not even compile with the Xregular release of 3.9e. The changes here take advantage of what Xis available with the MSC routines. In particular, there is no Xneed for the "execprog" routine. Also, when invoking the shell, Xthe SHELL environment variable is checked before checking the XCOMSPEC variable for the name of the user shell. X X 009 - Some of the messages were inconsistent and Xmisspelled in spawn.c. X--- XDaniel A. Norton nortond@mosys.UUCP Xc/o Momentum Systems Corporation ...uunet!mosys!nortond X2 Keystone Avenue XCherry Hill, NJ 08003 609/424-0734 SHAR_EOF if test 2680 -ne "`wc -c < 'Changes.msc'`" then echo shar: error transmitting "'Changes.msc'" '(should have been 2680 characters)' fi fi if test -f 'Makefile.msc' then echo shar: will not over-write existing "'Makefile.msc'" else echo extracting "'Makefile.msc'" sed 's/^X//' > Makefile.msc <<'SHAR_EOF' X# Makefile for MicroEMACS 3.9 X# MS-DOS and MSC 5.0 X X# Enable the following two lines for debugging X#CDEBUG = -Od -Zi -DDAN_DEBUG X#LDEBUG = /co X X#CDEBUG = -DDAN_DEBUG X XCDEFS = -DLINT_ARGS XCFLAGS= -AL -Oalt -Gs $(CDEFS) $(CDEBUG) XLFLAGS= /noi/st:16384$(LDEBUG) X XBIN = \usr\local\bin X XOBJS = ansi.obj basic.obj bind.obj buffer.obj crypt.obj dg10.obj \ X display.obj eval.obj exec.obj file.obj fileio.obj \ X hp110.obj hp150.obj ibmpc.obj input.obj isearch.obj line.obj \ X lock.obj main.obj random.obj region.obj search.obj spawn.obj \ X st520.obj tcap.obj termio.obj tipc.obj vmsvt.obj vt52.obj \ X window.obj word.obj z309.obj X XSRCS = ansi.c basic.c bind.c buffer.c crypt.c dg10.c \ X display.c eval.c exec.c file.c fileio.c \ X hp110.c hp150.c ibmpc.c input.c isearch.c line.c \ X lock.c main.c random.c region.c search.c spawn.c \ X st520.c tcap.c termio.c tipc.c vmsvt.c vt52.c \ X window.c word.c z309.c X XHDRS = estruct.h edef.h efunc.h epath.h ebind.h evar.h X Xemacs.exe: $(OBJS) X $(LINK) $(LFLAGS) @emacs.lnk X -del emacs.unp X ren emacs.exe emacs.unp X exepack emacs.unp emacs.exe X# copy emacs.exe $(BIN) X X$(OBJS): $(HDRS) SHAR_EOF if test 1115 -ne "`wc -c < 'Makefile.msc'`" then echo shar: error transmitting "'Makefile.msc'" '(should have been 1115 characters)' fi fi if test -f 'patch.msc' then echo shar: will not over-write existing "'patch.msc'" else echo extracting "'patch.msc'" sed 's/^X//' > patch.msc <<'SHAR_EOF' XIndex: buffer.c X*** archive/buffer.c Sat Dec 19 15:20:41 1987 X--- msdos/buffer.c Sat Dec 19 15:21:45 1987 X*************** X*** 336,338 **** X } X! ltoa(b, 7, nbytes); /* 6 digit buffer size. */ X cp2 = &b[0]; X X--- 336,338 ---- X } X! fmtlong(b, 7, nbytes); /* 6 digit buffer size. */ X cp2 = &b[0]; X*************** X*** 361,363 **** X X! ltoa(buf, width, num) X X X--- 361,363 ---- X X! fmtlong(buf, width, num) X X*************** X*** 443,445 **** X register LINE *lp; X- char *malloc(); X X X--- 443,444 ---- X register LINE *lp; X XIndex: display.c X*** archive/display.c Sat Dec 19 15:20:43 1987 X--- msdos/display.c Sat Dec 19 15:21:47 1987 X*************** X*** 45,47 **** X register VIDEO *vp; X- char *malloc(); X X X--- 45,46 ---- X register VIDEO *vp; X XIndex: edef.h X*** archive/edef.h Sat Dec 19 15:20:46 1987 X--- msdos/edef.h Sat Dec 19 15:21:48 1987 X*************** X*** 17,19 **** X char *gtusr(); X! char *itoa(); X char *ltos(); X X--- 17,19 ---- X char *gtusr(); X! char *itods(); X char *ltos(); X*************** X*** 19,20 **** X char *ltos(); X char *malloc(); X X--- 19,24 ---- X char *ltos(); X+ #if MSC X+ #include X+ #include X+ #else X char *malloc(); X*************** X*** 20,23 **** X char *malloc(); X- char *mklower(); X- char *mkupper(); X char *strcat(); X X--- 24,25 ---- X char *malloc(); X char *strcat(); X*************** X*** 24,26 **** X char *strcpy(); X! char *strncpy(); X char *token(); X X--- 26,31 ---- X char *strcpy(); X! #endif X! char *xstrncpy(); X! char *mklower(); X! char *mkupper(); X char *token(); X*************** X*** 29,30 **** X unsigned int stock(); X X X--- 34,36 ---- X unsigned int stock(); X+ char *xtmpnam(); X X*************** X*** 87,88 **** X int restflag = FALSE; /* restricted use? */ X int lastkey = 0; /* last keystoke */ X X--- 93,97 ---- X int restflag = FALSE; /* restricted use? */ X+ #if DOSBAK X+ int backupflag = FALSE; /* create .BAK files? */ X+ #endif X int lastkey = 0; /* last keystoke */ X*************** X*** 227,228 **** X extern int restflag; /* restricted use? */ X extern int lastkey; /* last keystoke */ X X--- 236,240 ---- X extern int restflag; /* restricted use? */ X+ #if DOSBAK X+ extern int backupflag; /* create .BAK files? */ X+ #endif X extern int lastkey; /* last keystoke */ XIndex: estruct.h X*** archive/estruct.h Sat Dec 19 15:20:51 1987 X--- msdos/estruct.h Sat Dec 19 15:21:51 1987 X*************** X*** 54,57 **** X #define LATTICE 0 /* Lattice 2.14 thruough 3.0 compilers */ X! #define AZTEC 1 /* Aztec C 3.20e */ X! #define MSC 0 /* MicroSoft C compile version 3 & 4 */ X #define TURBO 0 /* Turbo C/MSDOS */ X X--- 54,60 ---- X #define LATTICE 0 /* Lattice 2.14 thruough 3.0 compilers */ X! #define AZTEC 0 /* Aztec C 3.20e */ X! #define MSC3 0 /* MicroSoft C compiler version 3 */ X! #define MSC4 0 /* MicroSoft C compiler version 4 */ X! #define MSC5 1 /* MicroSoft C compiler version 5 */ X! #define MSC (MSC3 | MSC4 | MSC5) /* MicroSoft C version 3, 4 or 5 */ X #define TURBO 0 /* Turbo C/MSDOS */ X*************** X*** 92,94 **** X #define CTRLZ 0 /* add a ^Z at end of files under MSDOS only */ X! #define ADDCR 0 /* ajout d'un CR en fin de chaque ligne (ST520) */ X #define NBRACE 1 /* new style brace matching command */ X X--- 95,98 ---- X #define CTRLZ 0 /* add a ^Z at end of files under MSDOS only */ X! #define ADDCR (1 & (ST520 | MSDOS)) /* add a CR at the end of each line X! (ST520/MSDOS) */ X #define NBRACE 1 /* new style brace matching command */ X*************** X*** 94,95 **** X #define NBRACE 1 /* new style brace matching command */ X X X--- 98,100 ---- X #define NBRACE 1 /* new style brace matching command */ X+ #define DOSBAK (1 & MSDOS) /* create .BAK file on save (MSDOS) */ X X*************** X*** 665,666 **** X #endif X- X X--- 670,670 ---- X #endif XIndex: eval.c X*** archive/eval.c Sat Dec 19 15:20:53 1987 X--- msdos/eval.c Sat Dec 19 15:21:52 1987 X*************** X*** 68,75 **** X switch (fnum) { X! case UFADD: return(itoa(atoi(arg1) + atoi(arg2))); X! case UFSUB: return(itoa(atoi(arg1) - atoi(arg2))); X! case UFTIMES: return(itoa(atoi(arg1) * atoi(arg2))); X! case UFDIV: return(itoa(atoi(arg1) / atoi(arg2))); X! case UFMOD: return(itoa(atoi(arg1) % atoi(arg2))); X! case UFNEG: return(itoa(-atoi(arg1))); X case UFCAT: strcpy(result, arg1); X X--- 68,75 ---- X switch (fnum) { X! case UFADD: return(itods(dstoi(arg1) + dstoi(arg2))); X! case UFSUB: return(itods(dstoi(arg1) - dstoi(arg2))); X! case UFTIMES: return(itods(dstoi(arg1) * dstoi(arg2))); X! case UFDIV: return(itods(dstoi(arg1) / dstoi(arg2))); X! case UFMOD: return(itods(dstoi(arg1) % dstoi(arg2))); X! case UFNEG: return(itods(-dstoi(arg1))); X case UFCAT: strcpy(result, arg1); X*************** X*** 76,78 **** X return(strcat(result, arg2)); X! case UFLEFT: return(strncpy(result, arg1, atoi(arg2))); X case UFRIGHT: return(strcpy(result, X X--- 76,78 ---- X return(strcat(result, arg2)); X! case UFLEFT: return(xstrncpy(result, arg1, dstoi(arg2))); X case UFRIGHT: return(strcpy(result, X*************** X*** 78,82 **** X case UFRIGHT: return(strcpy(result, X! &arg1[(strlen(arg1) - atoi(arg2))])); X! case UFMID: return(strncpy(result, &arg1[atoi(arg2)-1], X! atoi(arg3))); X case UFNOT: return(ltos(stol(arg1) == FALSE)); X X--- 78,82 ---- X case UFRIGHT: return(strcpy(result, X! &arg1[(strlen(arg1) - dstoi(arg2))])); X! case UFMID: return(xstrncpy(result, &arg1[dstoi(arg2)-1], X! dstoi(arg3))); X case UFNOT: return(ltos(stol(arg1) == FALSE)); X*************** X*** 82,86 **** X case UFNOT: return(ltos(stol(arg1) == FALSE)); X! case UFEQUAL: return(ltos(atoi(arg1) == atoi(arg2))); X! case UFLESS: return(ltos(atoi(arg1) < atoi(arg2))); X! case UFGREATER: return(ltos(atoi(arg1) > atoi(arg2))); X case UFSEQUAL: return(ltos(strcmp(arg1, arg2) == 0)); X X--- 82,86 ---- X case UFNOT: return(ltos(stol(arg1) == FALSE)); X! case UFEQUAL: return(ltos(dstoi(arg1) == dstoi(arg2))); X! case UFLESS: return(ltos(dstoi(arg1) < dstoi(arg2))); X! case UFGREATER: return(ltos(dstoi(arg1) > dstoi(arg2))); X case UFSEQUAL: return(ltos(strcmp(arg1, arg2) == 0)); X*************** X*** 91,93 **** X case UFOR: return(ltos(stol(arg1) || stol(arg2))); X! case UFLENGTH: return(itoa(strlen(arg1))); X case UFUPPER: return(mkupper(arg1)); X X--- 91,93 ---- X case UFOR: return(ltos(stol(arg1) || stol(arg2))); X! case UFLENGTH: return(itods(strlen(arg1))); X case UFUPPER: return(mkupper(arg1)); X*************** X*** 94,98 **** X case UFLOWER: return(mklower(arg1)); X! case UFTRUTH: return(ltos(atoi(arg1) == 42)); X! case UFASCII: return(itoa((int)arg1[0])); X! case UFCHR: result[0] = atoi(arg1); X result[1] = 0; X X--- 94,98 ---- X case UFLOWER: return(mklower(arg1)); X! case UFTRUTH: return(ltos(dstoi(arg1) == 42)); X! case UFASCII: return(itods((int)arg1[0])); X! case UFCHR: result[0] = dstoi(arg1); X result[1] = 0; X*************** X*** 102,106 **** X return(result); X! case UFRND: return(itoa((ernd() % abs(atoi(arg1))) + 1)); X! case UFABS: return(itoa(abs(atoi(arg1)))); X! case UFSINDEX: return(itoa(sindex(arg1, arg2))); X case UFENV: X X--- 102,106 ---- X return(result); X! case UFRND: return(itods((ernd() % abs(dstoi(arg1))) + 1)); X! case UFABS: return(itods(abs(dstoi(arg1)))); X! case UFSINDEX: return(itods(sindex(arg1, arg2))); X case UFENV: X*************** X*** 117,122 **** X return(tsp == NULL ? "" : tsp); X! case UFBAND: return(itoa(atoi(arg1) & atoi(arg2))); X! case UFBOR: return(itoa(atoi(arg1) | atoi(arg2))); X! case UFBXOR: return(itoa(atoi(arg1) ^ atoi(arg2))); X! case UFBNOT: return(itoa(~atoi(arg1))); X case UFXLATE: return(xlat(arg1, arg2, arg3)); X X--- 117,122 ---- X return(tsp == NULL ? "" : tsp); X! case UFBAND: return(itods(dstoi(arg1) & dstoi(arg2))); X! case UFBOR: return(itods(dstoi(arg1) | dstoi(arg2))); X! case UFBXOR: return(itods(dstoi(arg1) ^ dstoi(arg2))); X! case UFBNOT: return(itods(~dstoi(arg1))); X case UFXLATE: return(xlat(arg1, arg2, arg3)); X*************** X*** 166,172 **** X switch (vnum) { X! case EVFILLCOL: return(itoa(fillcol)); X! case EVPAGELEN: return(itoa(term.t_nrow + 1)); X! case EVCURCOL: return(itoa(getccol(FALSE))); X! case EVCURLINE: return(itoa(getcline())); X! case EVRAM: return(itoa((int)(envram / 1024l))); X case EVFLICKER: return(ltos(flickcode)); X X--- 166,172 ---- X switch (vnum) { X! case EVFILLCOL: return(itods(fillcol)); X! case EVPAGELEN: return(itods(term.t_nrow + 1)); X! case EVCURCOL: return(itods(getccol(FALSE))); X! case EVCURLINE: return(itods(getcline())); X! case EVRAM: return(itods((int)(envram / 1024l))); X case EVFLICKER: return(ltos(flickcode)); X*************** X*** 172,174 **** X case EVFLICKER: return(ltos(flickcode)); X! case EVCURWIDTH:return(itoa(term.t_ncol)); X case EVCBUFNAME:return(curbp->b_bname); X X--- 172,174 ---- X case EVFLICKER: return(ltos(flickcode)); X! case EVCURWIDTH:return(itods(term.t_ncol)); X case EVCBUFNAME:return(curbp->b_bname); X*************** X*** 179,183 **** X case EVPALETTE: return(palstr); X! case EVASAVE: return(itoa(gasave)); X! case EVACOUNT: return(itoa(gacount)); X! case EVLASTKEY: return(itoa(lastkey)); X case EVCURCHAR: X X--- 179,183 ---- X case EVPALETTE: return(palstr); X! case EVASAVE: return(itods(gasave)); X! case EVACOUNT: return(itods(gacount)); X! case EVLASTKEY: return(itods(lastkey)); X case EVCURCHAR: X*************** X*** 184,187 **** X return(curwp->w_dotp->l_used == X! curwp->w_doto ? itoa('\n') : X! itoa(lgetc(curwp->w_dotp, curwp->w_doto))); X case EVDISCMD: return(ltos(discmd)); X X--- 184,187 ---- X return(curwp->w_dotp->l_used == X! curwp->w_doto ? itods('\n') : X! itods(lgetc(curwp->w_dotp, curwp->w_doto))); X case EVDISCMD: return(ltos(discmd)); X*************** X*** 189,191 **** X case EVPROGNAME:return(PROGNAME); X! case EVSEED: return(itoa(seed)); X case EVDISINP: return(ltos(disinp)); X X--- 189,191 ---- X case EVPROGNAME:return(PROGNAME); X! case EVSEED: return(itods(seed)); X case EVDISINP: return(ltos(disinp)); X*************** X*** 191,194 **** X case EVDISINP: return(ltos(disinp)); X! case EVWLINE: return(itoa(curwp->w_ntrows)); X! case EVCWLINE: return(itoa(getwpos())); X case EVTARGET: saveflag = lastflag; X X--- 191,194 ---- X case EVDISINP: return(ltos(disinp)); X! case EVWLINE: return(itods(curwp->w_ntrows)); X! case EVCWLINE: return(itods(getwpos())); X case EVTARGET: saveflag = lastflag; X*************** X*** 194,196 **** X case EVTARGET: saveflag = lastflag; X! return(itoa(curgoal)); X case EVSEARCH: return(pat); X X--- 194,196 ---- X case EVTARGET: saveflag = lastflag; X! return(itods(curgoal)); X case EVSEARCH: return(pat); X*************** X*** 199,203 **** X case EVKILL: return(getkill()); X! case EVCMODE: return(itoa(curbp->b_mode)); X! case EVGMODE: return(itoa(gmode)); X! case EVTPAUSE: return(itoa(term.t_pause)); X case EVPENDING: X X--- 199,203 ---- X case EVKILL: return(getkill()); X! case EVCMODE: return(itods(curbp->b_mode)); X! case EVGMODE: return(itods(gmode)); X! case EVTPAUSE: return(itods(term.t_pause)); X case EVPENDING: X*************** X*** 208,210 **** X #endif X! case EVLWIDTH: return(itoa(llength(curwp->w_dotp))); X case EVLINE: return(getctext()); X X--- 208,210 ---- X #endif X! case EVLWIDTH: return(itods(llength(curwp->w_dotp))); X case EVLINE: return(getctext()); X*************** X*** 210,213 **** X case EVLINE: return(getctext()); X! case EVGFLAGS: return(itoa(gflags)); X! case EVRVAL: return(itoa(rval)); X } X X--- 210,216 ---- X case EVLINE: return(getctext()); X! case EVGFLAGS: return(itods(gflags)); X! case EVRVAL: return(itods(rval)); X! #if DOSBAK X! case EVBACKUP: return(ltos(backupflag)); X! #endif X } X*************** X*** 231,233 **** X size = NSTRING - 1; X! strncpy(value, kbufh->d_chunk, size); X } X X--- 234,236 ---- X size = NSTRING - 1; X! xstrncpy(value, kbufh->d_chunk, size); X } X*************** X*** 274,276 **** X if (f == TRUE) X! strcpy(value, itoa(n)); X else { X X--- 277,279 ---- X if (f == TRUE) X! strcpy(value, itods(n)); X else { X*************** X*** 424,426 **** X switch (vnum) { X! case EVFILLCOL: fillcol = atoi(value); X break; X X--- 427,429 ---- X switch (vnum) { X! case EVFILLCOL: fillcol = dstoi(value); X break; X*************** X*** 426,428 **** X break; X! case EVPAGELEN: status = newsize(TRUE, atoi(value)); X break; X X--- 429,431 ---- X break; X! case EVPAGELEN: status = newsize(TRUE, dstoi(value)); X break; X*************** X*** 428,430 **** X break; X! case EVCURCOL: status = setccol(atoi(value)); X break; X X--- 431,433 ---- X break; X! case EVCURCOL: status = setccol(dstoi(value)); X break; X*************** X*** 430,432 **** X break; X! case EVCURLINE: status = gotoline(TRUE, atoi(value)); X break; X X--- 433,435 ---- X break; X! case EVCURLINE: status = gotoline(TRUE, dstoi(value)); X break; X*************** X*** 435,437 **** X break; X! case EVCURWIDTH:status = newwidth(TRUE, atoi(value)); X break; X X--- 438,440 ---- X break; X! case EVCURWIDTH:status = newwidth(TRUE, dstoi(value)); X break; X*************** X*** 449,451 **** X break; X! case EVPALETTE: strncpy(palstr, value, 48); X spal(palstr); X X--- 452,454 ---- X break; X! case EVPALETTE: xstrncpy(palstr, value, 48); X spal(palstr); X*************** X*** 452,454 **** X break; X! case EVASAVE: gasave = atoi(value); X break; X X--- 455,457 ---- X break; X! case EVASAVE: gasave = dstoi(value); X break; X*************** X*** 454,456 **** X break; X! case EVACOUNT: gacount = atoi(value); X break; X X--- 457,459 ---- X break; X! case EVACOUNT: gacount = dstoi(value); X break; X*************** X*** 456,458 **** X break; X! case EVLASTKEY: lastkey = atoi(value); X break; X X--- 459,461 ---- X break; X! case EVLASTKEY: lastkey = dstoi(value); X break; X*************** X*** 459,461 **** X case EVCURCHAR: ldelete(1L, FALSE); /* delete 1 char */ X! c = atoi(value); X if (c == '\n') X X--- 462,464 ---- X case EVCURCHAR: ldelete(1L, FALSE); /* delete 1 char */ X! c = dstoi(value); X if (c == '\n') X*************** X*** 470,472 **** X case EVPROGNAME:break; X! case EVSEED: seed = atoi(value); X break; X X--- 473,475 ---- X case EVPROGNAME:break; X! case EVSEED: seed = dstoi(value); X break; X*************** X*** 474,476 **** X break; X! case EVWLINE: status = resize(TRUE, atoi(value)); X break; X X--- 477,479 ---- X break; X! case EVWLINE: status = resize(TRUE, dstoi(value)); X break; X*************** X*** 477,479 **** X case EVCWLINE: status = forwline(TRUE, X! atoi(value) - getwpos()); X break; X X--- 480,482 ---- X case EVCWLINE: status = forwline(TRUE, X! dstoi(value) - getwpos()); X break; X*************** X*** 479,481 **** X break; X! case EVTARGET: curgoal = atoi(value); X thisflag = saveflag; X X--- 482,484 ---- X break; X! case EVTARGET: curgoal = dstoi(value); X thisflag = saveflag; X*************** X*** 492,494 **** X case EVKILL: break; X! case EVCMODE: curbp->b_mode = atoi(value); X curwp->w_flag |= WFMODE; X X--- 495,497 ---- X case EVKILL: break; X! case EVCMODE: curbp->b_mode = dstoi(value); X curwp->w_flag |= WFMODE; X*************** X*** 495,497 **** X break; X! case EVGMODE: gmode = atoi(value); X break; X X--- 498,500 ---- X break; X! case EVGMODE: gmode = dstoi(value); X break; X*************** X*** 497,499 **** X break; X! case EVTPAUSE: term.t_pause = atoi(value); X break; X X--- 500,502 ---- X break; X! case EVTPAUSE: term.t_pause = dstoi(value); X break; X*************** X*** 502,504 **** X case EVLINE: putctext(value); X! case EVGFLAGS: gflags = atoi(value); X break; X X--- 505,507 ---- X case EVLINE: putctext(value); X! case EVGFLAGS: gflags = dstoi(value); X break; X*************** X*** 505,506 **** X case EVRVAL: break; X } X X--- 508,513 ---- X case EVRVAL: break; X+ #if DOSBAK X+ case EVBACKUP: backupflag = stol(value); X+ break; X+ #endif X } X*************** X*** 511,514 **** X X! /* atoi: ascii string to integer......This is too X! inconsistant to use the system's */ X X X--- 518,521 ---- X X! /* dstoi: decimal ascii string to integer......This is too X! inconsistant to use the system's atoi function */ X X*************** X*** 514,516 **** X X! atoi(st) X X X--- 521,523 ---- X X! dstoi(st) X X*************** X*** 548,551 **** X X! /* itoa: integer to ascii string.......... This is too X! inconsistant to use the system's */ X X X--- 555,558 ---- X X! /* itods: integer to decimal ascii string.......... This is too X! inconsistant to use the system itoa function */ X X*************** X*** 551,553 **** X X! char *itoa(i) X X X--- 558,560 ---- X X! char *itods(i) X X*************** X*** 553,555 **** X X! int i; /* integer to translate to a string */ X X X--- 560,562 ---- X X! int i; /* integer to translate to a decimal string */ X X*************** X*** 666,668 **** X blen = NSTRING; X! strncpy(buf, bp->b_dotp->l_text + bp->b_doto, X blen); X X--- 673,675 ---- X blen = NSTRING; X! xstrncpy(buf, bp->b_dotp->l_text + bp->b_doto, X blen); X*************** X*** 707,709 **** X /* check for numeric truth (!= 0) */ X! return((atoi(val) != 0)); X } X X--- 714,716 ---- X /* check for numeric truth (!= 0) */ X! return((dstoi(val) != 0)); X } X*************** X*** 753,754 **** X X int abs(x) /* take the absolute value of an integer */ X X--- 760,762 ---- X X+ #if !MSC5 X int abs(x) /* take the absolute value of an integer */ X*************** X*** 760,761 **** X } X X X--- 768,770 ---- X } X+ #endif X X*************** X*** 767,768 **** X } X X X--- 776,778 ---- X } X+ X XIndex: evar.h X*** archive/evar.h Sat Dec 19 15:20:53 1987 X--- msdos/evar.h Sat Dec 19 15:21:53 1987 X*************** X*** 59,60 **** X "rval", /* child process return value */ X }; X X--- 59,63 ---- X "rval", /* child process return value */ X+ #if DOSBAK X+ "backup", /* Create .BAK files when saving */ X+ #endif X }; X*************** X*** 102,103 **** X #define EVRVAL 36 X X X--- 105,109 ---- X #define EVRVAL 36 X+ #if DOSBAK X+ #define EVBACKUP 37 X+ #endif X XIndex: exec.c X*** archive/exec.c Sat Dec 19 15:20:55 1987 X--- msdos/exec.c Sat Dec 19 15:21:55 1987 X*************** X*** 515,517 **** X } X! strncpy(eline, lp->l_text, linlen); X eline[linlen] = 0; /* make sure it ends */ X X--- 515,517 ---- X } X! xstrncpy(eline, lp->l_text, linlen); X eline[linlen] = 0; /* make sure it ends */ X*************** X*** 539,541 **** X /* debug if levels */ X! strcat(outline, itoa(execlevel)); X strcat(outline, ":"); X X--- 539,541 ---- X /* debug if levels */ X! strcat(outline, itods(execlevel)); X strcat(outline, ":"); XIndex: file.c X*** archive/file.c Sat Dec 19 15:20:56 1987 X--- msdos/file.c Sat Dec 19 15:21:56 1987 X*************** X*** 143,145 **** X X! #if MSDOS X mklower(fname); /* msdos isn't case sensitive */ X X--- 143,145 ---- X X! #if MSDOS & !MSC X mklower(fname); /* msdos isn't case sensitive */ X*************** X*** 147,148 **** X for (bp=bheadp; bp!=NULL; bp=bp->b_bufp) { X if ((bp->b_flag&BFINVS)==0 && strcmp(bp->b_fname, fname)==0) { X X--- 147,151 ---- X for (bp=bheadp; bp!=NULL; bp=bp->b_bufp) { X+ #if MSDOS & MSC /* neither are we */ X+ if ((bp->b_flag&BFINVS)==0 && strcmpi(bp->b_fname, fname)==0) { X+ #else X if ((bp->b_flag&BFINVS)==0 && strcmp(bp->b_fname, fname)==0) { X*************** X*** 148,149 **** X if ((bp->b_flag&BFINVS)==0 && strcmp(bp->b_fname, fname)==0) { X swbuffer(bp); X X--- 151,153 ---- X if ((bp->b_flag&BFINVS)==0 && strcmp(bp->b_fname, fname)==0) { X+ #endif X swbuffer(bp); X*************** X*** 455,456 **** X register int nline; X X X--- 459,463 ---- X register int nline; X+ #if DOSBAK X+ char fntemp[NFILEN], fnback[NFILEN]; X+ #endif X X*************** X*** 464,466 **** X X! if ((s=ffwopen(fn)) != FIOSUC) { /* Open writes message. */ X TTkopen(); X X--- 471,479 ---- X X! #if DOSBAK X! if (backupflag) X! s = fftopen(fntemp, fn); X! else X! #endif X! s = ffwopen(fn); X! if (s != FIOSUC) { /* Open writes message. */ X TTkopen(); X*************** X*** 479,480 **** X s = ffclose(); X if (s == FIOSUC) { /* No close error. */ X X--- 492,518 ---- X s = ffclose(); X+ #if DOSBAK X+ if (backupflag) { register char *p, *q; X+ strcpy(fnback, fn); X+ p = q = &fnback[strlen(fnback)]; X+ while (--q >= &fnback[0]) { X+ if (*q == '.') X+ p = q; X+ if ((*q == '.') X+ || (*q == '/') X+ || (*q == '\\') X+ || (*q == ':') ) X+ break; X+ } X+ strcpy(p, ".BAK"); X+ unlink(fnback); X+ #if MSC3 X+ rename(fnback, fn); X+ if(rename(fn, fntemp)) X+ #else X+ rename(fn, fnback); X+ if(rename(fntemp, fn)) X+ #endif X+ s = FIOERR; X+ } X+ #endif X if (s == FIOSUC) { /* No close error. */ XIndex: fileio.c X*** archive/fileio.c Sat Dec 19 15:20:56 1987 X--- msdos/fileio.c Sat Dec 19 15:21:56 1987 X*************** X*** 8,9 **** X #include "edef.h" X X X--- 8,12 ---- X #include "edef.h" X+ #if DOSBAK X+ #include X+ #endif X X*************** X*** 37,38 **** X #else X if ((ffp=fopen(fn, "w")) == NULL) { X X--- 40,44 ---- X #else X+ #if MSDOS X+ if ((ffp=fopen(fn, "wb")) == NULL) { X+ #else X if ((ffp=fopen(fn, "w")) == NULL) { X*************** X*** 39,40 **** X #endif X mlwrite("Cannot open file for writing"); X X--- 45,47 ---- X #endif X+ #endif X mlwrite("Cannot open file for writing"); X*************** X*** 45,46 **** X X /* X X--- 52,77 ---- X X+ #if DOSBAK X+ char *xtmpnam(p) X+ char *p; X+ { X+ static unsigned short ix = 0; X+ register unsigned short u; X+ register char *q; X+ char tmp[8]; X+ if (p == NULL) X+ if ((p = malloc(8)) == NULL) X+ return p; X+ if (++ix == 0) ++ix; X+ tmp[7] = '\0'; X+ q = &tmp[7]; X+ u = ix; X+ while (u) { X+ *(--q) = (u % 10) + '0'; X+ u /= 10; X+ } X+ return strcpy(p, q); X+ } X+ #endif X+ X+ #if DOSBAK X /* X*************** X*** 46,47 **** X /* X * Close a file. Should look at the status in all systems. X X--- 77,114 ---- X /* X+ * Open a temporary file for writing. Return TRUE if all is well, and X+ * FALSE on error (cannot create). X+ */ X+ fftopen(fn, fnpath) X+ char *fn, *fnpath; X+ { X+ char *p, *q, ch; X+ p = strrchr(fnpath, '/'); X+ q = strrchr(fnpath, '\\'); X+ if ((p == NULL) || ((q != NULL) && (q > p))) p = q; X+ q = fn; X+ if (p != NULL) { X+ while (fnpath <= p) X+ *q++ = *fnpath++; X+ } X+ else if ((fnpath[1] == ':') X+ && ((ch = toupper(fnpath[0])) >= 'A') && (ch <= 'Z')) { X+ *q++ = fnpath[0]; X+ *q++ = ':'; X+ } X+ *q = '\0'; X+ strcat(fn, "em"); X+ p = xtmpnam(NULL); X+ strcat(fn, p); X+ free(p); X+ strcat(fn, ".tmp"); X+ if ((ffp=fopen(fn, "wb")) == NULL) { X+ mlwrite("Cannot open file for writing"); X+ return (FIOERR); X+ } X+ mlwrite(fn); X+ return (FIOSUC); X+ } X+ #endif X+ X+ /* X * Close a file. Should look at the status in all systems. X*************** X*** 98,100 **** X X! #if ST520 & ADDCR X fputc('\r', ffp); X X--- 165,167 ---- X X! #if ADDCR X fputc('\r', ffp); X*************** X*** 147,149 **** X return(FIOMEM); X! strncpy(tmpline, fline, flen); X flen += NSTRING; X X--- 214,216 ---- X return(FIOMEM); X! xstrncpy(tmpline, fline, flen); X flen += NSTRING; XIndex: isearch.c X*** archive/isearch.c Sat Dec 19 15:21:01 1987 X--- msdos/isearch.c Sat Dec 19 15:21:58 1987 X*************** X*** 138,140 **** X cmd_buff[0] = '\0'; /* Init the command buffer */ X! strncpy (pat_save, pat, NPAT); /* Save the old pattern string */ X curline = curwp->w_dotp; /* Save the current line pointer */ X X--- 138,140 ---- X cmd_buff[0] = '\0'; /* Init the command buffer */ X! xstrncpy (pat_save, pat, NPAT); /* Save the old pattern string */ X curline = curwp->w_dotp; /* Save the current line pointer */ X*************** X*** 221,223 **** X n = init_direction; /* Reset the search direction */ X! strncpy (pat, pat_save, NPAT); /* Restore the old search str */ X cmd_reexecute = 0; /* Start the whole mess over */ X X--- 221,223 ---- X n = init_direction; /* Reset the search direction */ X! xstrncpy (pat, pat_save, NPAT); /* Restore the old search str */ X cmd_reexecute = 0; /* Start the whole mess over */ XIndex: line.c X*** archive/line.c Sat Dec 19 15:21:04 1987 X--- msdos/line.c Sat Dec 19 15:21:59 1987 X*************** X*** 33,35 **** X register int size; X- char *malloc(); X X X--- 33,34 ---- X register int size; X XIndex: search.c X*** archive/search.c Sat Dec 19 15:21:14 1987 X--- msdos/search.c Sat Dec 19 15:22:02 1987 X*************** X*** 1275,1277 **** X } X! strncpy(rmcptr->rstr, patptr - mj, mj); X rmcptr++; X X--- 1275,1277 ---- X } X! xstrncpy(rmcptr->rstr, patptr - mj, mj); X rmcptr++; X*************** X*** 1298,1300 **** X X! strncpy(rmcptr->rstr, patptr - mj, mj + 1); X X X--- 1298,1300 ---- X X! xstrncpy(rmcptr->rstr, patptr - mj, mj + 1); X X*************** X*** 1327,1329 **** X } X! strncpy(rmcptr->rstr, patptr - mj, mj); X rmcptr++; X X--- 1327,1329 ---- X } X! xstrncpy(rmcptr->rstr, patptr - mj, mj); X rmcptr++; X*************** X*** 1535,1537 **** X { X- char *malloc(); X X X--- 1535,1536 ---- X { X XIndex: spawn.c X*** archive/spawn.c Sat Dec 19 15:21:16 1987 X--- msdos/spawn.c Sat Dec 19 15:22:06 1987 X*************** X*** 71,73 **** X #if CPM X! mlwrite("Not in CP/M-86"); X #endif X X--- 71,73 ---- X #if CPM X! mlwrite("Not available in CP/M-86"); X #endif X*************** X*** 75,76 **** X movecursor(term.t_nrow, 0); /* Seek to last line. */ X TTflush(); X X--- 75,77 ---- X movecursor(term.t_nrow, 0); /* Seek to last line. */ X+ mlputs("\n"); X TTflush(); X*************** X*** 180,182 **** X #if CPM X! mlwrite("Not in CP/M-86"); X return (FALSE); X X--- 181,183 ---- X #if CPM X! mlwrite("Not available in CP/M-86"); X return (FALSE); X*************** X*** 186,187 **** X return(s); X movecursor(term.t_nrow - 1, 0); X X--- 187,189 ---- X return(s); X+ #if !MSDOS X movecursor(term.t_nrow - 1, 0); X*************** X*** 187,188 **** X movecursor(term.t_nrow - 1, 0); X TTkclose(); X X--- 189,191 ---- X movecursor(term.t_nrow - 1, 0); X+ #endif X TTkclose(); X*************** X*** 274,276 **** X #if CPM X! mlwrite("Not in CP/M-86"); X return (FALSE); X X--- 277,279 ---- X #if CPM X! mlwrite("Not available in CP/M-86"); X return (FALSE); X*************** X*** 280,281 **** X return(s); X movecursor(term.t_nrow - 1, 0); X X--- 283,285 ---- X return(s); X+ #endif X movecursor(term.t_nrow - 1, 0); X*************** X*** 281,282 **** X movecursor(term.t_nrow - 1, 0); X TTkclose(); X X--- 285,288 ---- X movecursor(term.t_nrow - 1, 0); X+ #if MSDOS X+ mlputs("\n"); X TTkclose(); X*************** X*** 282,283 **** X TTkclose(); X execprog(line); X X--- 288,303 ---- X TTkclose(); X+ #if MSC X+ { X+ register char *p = line; X+ while (*p && (*p != ' ') && (*p != '\t')) p++; X+ if (*p == '\0') X+ p = NULL; X+ else X+ { X+ *p++ = '\0'; X+ if (*p == '\0') p = NULL; X+ } X+ spawnlp(P_WAIT, line, line, p, NULL); X+ } X+ #else X execprog(line); X*************** X*** 283,284 **** X execprog(line); X TTkopen(); X X--- 303,305 ---- X execprog(line); X+ #endif X TTkopen(); X*************** X*** 334,336 **** X char line[NLINE]; /* command line send to shell */ X! static char bname[] = "command"; X X X--- 355,357 ---- X char line[NLINE]; /* command line send to shell */ X! static char bname[] = "command.tmp"; X X*************** X*** 345,346 **** X char *tmp; X char *getenv(); X X--- 366,368 ---- X char *tmp; X+ #if !MSC X char *getenv(); X*************** X*** 346,348 **** X char *getenv(); X- FILE *fp; X FILE *fopen(); X X--- 368,369 ---- X char *getenv(); X FILE *fopen(); X*************** X*** 349,350 **** X #endif X X X--- 370,373 ---- X #endif X+ FILE *fp; X+ #endif X X*************** X*** 356,358 **** X if ((tmp = getenv("TMP")) == NULL) X! strcpy(filnam, "command"); X else { X X--- 379,381 ---- X if ((tmp = getenv("TMP")) == NULL) X! strcpy(filnam, "command.tmp"); X else { X*************** X*** 359,361 **** X strcpy(filnam, tmp); X! strcat(filnam,"\\command"); X } X X--- 382,384 ---- X strcpy(filnam, tmp); X! strcat(filnam,"\\command.tmp"); X } X*************** X*** 364,366 **** X #if VMS X! mlwrite("Not availible under VMS"); X return(FALSE); X X--- 387,389 ---- X #if VMS X! mlwrite("Not available under VMS"); X return(FALSE); X*************** X*** 368,370 **** X #if CPM X! mlwrite("Not availible under CP/M-86"); X return(FALSE); X X--- 391,393 ---- X #if CPM X! mlwrite("Not available under CP/M-86"); X return(FALSE); X*************** X*** 487,489 **** X #if VMS X! mlwrite("Not availible under VMS"); X return(FALSE); X X--- 510,512 ---- X #if VMS X! mlwrite("Not available under VMS"); X return(FALSE); X*************** X*** 491,493 **** X #if CPM X! mlwrite("Not availible under CP/M-86"); X return(FALSE); X X--- 514,516 ---- X #if CPM X! mlwrite("Not available under CP/M-86"); X return(FALSE); X*************** X*** 689,691 **** X X! #if MSDOS & (TURBO | LATTICE | AZTEC) X /* SHELLPROG: Execute a command in a subshell */ X X--- 712,714 ---- X X! #if MSDOS & (TURBO | MSC | LATTICE | AZTEC) X /* SHELLPROG: Execute a command in a subshell */ X*************** X*** 711,713 **** X /* get name of system shell */ X! if ((shell = getenv("COMSPEC")) == NULL) { X return(FALSE); /* No shell located */ X X--- 734,738 ---- X /* get name of system shell */ X! if ((shell = getenv("SHELL")) == NULL) X! shell = getenv("COMSPEC"); X! if (shell == NULL) { X return(FALSE); /* No shell located */ X*************** X*** 724,725 **** X if (*cmd) { X strcpy(comline, shell); X X--- 749,759 ---- X if (*cmd) { X+ #if MSC X+ register char *p = comline; X+ *p++ = swchar; X+ *p++ = 'c'; X+ *p++ = '\0'; X+ return(spawnlp(P_WAIT, shell, shell, comline, cmd, NULL)); X+ } else X+ return(spawnlp(P_WAIT, shell, NULL)); X+ #else X strcpy(comline, shell); X*************** X*** 733,734 **** X return(execprog(shell)); X } X X--- 767,769 ---- X return(execprog(shell)); X+ #endif X } X*************** X*** 735,736 **** X X /* EXECPROG: A function to execute a named program X X--- 770,772 ---- X X+ #if !MSC X /* EXECPROG: A function to execute a named program X*************** X*** 835,836 **** X } X #endif X X--- 871,873 ---- X } X+ #endif X #endif XIndex: window.c X*** archive/window.c Sat Dec 19 15:21:22 1987 X--- msdos/window.c Sat Dec 19 15:22:07 1987 X*************** X*** 333,335 **** X register WINDOW *wp2; X- char *malloc(); X X X--- 333,334 ---- X register WINDOW *wp2; X SHAR_EOF if test 30655 -ne "`wc -c < 'patch.msc'`" then echo shar: error transmitting "'patch.msc'" '(should have been 30655 characters)' fi fi # end of shell archive exit 0 -- Daniel A. Norton nortond@mosys.UUCP c/o Momentum Systems Corporation ...uunet!mosys!nortond 2 Keystone Avenue Cherry Hill, NJ 08003 609/424-0734