home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / UE311C.ZIP / HISTORY.C < prev    next >
Text File  |  1991-10-30  |  85KB  |  1,751 lines

  1. /*
  2.  *    HISTORY.C:    Revision History for
  3.  *
  4.  *    MicroEMACS 3.11
  5.  *        written by Daniel M. Lawrence
  6.  *        based on code by Dave G. Conroy.
  7.  *
  8.  *    (C)Copyright 1988,1989,1990,1991 by Daniel M. Lawrence
  9.  *    MicroEMACS 3.11 can be copied and distributed freely for any
  10.  *    non-commercial purposes. MicroEMACS 3.11 can only be incorporated
  11.  *    into commercial software with the permission of the current author.
  12.  *
  13.  * REVISION HISTORY:
  14.  *
  15.  * 1.0    Steve Wilhite, 30-Nov-85
  16.  *    - Removed the old LK201 and VT100 logic. Added code to support the
  17.  *      DEC Rainbow keyboard (which is a LK201 layout) using the the Level
  18.  *      1 Console In ROM INT. See "rainbow.h" for the function key defs
  19.  *    Steve Wilhite, 1-Dec-85
  20.  *    - massive cleanup on code in display.c and search.c
  21.  *
  22.  * 2.0    George Jones, 12-Dec-85
  23.  *    - Ported to Amiga.
  24.  *
  25.  * 3.0    Daniel Lawrence, 29-Dec-85
  26.  *    - rebound keys/added new fast buffered I/O for AMIGA
  27.  *    - added META- repeat commands
  28.  *    - added reposition default to center screen (yeah!)
  29.  *    - changed exit with modified buffers message
  30.  *    - made filesave tell us what it is doing
  31.  *    - changed search string entry to terminate with <ESC>
  32.  *      so we can use <NL> in search/replace strings
  33.  *    - updated version number in mode line to 3.0
  34.  *    12-Jan-86
  35.  *    - Added code to reconize the search/replace functions
  36.  *    - Added code to perform search/replace & query functions
  37.  *    14-Jan-86
  38.  *    - moved search logic to separate function in search.c
  39.  *    - added replace and query replace functions
  40.  *    - separated out control key expansions to be used by others in search.c
  41.  *    15-Jan-86
  42.  *    - changed "visiting" to finding
  43.  *    - changed yes/no responses to not need return
  44.  *    - cleaned up various messages
  45.  *    16-jan-86
  46.  *    - fixed spurious spawn message in MSDOS
  47.  *    - added ^X-S synonym to save command
  48.  *    - moved escape to shell to ^X-C
  49.  *    21-jan-86
  50.  *    - added code to suspend shell under BSD
  51.  *    22-jan-86
  52.  *    - added function key support (SPEC) under MSDOS
  53.  *    - Abort now prints [Aborted] on message line
  54.  *    23-jan-86
  55.  *    - Added modes and commands to set/unset them
  56.  *    24-jan-86
  57.  *    - Added Goto Line command
  58.  *    - added Rename Buffer command
  59.  *    28-jan-86
  60.  *    - added goto beginning and end of paragraph commands (META-P/META-N)
  61.  *    - re-wrote kdelete to use realloc. Gained MUCH speed here when
  62.  *      doing large wipes on both UNIX and MSDOS. Changed kill buffer
  63.  *      allocation block size from 256 bytes to 1 k
  64.  *    29-jan-86
  65.  *    - moved extern function declarations to efunc.h
  66.  *    - made name[] name binding table
  67.  *    30-jan-86
  68.  *    - fixed Previous/Next paragraph command not to wrap around EOF
  69.  *    - added Fill Paragraph command (META-Q)
  70.  *    4-feb-86
  71.  *    - added code to properly display long lines, scrolling them right
  72.  *      to left
  73.  *    5-feb-85
  74.  *    - rewrote code to right/left scroll...much better
  75.  *    - added shifted arrow keys on IBMPC
  76.  *    6-feb-85
  77.  *    - add option to allow forward-word to jump to beginning of
  78.  *      next word instead of end of current one. This is different from
  79.  *      other emacs' but can be configured off in estruct.h
  80.  *    - added VIEW mode to allow a buffer to be read only
  81.  *       (-v switch on command line will activate this)
  82.  *    - changed quick exit to write out ALL changed buffers!!!
  83.  *      MAKE SURE YOU KNOW THIS WHEN META-Zing
  84.  *    10-feb-86
  85.  *    - added handling of lines longer than allowed on file read in
  86.  *      (they wrap on additional lines)
  87.  *    - made having space clear the message line and NOT insert itself
  88.  *      a configuration option in ed.h
  89.  *    11-feb-86
  90.  *    - added Describe-command and Help commands.
  91.  *    13-feb-86
  92.  *    - added View file command (^X ^V) and finished HELP command
  93.  *    14-feb-86
  94.  *    - added option to let main loop skip update if type ahead commands
  95.  *       are queued up
  96.  *    16-feb-86
  97.  *    - added Insert File command
  98.  *    17-feb-86
  99.  *    - added scroll next window up/down commands
  100.  *    18-feb-86
  101.  *    - added CMODE indentation
  102.  *    - re-arranged header files to standardize extern and global
  103.  *      definitions
  104.  *    - changed version number to 3.2
  105.  *    - added numeric arguments to search, reverse search and
  106.  *      search and replace
  107.  *    24-feb-86
  108.  *    - added Bind To Key function (^C for now) to allow the user
  109.  *      to change his command keys
  110.  *    - added Unbind key function (M-^C for now)
  111.  *    - added execute named command to execute unbound commands (M-X)
  112.  *    - added describe bindings command (not bound)
  113.  *    - changed version number to 3.3
  114.  *    25-feb-86
  115.  *    - scrapped CERROR mode (too many compilers)
  116.  *    - added EXACT mode for case sensitive searchers
  117.  *    26-feb-86
  118.  *    - added command completion on execute named command and
  119.  *      all routined grabbing a command name
  120.  *    - adding execute-command-line command and its support functions
  121.  *      (in preparation for sourcing files)
  122.  *    - added Execute Buffer command
  123.  *    27-feb-86
  124.  *    - added execute(source) file command and added code to automatically
  125.  *      execute emacs.rc (or .emacsrc on UNIX) before initial read in
  126.  *    - changed version number to 3.4
  127.  *    4-mar-86
  128.  *    - changed word delete to be consistant with word move (it gets
  129.  *      rid of the inter word space now) This is configurable with the
  130.  *      NFWORD symbol in estruct.h
  131.  *    - added B_ACTIVE entry to the buffer table. Let emacs read multiple
  132.  *      file names from the command line and only read them in as needed
  133.  *    5-mar-85
  134.  *    - rewrote command line parser to get rid of my patchy code
  135.  *    - changed version number to 3.5
  136.  *    1-apr-86
  137.  *    - added support for Aztec C 3.20e under MSDOS
  138.  *    - fixed bug in mlwrite on ADM3's and their ilk under V7
  139.  *    - added insertion of pounds in column one under CMODE
  140.  *    - changed version number to 3.6
  141.  *    3-apr-86
  142.  *    - added next-buffer command (^X-X)
  143.  *    5-apr-86
  144.  *    - added kill paragraph command (M-^W)
  145.  *    - changed fill-paragraph to leave 2 spaces after a period at the
  146.  *      end of a word.
  147.  *    - added OVERWRITE mode
  148.  *    7-apr-86
  149.  *    - fixed overwrite mode to handle tabs
  150.  *    8-apr-86
  151.  *    - added add/delete global mode (<ESC>M & <ESC> ^M) commands
  152.  *    9-apr-86
  153.  *    - added insert space command
  154.  *    - moved bindings around     ^C    insert space
  155.  *                    M-K    bind-to-key
  156.  *                    INSERT    insert space
  157.  *                    DELETE    forwdel
  158.  *    - added hunt forward and hunt reverse commands
  159.  *    10-apr-86
  160.  *    - fixed bug in DOBUF with non-terminated command string
  161.  *    15-apr-86
  162.  *    - fixed tab expansion bug in DISPLAY which hung the AMIGA
  163.  *      (sent in by Dawn Banks)
  164.  *    - fixed curcol problen if forwline/backline during keyboard
  165.  *      macro execution (sent in by Ernst Christen)
  166.  *    - added AMIGA function/cursor key support
  167.  *    - fixed nonterminating <NL> replacement bug
  168.  *    - fixed word wrapping problems
  169.  *    16-apr-86
  170.  *    - updated documentation and froze development for 3.6 net release
  171.  *    23-apr-86    version 3.6a
  172.  *    - added foreground and background colors. Setable with the
  173.  *      add mode commands for the moment
  174.  *    24-apr-86
  175.  *    - added command to pipe CLI output to a buffer
  176.  *    25-apr-86
  177.  *    - added Dana Hoggatt's code to replace Lattice's sick system()
  178.  *      function. Now we no longer care what the switchar is.
  179.  *    - cleaned up the positioning on several of the spawing commands
  180.  *    26-apr-86
  181.  *    - added an output flush in vttidy(). Unix really appreciates this.
  182.  *    - added filter-buffer (^X#) command to send a buffer through
  183.  *      a DOS filter
  184.  *    - made automatic CMODE on .c and .h file compilation dependant
  185.  *      in estruct.h
  186.  *    1-may-86
  187.  *    - optimized some code in update(). It certainly needs a lot more.
  188.  *    - added Aztec profiling capabilities. These are conditional on
  189.  *      the APROF symbol in estruct.h
  190.  *    2-may-86
  191.  *    - added (u)ndo command in query-replace. undoes last repalce.
  192.  *    6-may-86
  193.  *    - re-organized and wrote the update() function in display.c
  194.  *      Now my color hacks are in the right places and the code can be
  195.  *      understood.
  196.  *    [Released version 3.6f for BETA test sites]
  197.  *    8-may-86
  198.  *    - fixed bug in new display routine to wrap cursor on extended
  199.  *      lines at the right time
  200.  *    - modified the buffer-position command to give reasonable info
  201.  *    9-may-86
  202.  *    - improved the word wrap algorithm as not to discard non-space
  203.  *      delimiters. The backscan now looks for white space rather than
  204.  *      !inword().
  205.  *    [Released version 3.6g to Krannert]
  206.  *    10-may-86
  207.  *    - Added IBMPC.C an IBM-PC specific display driver. This makes paging
  208.  *      4-6 times faster. Also made some conditional changes to DISPLAY.C
  209.  *      to eliminate the pscreen[] if using the PC driver.
  210.  *    [changed version number to 3.6i]
  211.  *    12-may-86
  212.  *    - added delete-window (^X 0) command to dispose of a single window
  213.  *    - fixed problem with multiple prefixes from a command line which
  214.  *      was reported by John Gamble
  215.  *    14-may-86
  216.  *    - Added Aztec support for the IBMPC display driver. Had to
  217.  *      readjust some includes and defines for this.
  218.  *    - fixed bug in delete-window.
  219.  *    - fixed some bizarre behavior with the cursor after coming back
  220.  *      from spawn calls.
  221.  *    [changed version number to 3.7 freezing development for net release]
  222.  *    15-may-86
  223.  *    - (that didn't last long...) Added execute-macro-(1 thru 20) commands
  224.  *      to execute macro buffers (named "[Macro nn]")
  225.  *    - changed BFTEMP to BFINVS and cleaned up treatment of invisible
  226.  *      buffers.
  227.  *    16-may-86
  228.  *    - added store-macro (unbound) to store any executed command lines to
  229.  *      macro buffer.
  230.  *    - added clear-message-line (unbound) command to do just that
  231.  *    - added resize-window command to change a window's size to the
  232.  *      specified argument
  233.  *    - improved help's logic not to re-read the file if it was already
  234.  *      in a buffer
  235.  *    - added MAGIC mode to all structures and command tables, but the
  236.  *      regular expression code that John Gamble is writing is not ready.
  237.  *    18-may-86
  238.  *    - added interactive prompt requests in command line execution (i.e.
  239.  *      while executing a macro, a parameter starting with an at sign (@)
  240.  *      causes emacs to prompt with the rest of the parameter and return
  241.  *      the resulting input as the value of the parameter).
  242.  *    - added arguments to split-current-window to force the cursor into
  243.  *      the upper or lower window.
  244.  *    20-may-86
  245.  *    - added support for the Microsoft C compiler as per the changes
  246.  *      sent in by Oliver Sharp
  247.  *    - made some upgrades and fixes for VMS sent in by Guy Streeter
  248.  *    21-may-86
  249.  *    - fixed an Aztec bug in ttgetc by clearing the upper byte
  250.  *    - fixed buf in CMODE with #preprocesser input (bug fix submitted by
  251.  *      Willis of unknown path)
  252.  *    - added support of alternative startup file ( @<filename> ) in
  253.  *      the command line
  254.  *    - added ^Q quoting in interactive input (mltreply()).
  255.  *    - added re-binding of meta-prefix and ctlx-prefix
  256.  *    22-may-86
  257.  *    - reorganized getkey routines to make more sense and let prefix
  258.  *      binding work properly.
  259.  *    23-may-86
  260.  *    - checked new code on BSD4.2 and made a few fixes
  261.  *    - added optional fence matching while in CMODE
  262.  *    - added goto and search command line arguments by Mike Spitzer
  263.  *    26-may-86
  264.  *    - added parameter fetching from buffers
  265.  *    27-may-86
  266.  *    - fixed some HP150 bugs......
  267.  *    31-may-86
  268.  *    - Added Wang PC keyboard support from modifications by
  269.  *      Sid Shapiro @ Wang Institute
  270.  *    - Fixed some reverse video bugs with code submitted by Peter Chubb
  271.  *    - Fixed bug in nextbuffer reported by Dave Forslund
  272.  *    - added system V support (USG) from Linwood Varney
  273.  *    2-jun-86
  274.  *    - changed defines to just define one Unix define (for example,
  275.  *      just define BSD for Unix BSD 4.2)
  276.  *    - Added Incremental search functions written by D. R. Banks
  277.  *      in file ISEARCH.C
  278.  *    - added insert-string (unbound) command to help the macro
  279.  *      language out.
  280.  *    - added unmark-buffer (M-~) command to turn off the current buffers
  281.  *      change flag
  282.  *    - fixed nxtarg to truncate strings longer than asked for max length
  283.  *    4-jun-86
  284.  *    - added special characters in command line tokens. Tilde (~) is
  285.  *      the special lead-in character for "nrtb".
  286.  *    - Fixed bad ifdef in Aztec code so it could look at HOME dir
  287.  *      for startup, help, and emacs.rc files
  288.  *    6-jun-86
  289.  *    - make delete word commands clear the kill buffer if not after another
  290.  *      kill command
  291.  *    11-jun-86
  292.  *    - made ~@ in string arguments pass as char(192) to nxtarg() so one can
  293.  *      quote @ at the beginning of string arguments
  294.  *    - changed buffer size vars in listbuffers() to long (for big files)
  295.  *    - re-wrote buffer-position command to be much faster
  296.  *    12-jun-86
  297.  *    - added count-words (M-^C) command to count the words/chars and
  298.  *      lines in a region
  299.  *    - changed regions so they could be larger than 65535 (short ->
  300.  *      long in the REGION structure)
  301.  *    - changed ldelete() and all callers to use a long size. The kill
  302.  *      buffer will still have a problem >65535 that can not be solved
  303.  *      until I restructure it.
  304.  *    - grouped paragraph commands and word count together under symbol
  305.  *      WORDPRO to allow them to be conditionally made (or not)
  306.  *    13-jun-86
  307.  *    - re-wrote kill buffer routines again. Now they support an unlimited
  308.  *      size kill buffer, and are (in theory) faster.
  309.  *    - changed delete-next-word (M-D) to not eat the newline after a word,
  310.  *      instead it checks and eats a newline at the cursor.
  311.  *    17-jun-86
  312.  *    - added numeric argument to next/previous-window to access the nth
  313.  *      window from the top/bottom
  314.  *    - added support for the Data General 10 MSDOS machine
  315.  *    - added save-window (unbound) and restore-window (unbound) commands
  316.  *      for the use of the menu script. Save-window remembers which window
  317.  *      is current, and restore-window returns the cursor to that window.
  318.  *    20-jun-86
  319.  *    - fixed a bug with the fence matching locking up PASCAL NEAR the beginning
  320.  *      of a buffer
  321.  *    - added argument to update to selectively force a complete update
  322.  *    - added update-screen (unbound) command so macros can force a
  323.  *      screen update
  324.  *    21-jun-86
  325.  *    - rearranged token() and nxtarg() calls so that command names and
  326.  *      repeat counts could also be prompted and fetched from buffers
  327.  *      [this broke later with the exec re-write....]
  328.  *    - added write-message (unbound) command to write out a message
  329.  *      on the message line (for macros)
  330.  *    - changed ifdef's so that color modes are recognized as legal in
  331.  *      b/w version, and simply do nothing (allowing us to use the same
  332.  *      script files)
  333.  *    [Released version 3.7 on July 1 to the net and elswhere]
  334.  *    2-jul-86
  335.  *    - Changed search string terminator to always be the meta character
  336.  *      even if it is rebound.
  337.  *    3-jul-86
  338.  *    - removed extra calls to set color in startup code. This caused the
  339.  *      original current window to always be the global colors.
  340.  *    7-jul-86
  341.  *    - Fixed bugs in mltreply() to work properly with all terminators
  342.  *      including control and spec characters
  343.  *    22-jul-86
  344.  *    - fixed replaces() so that it will return FALSE properly on the
  345.  *      input of the replacement string.
  346.  *    - added a definition for FAILED as a return type.....
  347.  *    - changed version number to 3.7b
  348.  *    23-jul-86
  349.  *    - fixed o -> 0 problem in TERMIO.C
  350.  *    - made ^U universal-argument re-bindable
  351.  *    - wrote asc_int() for systems (like Aztec) where it acts strangely
  352.  *    - changed version number to 3.7c
  353.  *    25-jul-86
  354.  *    - make ^G abort-command rebindable
  355.  *    29-jul-86
  356.  *    - added HP110 Portable Computer support
  357.  *    - changed version number to 3.7d
  358.  *    30-jul-86
  359.  *    - Fixed a couple of errors in the new VMS code as pointer
  360.  *      out by Ken Shackleford
  361.  *    - split terminal open/close routines into screen and keyboard
  362.  *      open/close routines
  363.  *    - closed the keyboard during all disk I/O so that OS errors
  364.  *      can be respoded to correctly (especially on the HP150)
  365.  *    - changed version number to 3.7e
  366.  *    31-jul-86
  367.  *    - added label-function-key (unbound) command under symbol FLABEL
  368.  *      (primarily for the HP150)
  369.  *    4-aug-86
  370.  *    - added fixes for Microsoft C as suggested by ihnp4!ihuxm!gmd1
  371.  *        <<remember to fix [list] deletion bug as reported
  372.  *          by craig@hp-pcd>>
  373.  *    8-aug-86
  374.  *    - fixed beginning misspelling error everywhere
  375.  *    - fixed some more MSC errors
  376.  *    - changed version number to 3.7g
  377.  *    ?-aug-86 John M. Gamble:
  378.  *    - Made forward and reverse search use the same scan routine.
  379.  *    - Added a limited number of regular expressions - 'any',
  380.  *      'character class', 'closure', 'beginning of line', and
  381.  *      'end of line'.
  382.  *    - Replacement metacharacters will have to wait for a re-write of
  383.  *      the replaces function, and a new variation of ldelete().
  384.  *    - (For those curious as to my references, i made use of
  385.  *      Kernighan & Plauger's "Software Tools."
  386.  *      I deliberately did not look at any published grep or editor
  387.  *      source (aside from this one) for inspiration.  I did make use of
  388.  *      Allen Hollub's bitmap routines as published in Doctor Dobb's Journal,
  389.  *      June, 1985 and modified them for the limited needs of character class
  390.  *      matching.  Any inefficiences, bugs, stupid coding examples, etc.,
  391.  *      are therefore my own responsibility.)
  392.  *    20-aug-86 Daniel Lawrence
  393.  *    - fixed CMODE .h scanning bug
  394.  *    - changed version number to 3.7h
  395.  *    30-aug-86
  396.  *    - fixed killing renamed [list] buffer (it can't) as submitted
  397.  *      by James Aldridge
  398.  *    - Added code to allow multiple lines to display during
  399.  *      vertical retrace
  400.  *      [total disaster....yanked it back out]
  401.  *    9-sep-86
  402.  *    - added M-A (apropos) command to list commands containing a substring.
  403.  *    - fixed an inefficiency in the display update code submitted
  404.  *      by William W. Carlson (wwc@pur-ee)
  405.  *    10-sep-86
  406.  *    - added Dana Hoggatt's code for encryption and spliced it into the
  407.  *      proper commands. CRYPT mode now triggers encryption.
  408.  *    - added -k flag to allow encryption key (no spaces) in command line
  409.  *    14-sep-86
  410.  *    - added missing lastflag/thisflag processing to docmd()
  411.  *    - changed version to 3.7i and froze for partial release via mail
  412.  *      and BBS
  413.  *    05-oct-86
  414.  *    - changed some strcpys in MAIN.C to bytecopys as suggested by John
  415.  *      Gamble
  416.  *    - replaces SEARCH.C and ISEARCH.C with versions modified by
  417.  *      John Gamble
  418.  *    10-oct-86
  419.  *    - removed references to lflick....it just won't work that way.
  420.  *    - removed defines LAT2 and LAT3...the code no longer is Lattice
  421.  *      version dependant.
  422.  *    14-oct-86
  423.  *    - changed spawn so that it will not not pause if executed from
  424.  *      a command line
  425.  *    15-oct-86
  426.  *    - added argument concatination (+) to the macro parsing
  427.  *    - added [] as fence pairs
  428.  *    16-oct-86
  429.  *    - rewrote all macro line parsing routines and rearranged the
  430.  *      mlreply code. Saved 6K!!! Have blazed the path for expanding
  431.  *      the command language.
  432.  *    17-oct-86
  433.  *    - added new keyboard macro routines (plus a new level to the
  434.  *      input character function)
  435.  *    22-oct-86
  436.  *    - improved EGA cursor problems
  437.  *    - added -r (restricted) switch to command line for BBS use
  438.  *    06-nov-86
  439.  *    - fixed terminator declarations from char to int in getarg() and
  440.  *      nxtarg() in EXEC.C as pointed out by John Gamble
  441.  *    07-nov-86
  442.  *    - made wordrap() user callable as wrap-word (M-FNW) and changed
  443.  *      the getckey() routine so that illegal keystrokes (too many
  444.  *      prefixes set) could be used for internal bindings. When word
  445.  *      wrap conditions are met, the keystroke M-FNW is executed. Added
  446.  *      word wrap check/call to newline().
  447.  *    11-nov-86
  448.  *    - added and checked support for Mark Williams C 86
  449.  *    12-nov-86
  450.  *    - added goto-matching-fence (M-^F) command to jump to a matching
  451.  *      fence "({[]})" or beep if there is none. This can reframe the
  452.  *      screen.
  453.  *    - added code and structure elements to support change-screen-size
  454.  *      command (M-^S) to change the number of lines being used by
  455.  *      MicroEMACS.
  456.  *    15-nov-86
  457.  *    - finished debugging change-screen-size
  458.  *    17-nov-86
  459.  *    - Incorporated in James Turner's modifications for the Atari ST
  460.  *        23-sep-86
  461.  *        - added support for the Atari ST line of computers (jmt)
  462.  *          - added a '\r' to the end of each line on output and strip
  463.  *            it on input for the SHOW function from the desktop
  464.  *          - added 3 new mode functions (HIREZ, MEDREZ, and LOREZ);
  465.  *            chgrez routine in TERM structure; and MULTREZ define in
  466.  *            ESTRUCT.H to handle multiple screen resolutions
  467.  *    [note....ST still not running under Lattice yet...]
  468.  *    25-nov-86
  469.  *    - Made the filter-buffer (^X-#) command not work on VIEW mode
  470.  *      buffers
  471.  *    - Made the quick-exit (M-Z) command throw out a newline after
  472.  *      each message so they could be seen.
  473.  *    26-nov-86
  474.  *    - fixed a couple of bugs in change-screen-size (M-^S) command
  475.  *    - changed file read behavior on long lines and last lines
  476.  *      with no newline (it no longer throws the partial line out)
  477.  *    - [as suggested by Dave Tweten] Made adding a ^Z to the end
  478.  *      of an output file under MSDOS configurable under the
  479.  *      CTRL-Z symbol in ESTRUCT.H
  480.  *    - [Dave Tweten] Spawn will look up the "TMP" environment variable
  481.  *      for use during various pipeing commands.
  482.  *    - [Dave Tweten] changed pipe command under MSDOS to use '>>'
  483.  *      instead of '>'
  484.  *    04-dec-86
  485.  *    - moved processing of '@' and '#' so that they can be outside
  486.  *      the quotes in an argument, and added hooks to process '%' for
  487.  *      environment and user variables.
  488.  *    - modified IBMPC.C to sense the graphics adapter (CGA and MONO)
  489.  *      at runtime to cut down on the number of versions.
  490.  *    05-dec-86
  491.  *    - changed macro directive character to "!" instead of "$" (see
  492.  *      below) and fixed the standard .rc file to comply.
  493.  *    - added code to interpret environment variables ($vars). Added
  494.  *      hooks for built in functions (&func). So, to recap:
  495.  *
  496.  *        @<string>    prompt and return a string from the user
  497.  *        #<buffer name>    get the next line from a buffer and advance
  498.  *        %<var>        get user variable <var>
  499.  *        $<evar>     get environment variable <evar>
  500.  *        &<func>     evaluate function <func>
  501.  *
  502.  *    - allowed repeat counts to be any of the above
  503.  *    - added code to allow insert-string (unbound) to use its
  504.  *      repeat count properly
  505.  *    - added set (^X-A) command to set variables. Only works on
  506.  *      environmental vars yet.
  507.  *    9-dec-86
  508.  *    - added some code for user defined variables...more to come
  509.  *    - added options for malloc() memory pool tracking
  510.  *    - preliminary user variables (%) working
  511.  *    - changed terminal calls to macro's (to prepare for the new
  512.  *      terminal drivers)
  513.  *    15-dec-86
  514.  *    - changed previous-line (^P) and next-line (^N) to return a
  515.  *      FALSE at the end or beginning of the file so repeated
  516.  *      macros involving them terminate properly!
  517.  *    - added code for $CURCOL and $CURLINE
  518.  *    20-dec-86
  519.  *    - set (^X-A) now works with all vars
  520.  *    - added some new functions
  521.  *        &ADD &SUB &TIMES &DIV &MOD &NEG &CAT
  522.  *    - once again rearranged functions to control macro execution. Did
  523.  *      away with getarg()
  524.  *    23-dec-86
  525.  *    - added string functions
  526.  *        &LEFt &RIGht &MID
  527.  *    31-dec-86
  528.  *    - added many logical functions
  529.  *        &NOT &EQUal &LESs &GREater
  530.  *    - added string functions
  531.  *        &SEQual &SLEss &SGReater
  532.  *    - added variable indirection with &INDirect
  533.  *    - made fixes to allow recursive macro executions
  534.  *      (improved speed during macro execution as well)
  535.  *    3-jan-87
  536.  *    - added $FLICKER to control flicker supression
  537.  *    - made spawn commands restricted
  538.  *    - cleaned up lots of unintentional int<->char problems
  539.  *    4-jan-87
  540.  *    - Fixed broken pipe-command (^X-@) command under MSDOS
  541.  *    - added !IF  !ELSE  !ENDIF  directives and changed the
  542.  *      name of !END to !ENDM....real slick stuff
  543.  *    5-jan-87
  544.  *    - quick-exit (M-Z) aborts on any filewrite errors
  545.  *    8-jan-87
  546.  *    - debugged a lot of the new directive and evaluation code.
  547.  *      BEWARE of stack space overflows! (increasing stack to
  548.  *      16K under MSDOS)
  549.  *    - removed non-standard DEC Rainbow keyboard support...let someone
  550.  *      PLEASE implement this in the standard manner using key bindings
  551.  *      and send the results to me.
  552.  *    - added change-screen-width () command and $CURWIDTH variable
  553.  *    11-jan-87
  554.  *    - fixed an incredibly deeply buried bug in vtputc and combined
  555.  *      it with vtpute (saving about 200 bytes!)
  556.  *    16-jan-87
  557.  *    - added code to handle controlling multiple screen resolutions...
  558.  *      allowed the IBM-PC driver to force Mono or CGA modes.
  559.  *    - added current buffer name and filename variables
  560.  *      $cbufname and $cfname
  561.  *    18-jan-87
  562.  *    - added $sres variable to control screen resolution
  563.  *    - added $debug variable to control macro debugging code (no longer
  564.  *      is this activated by GLOBAL spell mode)
  565.  *    - fixed bug in -g command line option
  566.  *    - Released Version 3.8 to BBSNET
  567.  *    21-jan-87
  568.  *    - added $status variable to record return status of last command
  569.  *    2-feb-87
  570.  *    - added ATARI 1040 support...runs in all three modes right now
  571.  *    - added $palette var with palette value in it
  572.  *    - undefined "register" in BIND.C and INPUT.C for ST520 & LATTICE
  573.  *      to get around a nasty Lattice bug
  574.  *    4-feb-87
  575.  *    - added, debugged code for switching all 1040ST color modes, added
  576.  *      code for HIGH monochrome mode as well, DENSE still pending
  577.  *    5-feb-87
  578.  *    - with John Gamble, found and corrected the infamous bad matching
  579.  *      fence problems.
  580.  *    - added error return check in various add/delete mode commands
  581.  *    10-feb-87
  582.  *    - re-arrange code in docmd() so that labels are stored in
  583.  *      macro buffers
  584.  *    - fixed !RETURN to only return if (execlevel == 0) [If we are
  585.  *      currently executing]
  586.  *    14-feb-87
  587.  *    - added to outp() calls in the EGA driver to fix a bug in the BIOS
  588.  *    - adding code for 1040ST 40 line DENSE mode (not complete)
  589.  *    25-feb-87
  590.  *    - added auto-save "ASAVE" mode....variables $asave and $acount
  591.  *      control the frequency of saving and count until next save
  592.  *    - added &and and &or as functions for logical anding and oring
  593.  *    - added string length &LEN, upper and lower case string funtions
  594.  *      &LOWER and &UPPER
  595.  *    27-feb-87
  596.  *    - added $lastkey   last keystroke struck and
  597.  *        $curchar    character under cursor
  598.  *    28-feb-87
  599.  *    - added code for trim-line (^X^T) command and table entries
  600.  *      for the entab-line (^X^E) and detab-line (^X^D) commands.
  601.  *      These are conditional on AEDIT (Advanced editing) in estruct.h
  602.  *    18-mar-87
  603.  *    - finished above three commands
  604.  *    - added $version environment variable to return the current
  605.  *      MicroEMACS version number
  606.  *    - added $discmd emvironment variable. This is a logical flag that
  607.  *      indicates if emacs should be echoing commands on the command line.
  608.  *      real useful in order to stop flashing macros and .rc files
  609.  *    - added $progname environment variable. this always returns the
  610.  *      string "MicroEMACS". OEM's should change this so that macros can
  611.  *      tell if they are running on an unmodified emacs or not.
  612.  *    - fixed a minor bug in the CGA/MONO detection routine in IBMPC.C
  613.  *    20-mar-87
  614.  *    - integrated EGAPC.C into IBMPC.C and eliminated the file. Now an
  615.  *      EGA user can switch from EGA to CGA modes at will
  616.  *    - A LOT of little fixes and corrections sent in by John Ruply
  617.  *    25-mar-87
  618.  *    - Fixed buffer variables so they will work when referencing the
  619.  *      current buffer
  620.  *    26-mar-87
  621.  *    - Fixed asc_int() to be more reasonable. trailing whitespace ignored,
  622.  *      only one leading sign, no non-digits allowed after the sign.
  623.  *    - fixed buffer variables to go from the point to the end of
  624.  *      line.
  625.  *    28-mar-87
  626.  *    - fixed bugs with 8 bit chars as submited by Jari Salminen
  627.  *    - replace AZTEC/MSDOS agetc() with a1getc() which won't strip
  628.  *      the high order bit
  629.  *    30-mar-87
  630.  *    - changed list-buffers (^X^B) so that with any argument, it will
  631.  *      also list the normally invisable buffers
  632.  *    - added store-procedure and execute-procedure/run (M-^E)
  633.  *      commands to store and execute named procedures.
  634.  *    31-mar-87
  635.  *    - Fixed infinite loop in ^X-X command (when [LIST] is the
  636.  *      only buffer left) as pointed out by John Maline
  637.  *    - made filenames in getfile() always lower case as pointed
  638.  *      out by John Maline
  639.  *    2-apr-87
  640.  *    - Fixed buffer variables so they would work on non-current displayed
  641.  *      buffers. They should now work with ALL buffers....
  642.  *    3-apr-87
  643.  *    - Yanked AZTEC profiling code....not very useful
  644.  *    - Modified IBMPC driver so it will not start in EGA mode
  645.  *    - allow the next-buffer (^X-X) command to have a preceding
  646.  *      non-negative argument.
  647.  *    14-april-87: John M. Gamble
  648.  *    - Deleted the "if (n == 0) n = 1;" statements in front of the
  649.  *      search/hunt routines.  Since we now use a do loop, these
  650.  *      checks are unnecessary.  Consolidated common code into the
  651.  *      function delins().  Renamed global mclen matchlen,
  652.  *      and added the globals matchline, matchoff, patmatch, and
  653.  *      mlenold.
  654.  *      This gave us the ability to unreplace regular expression searches,
  655.  *      and to put the matched string into an evironment variable.
  656.  *      SOON TO COME: Meta-replacement characters!
  657.  *    14-apr-87 Daniel Lawrence
  658.  *    - added John Gamble's modified search.c. The code has cut apx
  659.  *      200-300 bytes off the executable.
  660.  *    - added the &RND function to generate a random integer between
  661.  *      1 and its arguments value. Also $SEED is availible as the
  662.  *      random number seed.
  663.  *    - changed the -k command line switch so if there is no argument,
  664.  *      it will prompt for one when the file is read
  665.  *    15-apr-87
  666.  *    - added 20 bytes of buffer in getval()'s local argument alloc so
  667.  *      when it returns a value, it has enough stack space to do at least
  668.  *      one strcpy() before stomping on the returned value. ALWAYS call
  669.  *      getval() ONLY from within a strcpy() call.
  670.  *    - made $curcol return a 1 based value instead of a zero based one.
  671.  *      [changed this back later for 3.8o   it was simply wrong.....]
  672.  *    16-apr-87
  673.  *    - re-wrote bytecopy() for AZTEC & MSDOS so it null terminates the
  674.  *      string.
  675.  *    - changed pipe() to pipecmd() to avoid conflicts with various
  676.  *      UNIX systems
  677.  *    24-apr-87
  678.  *    - changed open parameters on AMIGA window open to 0/0/640/200
  679.  *    25-apr-87    DML
  680.  *    - cleaned up an unneccessary if/else in forwsearch() and
  681.  *      backsearch()
  682.  *    - savematch() failed to malloc room for the terminating byte
  683.  *      of the match string (stomp...stomp...). It does now. Also
  684.  *      it now returns gracefully if malloc fails
  685.  *    [Froze and released v3.8i via BBS net]
  686.  *    14-may-87
  687.  *    - added nop (M-FNC) that gets called on every command loop
  688.  *    - added $wline, returns and sets # lines in current window
  689.  *    - added $cwline, returns and set current line within window
  690.  *    - added $target, returns/sets target for line moves
  691.  *    - added $search, returns/sets default search string
  692.  *    - added $replace, returns/sets default replace string
  693.  *    - added $match, returns last matched string in magic search
  694.  *    29-may-87
  695.  *    - rewrote word deletes to not kill trailing non-whitespace after
  696.  *      the last word. Also a zero argument will cause it to just delete
  697.  *      the word and nothing else.
  698.  *    - more fixes for the search pattern environment variables
  699.  *    30-may-87
  700.  *    - forced all windows to redraw on a width change
  701.  *    2-jun-87
  702.  *    - forced clear-message-line to overide $discmd
  703.  *    - added mlforce() routine and call it in clear-message-line,
  704.  *      write-message and when $debug is TRUE
  705.  *    - recoded the startup sequence in main()....Much Better...
  706.  *    4-jun-87
  707.  *    - forced interactive arguments ( @"question" ) to ALWAYS be echoed
  708.  *      regardless of the setting of $discmd.
  709.  *    7-jun-87
  710.  *    - started adding support for Turbo C under MSDOS
  711.  *    11-jun-87
  712.  *    - words now include ONLY upper/lower case alphas and digits
  713.  *    - fixed some more bugs with the startup..(ORed in the global modes)
  714.  *    - took more limits off the self-insert list....
  715.  *    16-jun-87
  716.  *    - macro debugging now displays the name of the current macro.
  717.  *    - fixed a problem in expandp() in search.c that kept high-byte
  718.  *      characters from working in search strings
  719.  *    18-jun-87
  720.  *    - added &sindex <str1> <str2> function which searches for string 2
  721.  *      within string 1
  722.  *    [released verion 3.8o internally]
  723.  *    19-jun-87
  724.  *    - added $cmode and $gmode to return and set the mode of the
  725.  *      current buffer and the global mode
  726.  *    - separated findvar() out from setvar() so it could be used in
  727.  *      the !LOOP directive (which got canned....read on)
  728.  *    - %No such variable message now types the name of the offending
  729.  *      variable
  730.  *    22-jun-87
  731.  *    - fixed startup bug when editing the startup file
  732.  *    - added the !LOOP <var> <label> directive
  733.  *    26-jun-87
  734.  *    - dumped !LOOP......added !WHILE. This needed and caused a vaste
  735.  *      reorginization in exec.c which mainly involved moving all the
  736.  *      directive handling from docmd() to dobuf(), in the process
  737.  *      getting rid of a lot of junk and making the result smaller
  738.  *      than it started.....(yea!)
  739.  *    - added $tpause to control the fence flashing time in CMODE.
  740.  *      The value is machine dependant, but you can multiply the
  741.  *      original in macros to stay machine independant. (as
  742.  *      suggested by Baron O.A. Grey)
  743.  *    - added hook to execute M-FNR (null) during a file read, after
  744.  *      the name is set and right before the file is read. Took out
  745.  *      any auto-CMODE code, as this is now handled with a macro.
  746.  *      (also suggested by Baron O.A. Grey)
  747.  *    - Added Baron O.A. Grey's SYSTEM V typeahead() code...I hope
  748.  *      this works....if you check this out, drop me a line.
  749.  *    - Added new variable $pending, returns a logical telling if
  750.  *      a typed ahead character is pending.
  751.  *    29-jun-87
  752.  *    - Made adjustmode() use curbp-> instead of curwp->w_bufp-> which
  753.  *      fixed some bugs in the startup routines.
  754.  *    - added $lwidth to return the length of the current line
  755.  *    2-jul-87
  756.  *    - Added &env <str> which returns the value of the environment
  757.  *      variable <str> where possible
  758.  *    - Fixed a NASTY bug in execbuf()..the buffer for the name
  759.  *      of the buffer to execute was NBUFN long, and got overflowed
  760.  *      with a long interactive argument.
  761.  *    3-jul-87
  762.  *    - Moved the loop to match a key against its binding out of execute()
  763.  *      to getbind() so it could be used later elsewhere.
  764.  *    - Added &bind <keyname> which returns the function bound to the
  765.  *      named key
  766.  *    - changed execute-file to look in the executable path first...
  767.  *    6-jul-87
  768.  *    - changed $curchar to return a newline at the end of a line and
  769.  *      it no longer advances the cursor
  770.  *    - a lot of minor changes sent by various people....
  771.  *    7-jul-87
  772.  *    - some amiga specific fixes as suggested by Kenn Barry
  773.  *    - added $line [read/write] that contains the current line in the
  774.  *      current buffer
  775.  *    - changed $curcol so setting it beyond the end of the line will
  776.  *      move the cursor to the end of the line and then fail.
  777.  *    10-jul-87
  778.  *    - added a number of fixes and optimizations along with the rest
  779.  *      of the TURBO-C support as submited by John Maline
  780.  *    13-jun-87
  781.  *    - caused dobuf() to copy lastflag to thisflag so the first
  782.  *      command executed will inherit the lastflag from the command
  783.  *      before the execute-buffer command. (needed this for smooth
  784.  *      scrolling to work)
  785.  *    - made flook() look first in the $HOME directory, then in the
  786.  *      current directory, then down the $PATH, and then in the
  787.  *      list in epath.h
  788.  *    14-jul-87
  789.  *    - added some fixes for VMS along with support for the SMG
  790.  *      screen package as submited by Curtis Smith
  791.  *    15-jul-87
  792.  *    - fixed M-^H (delete-previous-word) so it can delete the first
  793.  *      word in a file....I think there may be more of this kind of thing
  794.  *      to fix.
  795.  *    16-jul-87
  796.  *    - added code to allow arbitrary sized lines to be read from files..
  797.  *      speed up file reading in the process.
  798.  *    - made out of memory conditions safer.. especial on file reads
  799.  *    - fixed a bug in bind having to do with uppercasing function
  800.  *      key names (submitted by Jari Salminen)
  801.  *    - made ST520 exit in the same resolution that EMACS was started in
  802.  *      (for the 1040ST)
  803.  *    20-jul-87: John M. Gamble
  804.  *    - Set the variables matchlen and matchoff in the 'unreplace'
  805.  *      section of replaces().  The function savematch() would
  806.  *      get confused if you replaced, unreplaced, then replaced
  807.  *      again (serves you right for being so wishy-washy...)
  808.  *    [FROZE development and released version 3.9 to USENET]
  809.  *    {It never made it.....got killed by comp.unix.sources}
  810.  *    12-aug-87: John M. Gamble
  811.  *    - Put new function rmcstr() in SEARCH.C to create the replacement
  812.  *      meta-character array.  Modified delins() so that it knows
  813.  *      whether or not to make use of the array.  And, put in the
  814.  *      appropriate new structures and variables.
  815.  *    15-sep-87
  816.  *    - added support for Mark Williams C on the Atari ST
  817.  *    - made the MALLOC debugging package only conditional on RAMSIZE
  818.  *    - added code for flagging truncated buffers
  819.  *    23-sep-87
  820.  *    - fixed &RIGHT to return the <arg2> rightmost characters
  821.  *    - fixed a buffer in getval() to be static....things are stabler
  822.  *      now.
  823.  *    - moved all the stack size declarations to after include "estruct.h"
  824.  *      they work a lot better now....... (rather than not at all)
  825.  *    - made Atari ST spawns all work with MWshell
  826.  *    - fixed spawning on the 1040ST under MWC
  827.  *    27-sep-87
  828.  *    - added &exist function to check to see if a named file exist
  829.  *    - added &find function to find a file along the PATH
  830.  *    - added -A switch to run "error.cmd" from command line
  831.  *    - added $gflags to control startup behavior....
  832.  *    03-oct-87
  833.  *    - changed ":c\" to "c:" in epath.h for the AMIGA as suggested
  834.  *      by Tom Edds
  835.  *    - added binary and, or, and xor functions as submited by John Maline
  836.  *      (&band   &bor    and    &bxor)
  837.  *    - added binary not (&bnot) function
  838.  *    - added fixes for gotoline() and nextarg() as submited by David
  839.  *      Dermott
  840.  *    - fixed return value of $curwidth as submitted by David Dermott
  841.  *    - fixed several calls to ldelete() to have a long first argument
  842.  *      (pointed out by David Dermott)
  843.  *    - Fixed a bug in stock() which prevented uppercase FN bindings as
  844.  *      pointed out by many people
  845.  *    - changed dofile() to make sure all executed files don't conflict
  846.  *      with existing buffer names. Took out cludged code in main.c to
  847.  *      handle this problem... this solution is better (suggested by
  848.  *      Don Nash)
  849.  *    05-oct-87
  850.  *    - added in John Gamble's code to allow for a replacement regular
  851.  *      expresion character in MAGIC mode
  852.  *    [note: under MSDOS  we are still TOO BIG!!!!]
  853.  *    - added overwrite-string as a new user callable function, and
  854.  *      lowrite(c) as an internal function for overwriting characters
  855.  *    - added &xlate function to translate strings according to a
  856.  *      translation table
  857.  *    10-oct-87
  858.  *    - added code to allow emacs to clean its own buffers on exit.
  859.  *      useful if emacs is used as a subprogram. Conditional on
  860.  *      the CLEAN definition in estruct.h
  861.  *    14-oct-87
  862.  *    - swallowed very hard and switched to LARGE code/LARGE data model
  863.  *    - packaged and released version 3.9c internally
  864.  *      (MSDOS executables compiled with TURBO C Large model)
  865.  *    16-oct-87
  866.  *    - temporary fix for FUNCTION keys now includes the Meta-O sequence
  867.  *      if VT100 is definined (submited by Jeff Lomicka)
  868.  *    - an VT100 also triggers input.c to force ESC to always
  869.  *      be interpeted as META as well as the currently bound key
  870.  *    - fixed a bug in the VMSVT driver as pointed out by Dave Dermott
  871.  *    - added a size parameter to token() to eliminate problems with
  872.  *      long variable names. (as sugested by Ray Wallace)
  873.  *    18-oct-87
  874.  *    - fixed a bug in the free ram code that did not clear the buffer
  875.  *      flag causing emacs to ask for more confirnmations on the way out.
  876.  *    19-oct-87
  877.  *    - added ^X-$ execute-program call to directly execute a program
  878.  *      without going through a shell... not all environments have this
  879.  *      code completed yet (uses shell-command where not)
  880.  *    [Froze for 3.9d release internally]
  881.  *    28-oct-87
  882.  *    - added code for Atari ST DENSE mode and new bell as submited
  883.  *      by J. C. Benoist
  884.  *    - made extra CR for ST files conditional on ADDCR. This is only
  885.  *      needed to make the desktop happy...and is painful for porting
  886.  *      files (with 2 CR's) elsewhere (Also from J. C. Benoist)
  887.  *    - added optional more intellegent (and larger) close brace
  888.  *      insertion code (also from J. C. Benoist)
  889.  *    4-nov-87
  890.  *    - fixed AZTEC spawning... all MSDOS spawns should work now
  891.  *    - a META key while debugging will turn $debug to false
  892.  *      and continue execution.
  893.  *    [Froze for version 3.9e USENET release]
  894.  *    4-nov-87 Geoff Gibbs
  895.  *    - Fast search using simplified version of Boyer and Moore
  896.  *      Software-Practice and Experience, vol 10, 501-506 (1980).
  897.  *      Mods to scanner() and readpattern(), and added fbound() and
  898.  *      setjtable().  Scanner() should be callable as before, provided
  899.  *      setjtable() has been called first.
  900.  *    13-dec-87
  901.  *    - added a change to the system V termio.c code to solve a keyboard
  902.  *      polling problem, as submited by Karl Lehenbauer
  903.  *    - removed a "static" from the mod95() function declaration
  904.  *      in crypt.c to make MSC happy (by Malcolm MacNiven)
  905.  *    - added code so the new exec routines in spawn.c are working
  906.  *      under MSC (By Malcolm MacNiven)
  907.  *    - fixed the mixed space/tab entabbing bug as suggested
  908.  *      by Michal Jaegermann
  909.  *    - added the missing brace in the VT100 code in getcmd()
  910.  *      (This one was submited by many different people)
  911.  *    - added more intelligent spawning for TURBO C as submitted
  912.  *      by Bob Montante
  913.  *    - added support for the WICAT computers running under the WMCS
  914.  *      operating system as submitted by Bruce Hunsaker
  915.  *    16-dec-87
  916.  *    - re-wrote fillpara(). Its 4 times Faster!!!
  917.  *    - moved M-FNR binding to $readfile ie to make emacs execute
  918.  *      a macro when reading files:
  919.  *        set $readhook "nop"    ;or whetever
  920.  *    18-dec-1987: John M. Gamble
  921.  *    - Made replaces() beep at you and stop if an empty string is
  922.  *      replaced.  This is possible in MAGIC mode, if you pick your
  923.  *      pattern incorrectly.
  924.  *    - Fixed a subtle bug in the new Boyer-Moore routines, which caused
  925.  *      searches to fail occasionally.
  926.  *    19-dec-87
  927.  *    - new search algorithm from Geoff Gibbs, cleaned up by John Gamble.
  928.  *      its over 30 TIMES FASTER!!!! using a simplified Boyer and Moore
  929.  *      pattern search.  This effects all the but MAGIC search commands.
  930.  *    22-dec-87
  931.  *    - narrow-to-region (^X-<) and widen-from-region (^X->) allow you
  932.  *      to make all but a region invisable, thus all global commands
  933.  *      can act on a single region.
  934.  *    - a numeric argument on the select-buffer (^X-b) command makes
  935.  *      that buffer become "invisable"
  936.  *    - M-FNC becomes $cmdhook
  937.  *      M-FNW becomes $wraphook
  938.  *    23-dec-87
  939.  *    - made unmark-buffer (M-~) update the mode lines of all windows
  940.  *      pointing into the unmarked buffer
  941.  *    28-dec-87
  942.  *    - added new prefix MOUS (coded as MS-) for dealing with mice
  943.  *    29-dec-87
  944.  *    - vastly reorginized machine dependant code. Put termio.c and
  945.  *      spawn.c together and then pulled out msdos.c, unix.c, wmcs.c,
  946.  *      atari.c, amigados.c, and vms.c. These are the operating specific
  947.  *      source files now.
  948.  *    30-dec-87
  949.  *    - cleaned up msdos.c. Got rid of two unused spawn functions for
  950.  *      LATTICE. Also removed attempt to lookup SHELL variable to
  951.  *      find the command processer. This is definatly not applicable
  952.  *      here as COMSPEC should always be the name of the reloaded
  953.  *      command processor.
  954.  *    20-jan-87
  955.  *    - added Jeff Lomicka's ST mouse support and added some
  956.  *      appropriate code to input.c to support this.
  957.  *    - added buffer name completion to the select-buffer (^X-B)
  958.  *      command as submitted by Martin Neitzel.
  959.  *    - changed some function names:
  960.  *        abs    =>    absv
  961.  *        atoi    =>    asc_int
  962.  *        ltoi    =>    long_int
  963.  *        setmode =>    setmod
  964.  *        strncpy =>    bytecopy
  965.  *    25-jan-88    By Jeff Lomicka
  966.  *    - Added parsing of keypad keys, LK201 function key sequences, mouse
  967.  *      sequences (VaxStation form and BBN BitGraph form), and the cursor
  968.  *      position report to VMSVT.C.  This will require a change in the way
  969.  *      that VMS users bind functions to their function keys or keypad
  970.  *      keys.  This also defines a defacto-standard for the names of the
  971.  *      numeric keypad keys, based on the VT100 and compatible terminals.
  972.  *    - Added MOUSE.C to DESCRIP.MMS, and changed it to reference ME.OPT,
  973.  *      and to generate ME.EXE.
  974.  *    - Renamed MICROEMACS.OPT to ME.OPT so that the filename would fit
  975.  *      on smaller systems.
  976.  *    - Added capability for copy and paste from the terminal-wide
  977.  *      copy/paste buffer.  This allows copy and paste of the select region
  978.  *      from and to non-cooperating sessions in other windows.  (The
  979.  *      addition of the MOUSE handling routines disables the transparent
  980.  *      use of the VWS copy/paste mechanism.) There may be a bug in the
  981.  *      PASTE section of this code.  On some VWS systems, you may get a
  982.  *      bunch of Hex characters instead of text.  I'm looking in to finding
  983.  *      out what is really supported in the released versions of VWS.  This
  984.  *      code is conditional based on MOUSE & VMSVT.  Code was added to
  985.  *      VMSVT.C.  Added bindings for to ebind.h.  Yank is on ^X^Y.  Copy is
  986.  *      on ^XC.  If MOUSE & VMSVT is true, this binding overides the use of
  987.  *      ^XC for spanwcli.  [This won't stay.. alternative binding?]
  988.  *      Also added definitions for this to efunc.h.
  989.  *    - Added #define of CPM to estruct.h.  It is used in FILE.C.  You
  990.  *      might want to delete it again. [It was deleted..no CPM support]
  991.  *    - Added noshare attributes to all data in many modules.
  992.  *    - Re-introudced XONDATA condition that was in 3.9eJ's TERMIO.C into
  993.  *      VMS.C.  (This was overlooked by Dan in making 3.9g.)
  994.  *    - Appended a ":" to the "MICROEMACS$LIB:" path element in the VMS
  995.  *      portion of EPATH.H.
  996.  *    - Fixed mouse reports from VMSVT.C to correspond to the code in 3.9g.
  997.  *    - In INPUT.C, added VMS to list of systems that generate FN key and
  998.  *      mouse reports with leading 0 bytes.
  999.  *    - In order to accomodate callable editor support, I had to arrange
  1000.  *      so that some of the CALLED features are active all of the time,
  1001.  *      particularly EXIT HANDLING.  I changed all calls to exit() into
  1002.  *      calls to meexit().  There is a great need to divide up exits
  1003.  *      between error exits that aren't expected to return, and exits that
  1004.  *      just set the exit flag.  Places that didn't expect exit to return
  1005.  *      should be changed to return immediately after calling exit, so that
  1006.  *      the command loop can catch it and return.  This error handling
  1007.  *      business is a real mess right now.
  1008.  *    - Re-arranged main() so that most of the guts are in called
  1009.  *      routines, so that there can be more than one entry point into the
  1010.  *      program.  Note, now, the possiblity of adding recursive-edit as a
  1011.  *      function that you can call from a macro.
  1012.  *    - Added the universal symbol ME$EDIT to the VMS version as a second
  1013.  *      entry point, for use when called by MAIL and NOTES, which use
  1014.  *      LIB$FIND_IMAGE_SYMBOL and perform run-time linking with their text
  1015.  *      editor.  This stuff works great!
  1016.  *    - Changed Atari-ST makefile to link without -VGEM, so that you will
  1017.  *      get argc and argv.
  1018.  *    - Fixed ST520.C so that screen would be redrawn when we notice that
  1019.  *      desk accessories exit, and so that the mouse will be turned off
  1020.  *      when exiting into a shell (If text cursor was on, mouse is left
  1021.  *      off).
  1022.  *    - Changed ST520.C to have bindings for keypad keys, with PF1 "("
  1023.  *      key as metac, so that it can be used as GOLD prefix.    Uses GOLDKEY
  1024.  *      option in ESTRUCT.H.
  1025.  *    26-jan-88    Daniel Lawrence...
  1026.  *    - cleaned up coding in main.c
  1027.  *    - changed more function names
  1028.  *        itoa    =>    int_asc
  1029.  *        ltoa    =>    long_asc
  1030.  *    27-jan-88
  1031.  *    - added terminal initilizer string output to tcap.c as submitted
  1032.  *      by Ge' Wiejers
  1033.  *    - switched the -A command line switch to be -E the way MWC demands
  1034.  *      that it be. Also had to move -E to -C (for Change...)
  1035.  *    02-feb-88
  1036.  *    - changed META and ^X prefixes to use a new mechinism. Hitting
  1037.  *      a prefix stores it as a pending prefix.
  1038.  *    05-feb-88
  1039.  *    - changed emacs to use ^M for line terminators instead of
  1040.  *      ^J. This required LOTS of changes. Now, however, we can
  1041.  *      search for and manipulate ^M.
  1042.  *    - fixed getcmd() to work again so that describe-key and
  1043.  *      interactive binding functions work again.
  1044.  *    - added $sterm environmental variable. This hold the current
  1045.  *      value of the keystroke needed to terminate search string
  1046.  *      requests. The value in here is also automatically reset
  1047.  *      any time the meta-prefix is rebound, the the meta-prefix's value
  1048.  *    06-feb-88
  1049.  *    - fixed bug in stock().. real control characters in command lines
  1050.  *      now bind properly
  1051.  *    [BBS release of version 3.9i]
  1052.  *    23-feb-88
  1053.  *    - added buffer name completion to delete-buffer (^XK) and reorginized
  1054.  *      code their to gain back 1 K
  1055.  *    - added $modeflag to allow us to hide the modelines.
  1056.  *    - added $sscroll to allow smooth scrolling... (I don't like this
  1057.  *      but there were too many requests for it).
  1058.  *    - added $lastmesg to hold last message EMACS wrote out
  1059.  *    04-mar-88
  1060.  *    - added Alan Phillip's mods to support the VGA adapter on the
  1061.  *      IBM PS/2 machines. Modified it a little.
  1062.  *    15-mar-88
  1063.  *    - Forever twiddling with the startup code, I moved the initialization
  1064.  *      of exitflag to main() to allow a startup file to exit EMACS
  1065.  *      properly.  Also had to make meexit always return(TRUE) regardless
  1066.  *      of the exitstatus. (Ie it always works and doesn't abort the macro)
  1067.  *    17-mar-88
  1068.  *    - added code to change hard tab size with $tabsize variable
  1069.  *    - added binary search to fncmatch()
  1070.  *    28-mar-88
  1071.  *    - optimized the IBMPC version in TURBO C by supplying mixed memory
  1072.  *      mode information (NEAR and PASCAL). The executable is down to
  1073.  *      89K..but remember to name the code segment (from the options menu)
  1074.  *    1-apr-88
  1075.  *    - added remove-mark (^X<space>) to allow you to unset the mark
  1076.  *      in the current window.
  1077.  *    8-apr-88
  1078.  *    - Lots of twiddling with the mixed memory model TURBOC IBM-PC
  1079.  *      version... its 87K long now and fairly stable
  1080.  *    - changed behavior of CMODE when inserting blank lines
  1081.  *    - tightened stack usage from 32K to 20K
  1082.  *    9-apr-88
  1083.  *    - added new cinsert(). blank lines no longer confuse the CMODE
  1084.  *      indentation. Trailing white space is deleted when newline is
  1085.  *      hit in CMODE.
  1086.  *    12-apr-88
  1087.  *    - fixed long standing bug in query-replace-string. When the line the
  1088.  *      point originally starts on is extended (thus re-malloced) a '.',
  1089.  *      aborting the replace and returning to the original replace had
  1090.  *      locked things up. no more.
  1091.  *    07-may-88
  1092.  *    - fixed bug in narrow() ... it works everywhere now.
  1093.  *    [BBS release of 3.9n]
  1094.  *    3-june-88
  1095.  *    - removed restriction against deleting invisable buffers
  1096.  *    - a lot of little fixes suggested by Dave Tweten
  1097.  *    10-jun-88
  1098.  *    - added "safe save"ing as coded by Suresh Konda.
  1099.  *      (when writing a file to disk, it writes it to a temporary file,
  1100.  *       deletes the original and renames the temp file)
  1101.  *    - added $ssave flag to enable or disable safe file saving
  1102.  *    12-jun-88
  1103.  *    - added automatic horizontal window scrolling.    $hscroll (default
  1104.  *      is TRUE) controls if it is enabled. $fcol is the current first
  1105.  *      column of window in screen column one.  $hjump determines the
  1106.  *      number of columns scrolled at a time.
  1107.  *    - changed version number to 3.9o
  1108.  *    22-jun-88
  1109.  *    - made binary searches start from 0 instead of one... EMACS can
  1110.  *      find the first of many lists again.
  1111.  *    - more debugging things.  Added the dump-variable command which
  1112.  *      creates a buffer (like list-buffers does) with all the environment
  1113.  *      and user variables and their values.    Also the display (^XG)
  1114.  *      command prompts and lists the value of a variable.  These are
  1115.  *      both conditional on the DEBUGM symbol in estruct.h
  1116.  *    1-jul-88
  1117.  *    - fixed a bug in showcpos() which did not report the proper value
  1118.  *      for the current character when issued at the end of the file
  1119.  *    [Released internally as 3.9p]
  1120.  *    3-aug-88
  1121.  *    - changed keyname in stock() in bind.c to unsigned char for
  1122.  *      compilers that don't default. This allows more arbitrary
  1123.  *      rebinding. (submitor: David Sears)
  1124.  *    12-aug-88
  1125.  *    - changed wrap-word to force $fcol to 0
  1126.  *    - changed fill-paragraph (M-Q) to force $fcol to 0
  1127.  *    - added -i command line switch to initialize a variable's value
  1128.  *      for example:    emacs -i$sres VGA
  1129.  *    26-aug-88
  1130.  *    - changed code in updateline() in display.c to remove reliance
  1131.  *      on well behaved pointer subtraction (submitted by Kenneth Sloan)
  1132.  *    - fixed potential bug in fileio.c in ffgetline()
  1133.  *      (submitted by John Owens)
  1134.  *    6-sep-88
  1135.  *    - &right and &mid now check their arguments so the bytecopy can not
  1136.  *      start past the end of the string.
  1137.  *    - added $writehook to execute macroes when writing files
  1138.  *    - added $exbhook to execute macro when exiting an old buffer
  1139.  *    - added $bufhook to execute macro when entering a new buffer
  1140.  *    14-sep-88
  1141.  *    - asc_int() now ignores trailing non-digits
  1142.  *    15-sep-88
  1143.  *    - added &trim function to trim whitespace off a variable
  1144.  *    - changed message "Out of memory while inserting string" to
  1145.  *      "Can not insert string" as this error can result when the
  1146.  *      current buffer is in VIEW mode as well.
  1147.  *    - made trim-line, entab-line, and detab-line work on the
  1148.  *      current region if they have no arguments.  Also added alias
  1149.  *      trim-region, entab-region and detab-region.  The old names
  1150.  *      will hang about for a version, then dissapear.  I like the
  1151.  *      new functionality much better.
  1152.  *    25-sep-88
  1153.  *    - Inserted the macros isletter(), isuppper(), islower(), and
  1154.  *      CHCASE() whereever appropriate, replacing explicit character
  1155.  *      comparisons.    When DIACRIT is set to one, they become functions
  1156.  *      and know about the extended ascii character set.  Functions right
  1157.  *      now are in for MSDOS.C - other machines to follow.  From J. Gamble.
  1158.  *    26-sep-88
  1159.  *    - moved all text constants out to a language specific header file
  1160.  *      and left an english version of the constant in a remark at its
  1161.  *      occurence.
  1162.  *    - added $language to return the language of the current version
  1163.  *    - added elang.h to call the proper language specific module
  1164.  *    2-oct-88
  1165.  *    - removed DIACRIT conditional. Its there all the time now. Ripped
  1166.  *      the old code, and replaced it with a upcase[] and lowcase[]
  1167.  *      table.  Functions to manipulate it are now in new source file
  1168.  *      char.c and can be made conditional on system and language.
  1169.  *      Added table for extended MSDOS modeled after John Gamble's
  1170.  *      code.
  1171.  *    5-oct-88
  1172.  *    - got rid of CHCASE()..[except in the MAGIC mode search code]
  1173.  *      I ALWAYS force to upper or lower, and never simply swap.  They
  1174.  *      are now uppercase() and lowercase() in the new char.c source file.
  1175.  *    7-oct-88
  1176.  *    - added all the needed code to use TERMCAP on UNIX to interpret
  1177.  *      function and cursor keys.  A rather slimy trick involving
  1178.  *      the key timing is used, and this makes keyboard macroes
  1179.  *      a little dicy....
  1180.  *    - added the DIACRIT compilation flag back for people who
  1181.  *      want more speed in MAGIC mode.
  1182.  *    10-oct-88
  1183.  *    - as suggested by Michael Andrews, when the current buffer is
  1184.  *      in view mode, don't preallocate expansion room in new lines.
  1185.  *      (ie we aren't editing them anyway!)
  1186.  *    - added Microsoft Mouse drive... went very well. It all appears
  1187.  *      to work, just like the Atari ST mouse driver.
  1188.  *    11-oct-88
  1189.  *    - recieved and tested german.h header file from Martin Neitzel
  1190.  *      (unido!sigserv!neitzel@uunet.uu.net)
  1191.  *    15-oct-88
  1192.  *    - recieved and tested dutch.h header file from Paul De Bra
  1193.  *      (debra@research.att.com)
  1194.  *    - fixed a lot of mouse movement problems.  Dragging a mode line
  1195.  *      sideways horizontally scrolls a it's window.  Fixed positioning
  1196.  *      problems with scrolled and extended lines.
  1197.  *    - added $msflag to turn the mouse off
  1198.  *    - added $diagflag.  When set to FALSE, no diagonal movement is
  1199.  *      possible.  Vertical movement has precidence, but an explicit
  1200.  *      horizontal drag still works.
  1201.  *    - grabbing and dragging the last char of the command line allows
  1202.  *      you to resize the editing screen.  This should be tied into
  1203.  *      various windowing systems later.
  1204.  *    - write mouse-region-(down/up). See the emacs reference docs on the
  1205.  *      exact behavior of these.
  1206.  *    - deleted the old mouse-(kill/yank)-(up/down). They are
  1207.  *      redundant now, and don't work as well as mouse-region-*.
  1208.  *    2-nov-88    [changes submitted by Allen Pratt from ATARI]
  1209.  *    - created DIRSEPSTR and DIRSEPCHAR definitions for directory seperators
  1210.  *    - added TTflush in bindtokey() to force space out to terminal after
  1211.  *      binding name.
  1212.  *    - fixed a pointer casting problem in display.c involving pointer subtraction
  1213.  *    - removed the cursormove() from the beginning of mlwrite() so
  1214.  *      the cursor need not jump to the command line if the fisplay
  1215.  *      is disabled by setting $discmd to FALSE.
  1216.  *    - added >c to get a emacs command sequence and return it as
  1217.  *      a bindable string
  1218.  *    - changed scrnextup -> nextup, scrnextdn -> nextdown, and
  1219.  *      mlreplyt -> mltreply to make short symbol compilers happy.
  1220.  *    - added "print" as a synonim to "write-message".
  1221.  *    - added "source" as a synonim to "execute-file".
  1222.  *    - added a M-^X binding to the execute-command-line command
  1223.  *    4-nov-88
  1224.  *    - changed $tabsize to $hardtab. Added $softab as the current
  1225.  *      softtab size (previously only changable by the ^I (handle-tab)
  1226.  *      command.
  1227.  *    - fixed various problems in reglines() and made ^X^D (detab-region)
  1228.  *      and ^X^E (entab-region) use the current hard tab setting.
  1229.  *    - execute-command-line (M-^X) when executed within a macro line
  1230.  *      (which sounds redundent) will force all of the arguments of
  1231.  *      the executed command to be taken interactivly.  I needed this
  1232.  *      for the new macro to allow mouse functionality on the
  1233.  *      function key window.
  1234.  *    - taking Michael Andrew's suggestion to its conclusion, we no longer
  1235.  *      allocate any extra space except when inserting.  This has
  1236.  *      substantially decreased the memory usage.  Note that when
  1237.  *      we must explicitly set l_used to the proper amount since lalloc()
  1238.  *      is not responcible for the rounding up.
  1239.  *    - arranged to allow getstring() to return a NULL result.  Aborting
  1240.  *      out of an interactive prompt now will properly terminate a macro.
  1241.  *    [Released the 3.10 BETA test version...yes the ATARI version is broke]
  1242.  *    24-nov-88
  1243.  *    - fixed system V input char HOG problems as submitted by
  1244.  *      Kjartan R. Gudmundsson. Also eliminated some other 7 bit filters
  1245.  *      in unix.c at the same time.
  1246.  *    - reading function keys into table has been fixed in TCAP.C.  It will
  1247.  *      no longer attempt to strcpy NULL pointers.
  1248.  *    1-dec-88
  1249.  *    - multiple marks are now implemented. (What a task...). Set-mark
  1250.  *      (M-<space>), remove-mark (^X<space>) and exchange-point-and-mark
  1251.  *      (^X^X) all take a numeric argument from 0 to NMARKS-1 (9 now).
  1252.  *    2-dec-88
  1253.  *    - added goto-mark (M-^G) which moves the point to the requested mark.
  1254.  *    - fixed some VMS things that Curtis pointed out...
  1255.  *    - fixed bug in crypt() algorith!!!! This works properly now.  I had
  1256.  *      to add a $oldcrypt environment variable to trigger the broken
  1257.  *      behavior so people could decrypt their old files.  I will probably
  1258.  *      have to live with this.....
  1259.  *    15-dec-88
  1260.  *    - added end-of-word command to advance just past the end of a word.
  1261.  *    20-dec-88
  1262.  *    - added definitions for SUN's OS and SCO XENIX to allow us to use
  1263.  *      specific calls in those OSs for waiting and timing.
  1264.  *    - merged in XTCAP.C as submitted by Guy Turcotte into tcap.c.  This
  1265.  *      mirrors the BSD 4.3 changes for function keys for the SCO XENIX
  1266.  *      and SUN OS versions
  1267.  *    14-jan-89
  1268.  *    - added $region as a read only variable (max 128 chars) of the
  1269.  *      current region (as suggested by Allan Pratt)
  1270.  *    - changed KEYTAB structure to allow us to bind user macroes
  1271.  *      (buffers) to keys as well as C functions. Lots of changes
  1272.  *      for this.
  1273.  *    18-jan-89
  1274.  *    - finished changes for the new KEYTAB structure.
  1275.  *    - modified describe-bindings to display the bound macroes.
  1276.  *    - added arguments to nullproc() in main.c (BUG FIX!)
  1277.  *    - tried (and succeeded) in defining the pascal keyword
  1278.  *      for MSDOS & TURBO. A 2k reduction in the executable was nice.
  1279.  *    - added macro-to-key (^X^K) function to bind a macro to a key.
  1280.  *    19-jan-89
  1281.  *    - made numeric arguments to keys bound to macroes repeat those
  1282.  *      macroes n times.
  1283.  *    - modified docmd() to look for a macro name if it could not find
  1284.  *      a function name. Again a numeric leadin implies repitition.
  1285.  *    - added machine code execpr() function to the IBMPC version
  1286.  *      because under NOVELL Netware, the DOS 4B exec call does not
  1287.  *      preserve the stack on exit... thus execprog() would die.  This
  1288.  *      requires that you add execpr.obj to the make and link files!
  1289.  *      There is a symbol (NOVELL) in estruct.h to control this code
  1290.  *      being included.
  1291.  *    24-jan-89
  1292.  *    - various bug fixes and type fixes as suggested by the high C
  1293.  *      compiler on the IBM-RT
  1294.  *    1-feb-89
  1295.  *    - changed the fgetc() in unix.c to a read() under V7 and BSD so
  1296.  *      the time dependant function key checking works.
  1297.  *    - added a support for Hewlet Packard's UNIX system which
  1298.  *      is a System V with BSD 4.3 enhancements.  This is controled
  1299.  *      by the HPUX symbol in estruct.h.
  1300.  *    5-feb-89
  1301.  *    - modified mouse-region-up so right clicking down on a modeline and
  1302.  *      then releasing closes that window
  1303.  *    12-feb-89
  1304.  *    - Goaded onward by file completion code submitted by Fuyau Lin, all
  1305.  *      the completion code has been re-written and layered properly.
  1306.  *      Any OS specific driver need to now supply getffile() and
  1307.  *      getnfile() to supply a completion file list, or these can
  1308.  *      return NULL on systems where this is not possible. All this code
  1309.  *      is conditional on the COMPLET symbol in estruct.h.
  1310.  *    17-mar-89
  1311.  *    - system V code from April 1989 "C Users Journal" installed in
  1312.  *      UNIX.C. Hope this puts that problem to rest.
  1313.  *    - Jeff Lomicka fixed a lot of mousing bugs in ST520.c
  1314.  *    - Re-wrote AMIGADOS.C.  This should work properly with INTUITION
  1315.  *      and lots of windowing (resizing, mousing, etc.)
  1316.  *    - more additions for the DATA GENERAL from Doug Rady. (read
  1317.  *      the history in aosvs.c for details).
  1318.  *    - orginized the NOSHARE, VIOD and CONST keywords better.
  1319.  *    - A lot of general cleanup.
  1320.  *    [Released as version 3.10 to the world]
  1321.  *    05-may-89
  1322.  *    - installed the BRICKS revsion control system (from DATALIGHT)
  1323.  *      on my PC developmental machine.  This should make diffs possible.
  1324.  *      The installation was convoluted to to brick's inibility to
  1325.  *      use subdirectories, and implemented through a much more
  1326.  *      complex makefile.
  1327.  *    - fixed a missing structure element in line 1230 of eval.c
  1328.  *    - set attribute to clear screen to 07 in ibmeeop.  This fixes
  1329.  *      a long standing bug involving not seeing the modeline.
  1330.  *    16-may-88
  1331.  *    - a bad character in UNIX.C's code for the HPUX is fixed
  1332.  *    - a couple of header problems for HPUX fixed
  1333.  *    - a bug in EVAL.C comparing var names past 10 chars is fixed
  1334.  *    - added Dan Corkill's ISEARCH mods (see ISEARCH.C) Had
  1335.  *      to fix them to allow function keys at the end of an isearch.
  1336.  *    22-may-89 John Gamble
  1337.  *    - added $SEARCHTYPE var to determine where searches terminate.
  1338.  *        0 = forward: after string, backward: at beg of string
  1339.  *        1 = always at beginning of string
  1340.  *        2 = always character past end of string
  1341.  *      added code and vars all around for this
  1342.  *    28-may-89
  1343.  *    - finished fixing ISEARCH to properly allow function keys and
  1344.  *      mouse movement to terminate the ISEARCH.
  1345.  *    28-may-89 John Gamble
  1346.  *    - Code finally added to handle the $SEARCHPNT (nee' $SEARCHTYPE)
  1347.  *      variable.  Frankly, i think its pretty sloppy, and should
  1348.  *      be replaced by a separate function to deal with point positions.
  1349.  *      Will change it later.
  1350.  *    7-jul-89 John Gamble
  1351.  *    - A far more elegant way of dealing with $SEARCHPNT is present,
  1352.  *      more efficient in space also.  Didn't need the above mentioned
  1353.  *      point function.  Altered ISEARCH.C code to use new calling
  1354.  *      parameters in scan routines.
  1355.  *    - Got started with group structure in MAGIC mode, with alterations
  1356.  *      present in estruct.h and search.c
  1357.  *    15-jul-89 John Gamble
  1358.  *    - added $disphigh environment variable to control the escaped
  1359.  *      display of high bit set ascii characters
  1360.  *    05-aug-89 Daniel Lawrence
  1361.  *    - added to lines to lbound() so a forward search will no longer
  1362.  *      wrap around the end of the buffer if the point was at the end.
  1363.  *    - widen-from-region (^X>) preserves the point and marks if they
  1364.  *      were at the end of the fragment, instead of moving them to
  1365.  *      the end of the buffer.
  1366.  *    - fixed bug in comp_file() to allow up to 128 char files specs
  1367.  *      instead of 32 chars.
  1368.  *    - patched some bugs in the TIPC version.  It runs again, but
  1369.  *      without a mouse and color and reverse video.  The TIPC I had
  1370.  *      to test on was a weird mono one....
  1371.  *    - released 3.10a to the BBS for TIPC users
  1372.  *    05-aug-89 John Gamble
  1373.  *    - refolding and shoving a lot has managed to knock about 300
  1374.  *      bytes of code out of search.c and isearch.c.  Also the some of
  1375.  *      the various commands in an isearch now shadow their bigger
  1376.  *      counterparts.
  1377.  *    - fixed the tab bug in entab-line (^X-^E) which munged lines.
  1378.  *    15-aug-89 Daniel Lawrnece
  1379.  *    - added append-file (^X^A) command to append a buffer on the
  1380.  *      end of a file
  1381.  *    [released 3.10b to Krannert.....]
  1382.  *    20-aug-89 Daniel Lawrence
  1383.  *    - The quote character is now treated as the abort and universal-
  1384.  *      argument characters are: only one key may be bound to it at
  1385.  *      a time.
  1386.  *    9-sep-89
  1387.  *    - a bug in msdos.c prevented the proper binding of ALT-0 on the
  1388.  *      IBMPC. Fixed this as pointed out by Rik Faith.
  1389.  *    17-sep-89 John M. Gamble
  1390.  *    - Isearch now understands alternatively bound keys.
  1391.  *      One change had to be made to ebind.h and input.c, to handle
  1392.  *      the delete-previous-character command.  The delete character
  1393.  *      is now represented internally as CNTL|'?', instead of 0x7F.
  1394.  *      Changes made to handle this are in ebind.h and input.c.
  1395.  *    16-dec-89
  1396.  *     - Incorporated Kevin Mitchell's VMS improvements.  Using the
  1397.  *       native RMS file I/O, and native memory memory routines
  1398.  *       GREATLY speeds up file and buffer manipulation.
  1399.  *    17-dec-89
  1400.  *    - updated the HP150.C file to work with the new style I/O layers.
  1401.  *      hp150 version now works properly.
  1402.  *    25-jan-90
  1403.  *    - dumped a lot of the old choice symbols in estruct.h for some
  1404.  *      things which have either never been used, or have clearly
  1405.  *      superior versions now.
  1406.  *    - removed the WORDPRO and AEDIT symbols.... all this code is
  1407.  *      always in now.  (it never made much of a size difference anyway)
  1408.  *    - modified sources to allow them to use new ANSI style prototypes.
  1409.  *      (this was a lot of work....)
  1410.  *    - in the process, fixed bug where EMACS probably grew confused
  1411.  *      when setting $curchar to a newline.
  1412.  *    26-jan-90
  1413.  *    - replaced old file completion code with version by Michael J. Arena
  1414.  *      It allows us to partially complete directory names on UNIX.
  1415.  *    - modified getffile in MSDOS.C to return directory names as well
  1416.  *      so it can work with the above mod.  I need to do this mod on
  1417.  *      all OSs which will support it.
  1418.  *    - added support for the Supermax UNIX system as submitted by
  1419.  *      Michael Hillerstrom.
  1420.  *    - fixed a couple of OS2 bugs having to do with key input as submitted
  1421.  *      by Sugih Jamin
  1422.  *    - fixed three bugs posted by Kieth Jones (in display.c and eval.c)
  1423.  *    - let the TURBO C MSDOS version use the bios instead of DOS for
  1424.  *      keybord input as submitted by David R. Kohr.  This should solve
  1425.  *      problems with TSRs like Sidekick that break rules.
  1426.  *    - fixed a bug in MSDOS.C's getffile involving how the filename was
  1427.  *      parsed.  Paths including ".." now can expand properly.
  1428.  *    [Released version 3.10e to USENET]
  1429.  *    - changed version number to 3.10f
  1430.  *    15-feb-90
  1431.  *    - added $lterm variable to allow emacs to write non-standard line
  1432.  *      terminators on output.  Set to "" it uses standard terminators.
  1433.  *    - forced ffgetline() to trim trailing line terminators on reading
  1434.  *      this allows us to read strange files more robustly.
  1435.  *    - removed the ADDCR option as the var above can do it
  1436.  *    17-mar-90
  1437.  *    - John Gamble found and fixed a bug in the binding code erroneously
  1438.  *      searching for a particular empty slot.
  1439.  *    22-mar-90
  1440.  *    - changed line buffer allocation scheme during file reading to
  1441.  *      use realloc() and always double the buffer size.  Much faster
  1442.  *      on long line reads. 
  1443.  *    01-may-90
  1444.  *    - added code to allow SUN verion to work properly
  1445.  *    - added .xlk style file locking for unix systems
  1446.  *    10-may-90
  1447.  *    - added NEC 9801 hardware driver.  There is no background color
  1448.  *      implimented yet as this will involve using the graphic planes
  1449.  *      to simulate a backgound color.
  1450.  *    25-may-90
  1451.  *    - added DBCS (Double Byte Character Set) symbol to estruct.h and
  1452.  *      also much conditional code to handle display and editing of
  1453.  *      DBCS chars.  This code is active in the NEC version, using
  1454.  *      japanese KANJI characters.
  1455.  *    - added REP (replace) mode. Very similar to OVER mode except
  1456.  *      tabs and 2 byte characters are handled differently.
  1457.  *    6-jun-90
  1458.  *    - modified ansi.c into fmr.c for the Fujitsu FMR-70 series
  1459.  *      msdos machines.  Extensive modifications to msdos.c were
  1460.  *      needed to accomodate this machine. 
  1461.  *    16-jun-90
  1462.  *    - modified swbuffer() to not check locks on an inactive buffer
  1463.  *      in view mode.  This allows the -v switch to work from the
  1464.  *      command line on a file whose directory the user has no
  1465.  *      write access to.
  1466.  *    28-jun-90
  1467.  *    - added background colors to the FMR driver utilizing the
  1468.  *      graphics planes via the GDS driver.
  1469.  *    30-jun-90
  1470.  *    - added $wchars, a list of characters considered "in a word".
  1471.  *      An empty value sets this to its default of alphas, numbers
  1472.  *      and the underscore (_) character.
  1473.  *    5-jul-90
  1474.  *    - re-arranging code to vector all pop up windows through on
  1475.  *      function for display.
  1476.  *    - fixed bug in positioning of file name in buffer list
  1477.  *    6-jul-90
  1478.  *    - added ability to pop up temporary windows.  Environment variable
  1479.  *      $popval gives the old behavior when FALSE and the new behavior
  1480.  *      when TRUE.
  1481.  *    - added pop-buffer function to allow user to pop up the contents
  1482.  *      of a buffer.
  1483.  *    27-jul-90
  1484.  *    - fixed up the OS2 code back into working.  Wrote getffile()
  1485.  *      and getnfile() to allow it file name completion.
  1486.  *    27-jul-90 John M. Gamble
  1487.  *     - Magic mode characters '+' and '?' added, respectively meaning
  1488.  *    "one to many" and "zero to one (or, optional)".
  1489.  *    12-oct-90
  1490.  *    - A BAD bug in vteeol() hung the machine during the redraw.  Vtcol
  1491.  *    was not getting incremented when the screen was scrolled horizontally.
  1492.  *    26-nov-90
  1493.  *    - conditionalized code in MSDOS.C using the BIOS to not be used when
  1494.  *    compiled for the HP150.  (It's bios is different, of course)
  1495.  *    15-jan-91
  1496.  *    - in linstr() made an non-positive number of inserted characters
  1497.  *      illegal, causing the linstr to return FALSE on negative and
  1498.  *      TRUE on zero... but not changing the text
  1499.  *    15-jan-91
  1500.  *    - rewrote dolock.c to generalize it. it now supports MSDOS and SUN
  1501.  *      the SUN code should work on other UNIXs, but needs confirmation
  1502.  *    17-jan-91  John Gamble
  1503.  *    - removed references to DIACRIT
  1504.  *    - added the $yankpnt variable.
  1505.  *    21-jan-91  Daniel Lawrence
  1506.  *    - adding OS2 support for file locking
  1507.  *    07-mar-91
  1508.  *    - added the concepts of SCREENs.  Each screen is a separate list
  1509.  *      of windows which overlay on text based systems.
  1510.  *
  1511.  *    New commands:
  1512.  *      next-screen        (A-N) switch to the following screen
  1513.  *      previous-screen    (A-P) switch to the previous screen
  1514.  *      find-screen        (A-F) switch or create a named screen
  1515.  *      delete-screen        (A-D) delete the named screen
  1516.  *      list-screens        (A-B) how list of screens
  1517.  *
  1518.  *    New variables:
  1519.  *      $scrname        name of the current screen
  1520.  *      $scrnum        ordinal number of the current screen
  1521.  *
  1522.  *    Most of the code for this is in the new source file SCREEN.C
  1523.  *
  1524.  *    11-mar-91    Code from or suggested by Michael C. Andrews
  1525.  *    - getstring() now accepts ^K to return a non-default empty
  1526.  *      result. (to allow for NULL replace strings!)
  1527.  *    - added indent-region [M-)] and undent-region [M-(]
  1528.  *    - added &ISNum function to test variables for being numeric
  1529.  *    - added $curwind and $numwind to give the current ordinal and total
  1530.  *      number of windows on the current screen
  1531.  *    12-mar-91    Daniel Lawrence
  1532.  *    - checked and fixed code for IBMPC MicroSoft C 5 and 6 compilers
  1533.  *    15-mar-91    Curtis Smith
  1534.  *    - masked the number generated by ernd in writeout() to limit it
  1535.  *      to 5 digits so that MPE won't barf on a too long file name
  1536.  *      for the temporary file
  1537.  *    19-mar-91    Daniel Lawrence
  1538.  *    - added code to parse drive letters to dolock()/undolock()
  1539.  *      MSDOS is happier.
  1540.  *    - changed search order of files to look in current directory
  1541.  *      before HOME and PATH dirs.
  1542.  *    24-mar-91
  1543.  *    - command file names default to a .cmd extention from the command
  1544.  *      line and from the source command.
  1545.  *    [released BETA version 3.11]
  1546.  *    02-apr-91
  1547.  *    - neglected to decrement buffer use counts in free_screen()
  1548.  *      These are now fixed, so delete-screen is again safe.
  1549.  *    19-apr-91 John M. Gamble
  1550.  *    - Made a couple of functions, cclmake() in particular, more efficient.
  1551.  *      Saved a hundred bytes or so, which were immediately used up by:
  1552.  *    - Groups!  Groups are now available in MAGIC mode! (hurrah).
  1553.  *    - Fixed bug where $match would get set with the wrong characters
  1554.  *      if searching backwards.
  1555.  *    - also declared as VOID the VOID functions in search.c.  Should
  1556.  *      get nattered at less often now.
  1557.  *    23-apr-91 Daniel Lawrence
  1558.  *    - namebuffer() was only updating the current modeline. It needed to
  1559.  *      update all of them in case the current buffer was in multiple
  1560.  *      windows. This bug was pointed out by Martin Shultz.
  1561.  *    - added code from Floyd Davidson for new backward kill behavior. This
  1562.  *      is under the NEWKILLB symbol and is for evaluation.
  1563.  *    24-apr-91
  1564.  *    - John Gamble points out that local variable "ap" in mlwrite() can
  1565.  *      not be register type. Fixed this.
  1566.  *    - as reported by Martin Shultz, tabs caused problems in OVERwrite
  1567.  *      mode since the logic for determining to delete or not was based
  1568.  *      on offset into the line rather than column. Preceding tabs
  1569.  *      confused this. I changed the offset reference (in main.c) to a
  1570.  *      reference to the getccol() function and all is well.
  1571.  *    - Risto Kankkenun pointed out a problem in the input handling of
  1572.  *      any completion command... it did not handle function keys well,
  1573.  *      and blocked some normal keys from being used. Inputing an
  1574.  *      extended character in complete() and then translating it to a
  1575.  *      standard ascii char let us correct this.
  1576.  *    - Risto also points out a one character difference between word
  1577.  *      wrapping and paragraph filling. Changed a couple of >= to > in
  1578.  *      reform() in word.c to correct this.
  1579.  *    27-apr-91  John Gamble
  1580.  *    - Oops.  In changing the closure code, so that groups and closure
  1581.  *      could be used together, i broke closure.  Argh.  Fixed now.
  1582.  *    - Added the &GROUP function, so that macro writers could get at
  1583.  *      the substrings matched by groups in a MAGIC search.
  1584.  *    - Since $yankpnt is a Boolean type now, changed its name to
  1585.  *      $yankflag.
  1586.  *    - Altered the broadcast message interceptor code in VMS.C.  Instead
  1587.  *      of using a %variable to hold the message, which was not large
  1588.  *      enough, the message(s) are stashed away in a buffer.  Added a
  1589.  *      global boolean variable pending_msg, which Dan will use to notify
  1590.  *      the user of an intercepted message.
  1591.  *    1-may-91  Daniel Lawrence
  1592.  *    - the backward kill code was very interesting.... but did not update
  1593.  *      the $kill variable (via getkill() in eval.c) and caused all sorts
  1594.  *      of interesting sideffects when the clear kill buffer code was not
  1595.  *      updated either. I refigured the algorithm to use the current kill
  1596.  *      blocks, growing them backwards as needed. Recoding this, it all
  1597.  *      works properly now, allowing negative kills and proper behavior
  1598.  *      when mixing various consective forward and backward kills. This
  1599.  *      new code is smaller and involved less changes.
  1600.  *    2-may-91
  1601.  *    - changed some WFHARDs to WFMOVEs in basic.c for gotobob() and
  1602.  *      gotoeob() as suggested by Risto Kankkunen
  1603.  *    - removed a call to turn break off under MSDOS in ibmkopen()
  1604.  *      in ibmpc.c to answer a observation from John A Steele
  1605.  *    - changed some file names. ATARI.C => TOS.C   ST520.C => ST52.C
  1606.  *      to more accurately reflect the OS and screen code for the ATARI
  1607.  *    - made a lot of changes in TOS.C as specified by Allan Pratt
  1608.  *    - fixed setkey() to not choke on undefined functions
  1609.  *    11-jun-91
  1610.  *    - added in support for LATIN as submited by Anthony Appleyard
  1611.  *    - cause the prompt for search patterns to show the current search
  1612.  *      terminator
  1613.  *    23-jun-91
  1614.  *    - in BASIC.C in gotobop/eop() changed some offests to zero constants
  1615.  *      speeding things up.
  1616.  *    - also added $scribe so I can add in scribe specific formatting
  1617.  *      features, like deciding @commands at the begining of lines delimit
  1618.  *      paragraphs.
  1619.  *    26-jun-91    John Gamble
  1620.  *    - added check for isearch and risearch binding in the incremental
  1621.  *      search commands, as suggested by ???.
  1622.  *    - Put in new text strings from search.c into the <language>.h files.
  1623.  *    - Removed the code in BIND.C which checked for the .rc file in the
  1624.  *      current directory before checking HOME.  This was dangerous in a
  1625.  *      multi-user environment.  Change the HOME variable if you want to
  1626.  *      use a different set of .rc and .cmd files.
  1627.  *    10-jun-91    Daniel Lawrence
  1628.  *    - dumped $scribe. Instead we are adding features to handle any
  1629.  *      formatter of that style. $fmtlead lists all formatter command
  1630.  *      leadin characters. $paralead lists all paragraph start charaters.
  1631.  *    - changed a check in setvar() to allow an interactive input value
  1632.  *      to be just the <NL>, allowing you now to interactively set
  1633.  *      a variable to being empty. ^G still aborts the set.
  1634.  *    17-jun-91
  1635.  *    - a missing parenthesis in a conditional in cinsert() sometimes
  1636.  *      caused a problem when strinking return in CMODE
  1637.  *    24-jul-91
  1638.  *    - changed a write in ttflush() to go to stdout instead of stdin
  1639.  *    18-aug-91
  1640.  *    - replaced tipc.c driver and made minor accomodations to many files
  1641.  *      for support of memory mapped TIPC driver under Zortech C as supplied
  1642.  *      by Ron Lepine
  1643.  *    - added code to msdos and OS/2 to recognize F11, F12 and application
  1644.  *      keypad as seperate, bindable keys. Submitted by Jon Saxton
  1645.  *    2-Sep-91
  1646.  *    - made some minor changes for OS/2 submitted by John Ladwig
  1647.  *    4-Sep-91
  1648.  *    - made a lot of adjustments to the new keyboard.c file for recognizing
  1649.  *      IBMPC extended keys. I think most of its keys are now mapped in all
  1650.  *      modes which the BIOS will recognize under both MSDOS and OS/2.
  1651.  *    6-Sep-91 John M. Gamble
  1652.  *    - changed the outer while loop of scanner() to a if/do-while
  1653.  *      combination.  This allowed the removal from the inner loop of an if
  1654.  *      statement that was returning a constant value.  Speeds up searches
  1655.  *      noticably.
  1656.  *    - reverse searching in fbound() was using matchlen as a jump increment.
  1657.  *      This causes reverse-search to fail if we had just removed MAGIC mode,
  1658.  *      since matchlen may be different from the pattern length, causing the
  1659.  *      search to fail.  Changed to (patlenadd + 1).
  1660.  *    - Code which stored away the previous match before saving the current
  1661.  *      match is moved to the replaces() function where it belongs.  Less
  1662.  *      work for simple searches.  Also changed the free()/malloc()
  1663.  *      combinations to simple realloc() calls - much neater.
  1664.  *    - Putting the "next character" calls in the correct place in amatch()
  1665.  *      meant that i could get rid of all the special checking for BOL and
  1666.  *      EOL characters.  Saved much code space that way.
  1667.  *    - Fixed the fence flashing bug where the cursor failed to flash back
  1668.  *      to a fence which was the first character in a buffer.  Simple matter
  1669.  *      of moving the forward/backward cursor calls in the right place.
  1670.  *    - New function regtostr() is what is called now to save matches, group
  1671.  *      matches, set $region, etc.  Space saver, faster.
  1672.  *    7-Sep-91 John M. Gamble
  1673.  *    - Changed the realloc()s back to free()/malloc() combinations.
  1674.  *      There are still compilers out there who do not have ANSI C
  1675.  *      functions, like certain UNIX systems, which used to be on the
  1676.  *      cutting edge, but are now warts.  Arghhh.
  1677.  *    - Fixed a group length problem, when matchlen was getting added
  1678.  *      more than once (closure again).  New group_length array fixes
  1679.  *      that.
  1680.  *    12-Sep-91 Daniel Lawrence
  1681.  *    - fixed setting of $cbflags, changing mask from BFCHG&BFINVS to
  1682.  *      BFCHG|BFINVS, letting it work as suggested by John Gamble
  1683.  *    14-Sep-91
  1684.  *    - fixed a bug in the mouse handling in mouseline() which prevented
  1685.  *      us from positioning the mouse on the last line of the window when
  1686.  *      $modeflag was set to FALSE
  1687.  *    15-Sep-91
  1688.  *    - In frustration from the new help system crashing and leaving me
  1689.  *      unable to comunicate visibly with the command like, emacs now
  1690.  *      sets $discmd and $disinp to TRUE whenever it goes to fetch an
  1691.  *      interactive command. Delete the assignment in execloop() if this
  1692.  *      gets in the way
  1693.  *    21-Sep-91
  1694.  *    - the new code for decoding the AT keyboard fails real poorly on an
  1695.  *      XT or earlier style machine. When ATKBD is enabled, if the call
  1696.  *      fails the first time, emacs automatically switched to using the
  1697.  *      old style (not that old really) BIOS calls for input.
  1698.  *    5-Oct-91
  1699.  *    - two new variables, $orgrow and $orgcol, and two new function
  1700.  *      change-screen-row and change-screen-column, all you to change
  1701.  *      the upper left corner of emacs' screen on the physical screen.
  1702.  *      You must resize the screen smaller than default before this
  1703.  *      will work.
  1704.  *    - screen resolution changes on the IBMPC force the screen back
  1705.  *      to the upper left corner. This may change in the future.
  1706.  *    8-Oct-91
  1707.  *    - size and position of screen maintained in the SCREEN structure
  1708.  *      so switching screen resets these.
  1709.  *    - Mousing code now switches screens if mouse is used outside of
  1710.  *      current screen.
  1711.  *    9-Oct-91
  1712.  *    - Switching screen deactivates modeline of outgoing screen.
  1713.  *    - Screen list now orginized front->back instead of alphabetically
  1714.  *    - dumped $scrnum as it changes dynamically and is not very usefull
  1715.  *    - replaces next-screen and previous-screen with cycle-screens (A-C)
  1716.  *      which brings the rearmost screen to front. Mousing to a window
  1717.  *      now operates in front to back order! screen.c is smaller!
  1718.  *    11-Oct-91
  1719.  *    - added logic to refresh screens when sizing down or moving screen
  1720.  *    - added $deskcolor var to hold color desktop should be cleared to
  1721.  *    - added TERM structure entry .t_clrdesk as a ptr to function to
  1722.  *      clear the desktop when redrawing windows
  1723.  *    15-Oct-91
  1724.  *    - added code to ibmpc version to properly track screen resolution
  1725.  *      changes. If a screen is the size of the desktop at resolution change
  1726.  *      time, it is resized to the new desktop size.
  1727.  *    16-Oct-91
  1728.  *    - noticed the wrong character set when returning from VGA12 mode
  1729.  *      on the ibmpc. Added code to fix this in egaclose() in ibmpc.c
  1730.  *    21-oct-91
  1731.  *    - added code in IBMPC output routine to interpret char 7 as a beep
  1732.  *    25-oct-91
  1733.  *    - added ability of macro to suppress screen redraw by setting second
  1734.  *      bit in $gflags... like after a shell-command that doesn't output
  1735.  *    30-oct-91
  1736.  *    - added ability to set any $...hook variable to a named procedure
  1737.  *      as well as a built in command.
  1738.  *    - modified the standard startup file EMACS.RC to use named procedures
  1739.  *      rather than numbered macroes for all its internal functions.
  1740.  *    - Modified manual to emphisize the use of named procedures rather
  1741.  *      than the execute-macro-<n> commands which I am trying to phase out.
  1742.  *    31-oct-91
  1743.  *    [RELEASED version 3.11 for general distribution]
  1744.  */
  1745.  
  1746. history()
  1747.  
  1748. {
  1749.     /* this is here to keep compilers from complaining... it's not needed */
  1750. }
  1751.