home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Interactive Guide / c-cplusplus-interactive-guide.iso / c_ref / csource3 / 133_01 / e.doc < prev    next >
Encoding:
Text File  |  1979-12-31  |  49.6 KB  |  1,261 lines

  1. The  e   screen editor                             Page 1
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.                                      
  13.                                   eeeee      
  14.                                  ee    ee 
  15.                                 ee      ee
  16.                                eeeeeeeeeee
  17.                                ee         
  18.                                 ee        
  19.                                  eeeeeeeee
  20.  
  21.  
  22.                   TUTORIAL GUIDE AND IMPLEMENTATION MANUAL
  23.  
  24.  
  25.  
  26.  
  27.  
  28. The   e   screen  editor  is full-screen editor designed  for  creating  and 
  29.  
  30. modifying the source text of programs.  It is not, and it is not intended to 
  31.  
  32. be, a word processor.
  33.  
  34.  
  35.  
  36.  
  37.  
  38. It is released through the C Users Group for private non-profitmaking use by
  39.  
  40.                               G. Nigel Gilbert
  41.                                  MICROLOGY
  42.  
  43.  
  44.  
  45.  
  46.                         Version 4.8     October 1984
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73. The  e   screen editor                             Page 2
  74.  
  75.  
  76. Contents
  77.  
  78. 1.   Prerequisites
  79.  
  80. 2.   Introduction
  81.  
  82. 3.   Development history
  83.  
  84. 4.   Why  e  was written
  85.  
  86. 5.   How  e  works
  87.  
  88. 6.   Using  e
  89.  
  90. 7.   Implementing  e  on your terminal
  91.  
  92. 8.   Changing the default settings of the options
  93.  
  94. 9.   Compiling and loading  e
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.                               1. Prerequisites
  104.  
  105. The  editor is written in the programming language C and the source code  is 
  106.  
  107. available  in the public domain for non-profit use.   It is recommended that 
  108.  
  109. you also have to hand a copy of the BDS C compiler,  version 1.50 or  later, 
  110.  
  111. if  you need to reconfigure the editor to suit your terminal and your choice 
  112.  
  113. of default option settings.
  114.  
  115. The  editor can be configured simply to run under CP/M with  any  moderately 
  116.  
  117. sophisticated  terminal.   The  following screen control functions  must  be 
  118.  
  119. available  with the terminal:  clear to end of line,  clear to end of  page, 
  120.  
  121. line insert, and line delete.  It is probably not worth using or adapting  e  
  122.  
  123. to run on terminals that do not support these functions (among the terminals 
  124.  
  125. which  DO support these functions are:  the TVI  910,  912,  920,  925,  950 
  126.  
  127. series,  Hazeltine 1420,  1500, Executive and Esprit series, ADM-31 (but not 
  128.  
  129. the  ADM-3a),  DEC VT52 and VT100,  ADDS range,  Visual 50 and 55 and  other 
  130.  
  131. terminals which offer emulations of these).
  132.  
  133. Also required is CP/M,  version 2, or CP/M 3.1 (CP/M Plus), and at least 48K 
  134.  
  135. (and preferably 56K) of RAM.  Other versions of CP/M might well do.
  136.  
  137.  
  138.  
  139.                               2. Introduction
  140.  
  141. This document has sections on:
  142.  
  143.      the  'philosophy'  of e - why it was written to work the  way  it  does 
  144.  
  145.           (sections 3, 4 and 5)
  146.      using e (section 6)
  147.      implementing  e (sections 7, 8, and 9)
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158. The  e   screen editor                             Page 3
  159.  
  160.  
  161.  
  162.  
  163.  
  164.                            3. Development history
  165.  
  166. e was written over a period of about two years to satisfy my own need for  a 
  167.  
  168. decent  screen editor to use for programming,  primarily in C,  but also  in 
  169.  
  170. FORTRAN  and Pascal.   During that time,  it has developed and  changed.   I 
  171.  
  172. expect  that it will continue to do so,  and hope that other users will keep 
  173.  
  174. in contact with me about what they think of it, what changes they make to it 
  175.  
  176. and how it could be improved.  
  177.  
  178. I can be contacted at:
  179.  
  180.           G. Nigel Gilbert
  181.           MICROLOGY
  182.           4 Deanery Road
  183.           Godalming GU7 2PQ
  184.           Surrey
  185.           England
  186.  
  187.  
  188.  
  189.                            4. Why  e was written 
  190.  
  191. The design of e was determined largely by my own specific needs.   I already 
  192.  
  193. possessed  a  copy  of  WordStar,  the  well-known,  massive  and  generally 
  194.  
  195. excellent  word processing package.    I also possessed a copy of the  well-
  196.  
  197. known and entirely excellent BDS C compiler.   Unfortunately, the two do not 
  198.  
  199. mesh well together.  In practice, programming in C (or in any other compiled 
  200.  
  201. language)  requires  one to edit a program file,  run the file  through  the 
  202.  
  203. compiler,  locate  errors,  then re-edit the file to make  corrections,  and 
  204.  
  205. repeat all this a large number of times.   The faster the cycle can proceed, 
  206.  
  207. the faster is program development.   However,  because WordStar is a big and 
  208.  
  209. powerful  package,  with two overlays to read off disk into memory,  it  can 
  210.  
  211. take over 25 seconds from the moment the command line is typed to being able 
  212.  
  213. to  edit  the program text.   Moreover,  the C compiler,  like many  others, 
  214.  
  215. reports  syntax errors by line number;  WordStar has no command to move  the 
  216.  
  217. cursor to a specified line number.   All in all, WordStar is great for text, 
  218.  
  219. and not much good for programs.
  220.  
  221. I resolved, therefore, to write an editor more adapted to my needs.  Such an 
  222.  
  223. editor  would  have  the  following  characteristics  (in  rough  order   of 
  224.  
  225. priority):
  226.  
  227.     Small run file, with no overlays
  228.     No initial menu - one would go straight into editing the text
  229.     A command to jump to a given line number
  230.     Random access to the text;  as far as possible, it should be as quick to 
  231.  
  232.      move from line 500 to line 1 as from line 1 to line 500
  233.     As few 'modes' as possible - I don't like editors (such as, for instance 
  234.  
  235.      the  UCSD editor) where one can only insert in the 'insert'  mode,  and 
  236.  
  237.      only delete in the 'delete' mode 
  238.     No (unreasonable) limit on the size of files which can be edited
  239.     As  crash proof as possible - including guards against BDOS  errors  and 
  240.  
  241.      disk and directory full errors
  242.     Auto-indent feature for structured programming languages
  243.     Capability  of  listing  selcted portions of programs  to  the  printer, 
  244.  
  245.      whilst remaining inside the editor
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255. The  e   screen editor                             Page 4
  256.  
  257.  
  258.  
  259. e  does all of these.   On the other hand,  there are a number of facilities 
  260.  
  261. which  other  editors possess,  but which  e  does not have.   They are  all 
  262.  
  263. features which, if implemented, would conflict with one or more of the above 
  264.  
  265. 'desirables'.   An  editors  is  the kind of the thing  for  which  personal 
  266.  
  267. preferences are important and varied,  and thus your favorite feature may be 
  268.  
  269. in the list below, rather than the list above.  If so, you can always have a 
  270.  
  271. go implementing it.  (If you do, I'd be glad to have a copy, and so probably 
  272.  
  273. would the User Group).
  274.  
  275.     Macros and multiple commands executed repeatedly (in my view,  these are 
  276.  
  277.      more  appropriate to a batch,  rather than an interactive editor;  and, 
  278.  
  279.      anyway,  such  commands  are  difficult to formulate so  that  they  do 
  280.  
  281.      exactly what is wanted and neither more nor less)
  282.     Wild  characters and regular expressions in defining search strings  for 
  283.  
  284.      the  Find and Alter commands (possible to implement,  but would  reduce 
  285.  
  286.      the searching speed significantly)
  287.     An  'Overwrite'  mode  as well as an 'Insert' mode (see  comments  above 
  288.  
  289.      about modes)
  290.     Word processing capabilities,  such as word wrap and re-formating (I use 
  291.  
  292.      WordStar)
  293.     Block  moves  of arbitrary blocks,  rather than just blocks of  complete 
  294.  
  295.      lines (fine, but the coding is hair-raising)
  296.  
  297. At one time or another, I've tried all these latter features, but eventually 
  298.  
  299. given up or thrown them out as unnecessary or unproductive.
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341. The  e   screen editor                             Page 5
  342.  
  343.  
  344.                               5. How  e  works
  345.  
  346. The  above  list  of  desirables more or  less  dictated  the  basic  design 
  347.  
  348. principles  of   e.   For  instance,  the need to get to a  particular  line 
  349.  
  350. suggested  that  the  text being edited should be  organised  in  lines  (as 
  351.  
  352. opposed to a continuous block of text,  including end-of-line markers).  The 
  353.  
  354. former  organisation is that adopted by  e  (and by EDIT-80);  the latter by 
  355.  
  356. ED  and  WordStar.   The choice has a profound impact on the  style  of  the 
  357.  
  358. resulting editor.
  359.  
  360. Since  text lines are of variable length,  it would not be sensible to store 
  361.  
  362. then in fixed length 'holes'.   e therefore keeps a list,  in line order, of 
  363.  
  364. pointers to the text itself,  which is kept packed in no particular order in 
  365.  
  366. a  large  block  of memory.   Text moving commands therefore  have  only  to 
  367.  
  368. manipulate  the pointers,  not the text itself.   Deleting a line just means 
  369.  
  370. deleting  a  pointer,  by  shifting the following line  pointers  down  one.  
  371.  
  372. Inserting a line requires adding the text to the block of memory and  making 
  373.  
  374. room in the list of pointers for a new one, to point to the new text.
  375.  
  376. In  fact,  things are rather more complicated because it is not possible  to 
  377.  
  378. keep  all  the text of large files in memory.   When e runs  out  of  memory 
  379.  
  380. space, it switches to using 'virtual memory'.  The block of real memory used 
  381.  
  382. to  store text is divided logically into 1K byte 'pages'.   When there is no 
  383.  
  384. more  room,  the  least recently used page is written to a scratch  file  on 
  385.  
  386. disk,  thus making available another 1K bytes.  e  keeps track of where each 
  387.  
  388. page is located - in memory or on disk - and if the text of a line on a page 
  389.  
  390. which  is  currently not in memory is required (to display  or  change,  for 
  391.  
  392. instance),  another  page is swapped out to disk,  and the required page  is 
  393.  
  394. swapped  in.    This  technique means that any line can be  accessed  either 
  395.  
  396. immediately  (if its text is already in memory),  or in the time  needed  to 
  397.  
  398. write  out  a 1K block and read in another.   It might appear that the  only 
  399.  
  400. file  size  limitation that this would impose would be the  amount  of  disk 
  401.  
  402. space available,  but in fact one needs to keep all the line pointers in RAM 
  403.  
  404. for  the sake of reasonable speed of line insertion and deletion.  Thus  the 
  405.  
  406. limitation  is not in the size of the file which can be edited,  but in  the 
  407.  
  408. number  of lines (the limit is quite large - about 4000 lines in a 56K  CP/M 
  409.  
  410. system).
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441. The  e   screen editor                             Page 6
  442.  
  443.  
  444.                                  6. Using e
  445.  
  446. This section describes how one uses e.   It assumes that you have it already 
  447.  
  448. implemented for your terminal.  Guidance on how to do that is to be found in 
  449.  
  450. sections 7 to 9.
  451.  
  452. This  section  is  organised as a tutorial.   It is best to  carry  out  the 
  453.  
  454. operations  on  your own terminal as they are described.   The notes in  the 
  455.  
  456. left hand margin are provided for quick reference.
  457.  
  458. Start up      a)  Login to a drive (say, drive B:) containing a disk holding 
  459.  
  460.               (at  least)  the  files  e.com (the editor)  and  e.doc  (this 
  461.  
  462.               document), and type
  463.                         
  464.                    e
  465.  
  466.               b)  This will start the editor.  You should see a screen which 
  467.  
  468.               is  blank except for the message '1:1' near the middle of  the 
  469.  
  470. Status line   top line, and the cursor at the start of the second line.  The 
  471.  
  472.               top  line  is  used  by  e  as  its  'Status  Line',   showing 
  473.  
  474.               information about what it is doing.   The '1:1' shows that the 
  475.  
  476.               cursor is on line 1, at column 1.
  477.  
  478.               c)  Type 
  479.                    
  480.                    I am using the e screen editor
  481.  
  482.               You  will see what you type appearing on the screen,  and  the 
  483.  
  484.               cursor keeping ahead of the characters you type.
  485.  
  486.               d)  Now hold down the control (CTRL) key, and type V  (ie type 
  487.  
  488.               ^V).   The  top few lines will be filled by the  'help  menu', 
  489.  
  490. Help menu     guidance  on the commands e will accept.   The line you typed, 
  491.  
  492.               and the cursor, will have moved down to make room for the help 
  493.  
  494.               menu.
  495.  
  496.               e)   The keys you press to issue commands to e will  generally 
  497.  
  498.               be  either control keys (ie the 'control' key  in  combination 
  499.  
  500.               with  one of the letter keys),  or special keys particular  to 
  501.  
  502. Key-command   the terminal you are using.   For instance, to move the cursor 
  503.  
  504. assignments   to the end of the text using a TeleVideo terminal, one presses 
  505.  
  506.               the key marked HOME.  Other terminals may not have such a key, 
  507.  
  508.               and  would use a control key instead.   The following tutorial 
  509.  
  510.               uses  the  key assignments used with  the  TeleVideo  terminal 
  511.  
  512.               range,  but  remember  that there may be differences for  your 
  513.  
  514.               terminal.   The help menu will tell you which particular  keys 
  515.  
  516.               you should be using.
  517.  
  518.               f)   Press  the  left arrow key.   The cursor  will  move  one 
  519.  
  520.               position  to  the  left,  so that it is on top of the  'r'  of 
  521.  
  522. left arrow    'editor'
  523. key
  524.               g)  Type ^S.   The cursor will jump leftwards to the beginning 
  525.  
  526. left word     of the previous word,  'screen'.   Type ^D, and it will jump a 
  527.  
  528.               word to the right,  back to the 'e' of 'editor'. Now press the 
  529.  
  530. right arrow   right  arrow  key several times to move the cursor  along  the 
  531.  
  532.               word 'editor' to the end of the sentence.   Note that when the 
  533.  
  534.               cursor reaches the end,  it will not move any further, even if 
  535.  
  536.               you keep pressing the right arrow key.
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546. The  e   screen editor                             Page 7
  547.  
  548.  
  549.  
  550. beginning of  h)  Type ^B.   The cursor jumps to the Beginning of the  line.  
  551.  
  552. line          ^E takes it to the End of the line.   Try it.   Type ^B again, 
  553.  
  554. end of line   and then type
  555.  
  556.                         Now
  557.  
  558.               followed by a space.   See how the new word is inserted before 
  559.  
  560.               what you had there.   This editor is always in 'insert' mode - 
  561.  
  562.               whatever  you type (that isn't a command) goes into the  text, 
  563.  
  564.               pushing aside anything already there.
  565.  
  566.               i) Press the Return key.   This puts the cursor,  and whatever 
  567.  
  568. Return        is  under and following it on a new line.   On terminals which 
  569.  
  570.               support  the  feature,  only the line on which the  cursor  is 
  571.  
  572.               resting will be in 'bright' characters;  the rest of the  text 
  573.  
  574.               will be dimmer.  Type
  575.  
  576.                         at this moment
  577.  
  578. new line      and  then type ^N.   Note how,  like Return,  ^N inserts a new 
  579.  
  580.               line,  but this time,  the cursor has stayed where it was, and 
  581.  
  582.               did not move down to the new line.
  583.  
  584.               j)  Using the up arrow and down arrow keys,  and the keys  you 
  585.  
  586. up arrow      have used before,  'steer' your way round the text, noting how 
  587. down arrow    you  can't escape the invisible boundaries which surround  it.  
  588.  
  589. end of text   The HOME key will take you to the end of the text,  and the ^U 
  590.  
  591. beginning     key will take you to the beginning.  
  592. of text   
  593.               Move to the end of the text, and type Return to bring you onto 
  594.  
  595.               the next line.   Now type a tab (ie press the key marked  Tab, 
  596.  
  597.               or if there isn't one, type ^I).   The cursor will have jumped 
  598.  
  599.               across to column 8.  Type the word 
  600. auto indent                   
  601.                          Auto
  602.  
  603.               Now  press Return again.   The cursor moves to the next  line, 
  604.  
  605.               but not at the beginning but under the A of Auto.   Type a tab 
  606.  
  607.               and then the word
  608.  
  609.                          indent
  610.  
  611.               and press Return.   This time,  the cursor is positioned under 
  612.  
  613.               the  i  of indent.   This is the auto indent feature at  work: 
  614.  
  615.               whenever  you  type Return and the previous line  begins  with 
  616.  
  617.               'white space' (blanks or tabs), the cursor is left immediately 
  618.  
  619.               under the first non-blank and non-tab character of that  line.  
  620.  
  621.               It  is  very  useful when writing programs  that  are  'block-
  622.  
  623.               structured'  (such  as C and Pascal) as it helps line  up  the 
  624.  
  625.               indentations  of each block without you having to worry  about 
  626.  
  627.               counting  tabs or spaces.   If you need to 'un-indent',  it is 
  628.  
  629.               easy to delete the unwanted spaces and tabs (we'll see how  in 
  630.  
  631.               a moment).
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645. The  e   screen editor                             Page 8
  646.  
  647.  
  648.               k)  Move to the beginning of the text and type ^F.   A  prompt 
  649.  
  650. find          under the menu will ask
  651.  
  652.                    Find?
  653.  
  654.               Type 
  655.  
  656.                    ito
  657.  
  658.               and press Return.  A second prompt will ask
  659.                    
  660.                    Search Backwards/Ignore case/number of time?
  661.  
  662.               Just  press  Return.   The cursor will jump to the  characters 
  663.  
  664. find options  'ito',  in  the middle of the word 'editor',  and the  prompts 
  665.  
  666.               will disappear.  You have found 'ito'.  Now move the cursor to 
  667.  
  668.               the  end of the text (HOME),  and press ^F again.   After  the 
  669.  
  670.               prompt has appeared, type ^R.  The previous characters to find 
  671.  
  672.               ('ito') will be Retrieved.  Press Return, to get the 
  673.  
  674.                    Search Backwards/Ignore case/number of times?
  675.  
  676.               prompt.   This time,  type 'b' (or 'B',  or '^B',  it  doesn't 
  677.  
  678.               matter)  to mean that the search is to go backwards,  and then 
  679.  
  680.               press Return.  The cursor will once again be positioned on the 
  681.  
  682.               'ito' of 'editor'.
  683.  
  684.               l)  Type ^R.   e will repeat the last Find command, attempting 
  685.  
  686.               to  find another 'ito',  again  working  backwards.   However, 
  687.  
  688. repeat        since  there  is no other 'ito' in the text,  the search  will 
  689. last find/    fail,  and  a message to say that appears on the status  line.  
  690. alter         The cursor remains where it is.  This is what happens whenever 
  691.  
  692.               you ask  e  to search for something it cannot find.
  693.  
  694.               m)   Now  type  ^A.   This is the command  to  Alter  (change, 
  695.  
  696.               exchange) one set of charactacters (string) for another.   The 
  697.  
  698. alter         familiar Find?  prompt will appear.   Type the letter e.   You 
  699.  
  700.               will be asking  e  to change all the 'e's in the text to 'z's.  
  701.  
  702.               Press Return, to get another prompt:
  703.  
  704.                    Alter to?
  705.  
  706.               Type z, and press Return.  Then comes the third prompt:
  707.  
  708.               Back/Global/To end (start)/Ignore case/Without asking/number?
  709. alter 
  710. options       You can now enter one or more of the initial letters - B G T I 
  711.  
  712.               or W - of these options, and/or a number.  The options mean:
  713. Back      search  backwards,  towards  the beginning of the  file  from  the 
  714.  
  715.           current cursor position
  716. Global    replace  all occurences of the specified string wherever they  are 
  717.  
  718.           in the text
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.  
  734. The  e   screen editor                             Page 9
  735.  
  736.  
  737. To end    replace  all  occurences of the specified string from  the  cursor   
  738.    start  position  to  the end of the file (or the beginning  if  the  Back 
  739.  
  740.           option is also chosen)
  741. Ignore    search  for the find string without regard to the case,  upper  or 
  742.  
  743. case      lower, of the characters
  744. Without   replace without first verifying that the replacement is desired
  745. asking
  746. number    find the next (number) occurences of the string
  747.  
  748.               To change all the 'e's in the text to 'z's, type
  749.  
  750.                    g
  751.  
  752.               and Return.  e  will find the first 'e', place the cursor over 
  753.  
  754.               it, and then ask, on the status line, whether a replacement of 
  755.  
  756.               this  'e' is required.   Type Y (or  y  or ^y) to  effect  the 
  757.  
  758.               replacement.  The cursor will move on to the next 'e'.  Type N 
  759.  
  760.               to skip replacing this one.  Then the next ... please yourself 
  761.  
  762. Escape        whether you change this one.  And the next... press the Escape 
  763. key           (ESC)  key this time,  and the Alter command will be  aborted, 
  764.  
  765.               without making this change.
  766.  
  767.               This  is the first use you have made of the Escape key,  which 
  768.  
  769.               plays an important role with  e.    The Escape key will almost 
  770.  
  771.               always  either abort the current command or skip some part  of 
  772.  
  773.               it.  Another example of the useful Escape key:
  774.  
  775.               Move the cursor to the beginning of the file (^U).   Type  ^F, 
  776.  
  777.               and ask to find 'ito'.   Of course, you have done this before.  
  778.  
  779.               But instead of pressing the Return key (and getting the Search 
  780.  
  781.               Backwards/Ignore  case/number  prompt),   press  Escape.   The 
  782.  
  783.               cursor  skips  straight  to the desired  string  in  the  word 
  784.  
  785.               'editor', using the default options: search forwards, once.
  786.  
  787.               n)   Your  text  is probably getting to be a bit  of  a  mess.  
  788.  
  789. delete left   Let's  delete  it.    Press  the  DEL  key  (RUBOUT  on   some 
  790.  
  791.               keyboards).   The  character  to the left of the  cursor  gets 
  792.  
  793. delete right  erased.    Now  type  ^G.   The  character  under  the  cursor 
  794.  
  795.               disappears.   Move  the  cursor to the beginning of  the  file 
  796.  
  797. delete word   again (^U),  and type ^T.  The word to the right of the cursor 
  798.  
  799.               (it  should be Now,  if you've followed all these instructions 
  800.  
  801.               exactly) is rubbed out.   Try ^T again - nothing happens.   ^T 
  802.  
  803.               will not erase newlines.   ^Y will, though.  ^Y will erase the 
  804.  
  805. delete line   whole of the line containing the cursor,  and put  the  cursor 
  806.  
  807.               on the first character of the next line.  Move the cursor onto 
  808.  
  809.               the  line containing the  word 'using' and type ^Y.   It  will 
  810.  
  811.               disappear. 
  812.  
  813.               Move  the  cursor to the end of the  text  (HOME),  and  press 
  814.  
  815. delete space  Return.  The auto indent will leave the cursor in column 16 on 
  816.  
  817. provided by   the next line.  Press DEL (RUBOUT) once,  and note how the Tab 
  818. auto indent   provided by the auto indent is deleted, moving the cursor back 
  819.  
  820.               to column 8.   Press DEL again,  and the cursor is back at the 
  821.  
  822.               left hand margin, in column 1.
  823.  
  824.               Sometimes  you might erase a  word (or make other changes)  by 
  825.  
  826. undo          accident,  or as an experiment to see how things look.   e has 
  827.  
  828.               an  'undo' key which will put the text back into  the  exactly 
  829.  
  830.               the  state  it  was in before the last  change.   In  fact,  e 
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840. The  e   screen editor                             Page 10
  841.  
  842.  
  843.               remembers  the last 40 text changing commands you  have  made, 
  844.  
  845.               and  pressing the 'undo' key repeatedly will undo each of them 
  846.  
  847.               in  turn.   Position the cursor at the beginning of  the  word 
  848.  
  849.               'this'  and type ^T.   'this' will disappear.   Now press  the 
  850.  
  851.               'undo' key (^\).   'this' reappears.  Keep pressing the 'undo' 
  852.  
  853.               key, and watch the changes you made being undone.  When all is 
  854.  
  855.               undone, the message, 'Nothing to undo' will appear.
  856.  
  857.               o) Type ^Q, to get the prompt
  858. quit
  859.                    Write edited text to file, Abandon all edits, or Return?
  860.  
  861.               R,  for  Return,  will get you back into editing,  and W,  for 
  862.  
  863.               Write,  will ask for a name to file the text under.   But  you 
  864.  
  865.               will probably not want to save your work this time,  so type A 
  866.  
  867. quit options  (or a or ^A).  This results in:
  868.  
  869.                    Exit to CP/M, Return to this file, or edit Another file?
  870.  
  871.               E,  for  exit,  will put you back into CP/M.   R is the  panic 
  872.  
  873.               button to return you to the text you were editing, in case you 
  874.  
  875.               decided  you didn't really mean that you wanted to abandon all 
  876.  
  877.               that  you had done.   A,  for another file,  is the one  we'll 
  878.  
  879.               choose this time.  Type A.
  880.  
  881.               (Incidentally,  suppose  you had wanted to file your text  and 
  882.  
  883.               exit to CP/M - the most common sequence.   You would type Q  W 
  884.  
  885.               E,  to quit, write and exit, a quick and easy set of commands, 
  886.  
  887.               since Q W and E are the top left keys on a QWERTY keyboard)
  888.  
  889.               p)   The  screen will change to a display of the directory  of 
  890.  
  891.               the   currently logged in directory.   See that the amount  of 
  892.  
  893.               room  you  have left on the disk is displayed  at  the  bottom 
  894.  
  895. changing      righthand corner of the screen.  To look at another directory, 
  896.  
  897. drive or      type  the drive letter,  followed by a colon and Return.   For 
  898.  
  899. user area     instance, try typing
  900.  
  901.                         A: 
  902.               followed by pressing Return.   This now becomes the  'default' 
  903.  
  904.               drive  for  reading and writing files.   You can also can  the 
  905.  
  906.               user  area you are logged into by typing the user area  number 
  907.  
  908.               followed by a / and Return.
  909.  
  910.               Now get back to the original directory,  and type E.DOC as the 
  911.  
  912.               file to edit.  We shall be trying out some editing commands on 
  913.  
  914.               this document file.  Press Return.
  915.  
  916.               q)   You  should now be looking at the first sixteen lines  of 
  917.  
  918.               this  document.   There  are a few more  commands  for  moving 
  919.  
  920. down screen   around the text.  ^Z (try it!) moves you down a 'screen full'; 
  921.  
  922. up screen     ^W moves up a screen full.  (These letters were chosen because 
  923.  
  924.               they  are near the control key,  and therefore easy to  type).  
  925.  
  926.               ^W at the top of the keyboard takes you up the file, ^Z on the 
  927.  
  928.               bottom  row  takes you down the file.   The last command  that 
  929.  
  930.               moves  you  around  the text is ^X.   This is  a  most  useful 
  931. jump          command,  because  it lets you jump straight to  a  particular 
  932.  
  933.               line.  Typing ^X gives the prompt
  934.  
  935.                   Jump to?
  936.  
  937.  
  938.  
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945. The  e   screen editor                             Page 11
  946.  
  947.  
  948.  
  949.               Enter 72, and press Return.  The cursor moves to line 72.
  950.  
  951.               r)   All this time,  you will have had the help menu displayed 
  952.  
  953.               on  the  screen.   Once you have got the hang of  the  various 
  954.  
  955.               commands,  (and  that takes a surprisingly short time)  you'll 
  956.  
  957.               probably want to get rid of it,  and use the screen space  for 
  958.  
  959. help menu     text.  Typing ^V (for Viewing the menu) will make it disappear 
  960. switch        - another ^V will make the menu appear again, but leave it off 
  961.  
  962.               for the moment.
  963.  
  964.               s)   Now you can try out the block commands.   These allow you 
  965.  
  966.               to manipulate a whole block of lines of text as a  body.   The 
  967.  
  968. block         block  will start with the line on which the cursor lies  when 
  969. commands      you type the block command,  ^O,  and will extend either above 
  970.  
  971.               or  below the cursor line as you choose.   
  972.  
  973.               Type  ^O,  and  you  should get a line across the top  of  the 
  974.  
  975.               screen, below the Status Line, saying:
  976.  
  977.                  Write to file,  Print, Shift, Move, Copy, or Delete block ?
  978.  
  979.               To  choose one of these options,  you type its initial letter.   
  980.  
  981.               A copy of the block may written out to a file,  may be printed 
  982.  
  983.               on your printer,  may be bodily shifted to the left or to  the 
  984.  
  985.               right  relative  to  the margins,  the block may be  moved  to 
  986.  
  987.               another  position  in the text,  a copy of the  block  may  be 
  988.  
  989.               inserted elsewhere into the text, or the block may be deleted. 
  990.                    To  start with,  try deleting a block - type D to  select 
  991.  
  992.               the Delete option.   The further prompt:
  993. delete block
  994.                    Put cursor on line ending block and press [return]
  995.  
  996.               will  appear.   You  can  now  use any of  the  cursor  moving 
  997.  
  998.               commands (left,  up,  right and down arrow,  left word,  right 
  999.  
  1000.               word,  beginning or end of line,  up or down a screen, as well 
  1001.  
  1002.               as  jump to a line,  and find a character string) to move  the 
  1003.  
  1004.               cursor.  Move it to the line where you would like the block to 
  1005.  
  1006.               end  - either above or below the line where  you  started.  If 
  1007.  
  1008.               your terminal has this feature, you will see the block you are 
  1009.  
  1010.               selecting illuminated more brightly than the surrounding text.  
  1011.  
  1012.               When  you have chosen the block ending line (it doesn't matter 
  1013.  
  1014.               where  this is for the purposes of this tutorial),  press  the 
  1015.  
  1016.               Return key,  and the marked block will disappear;  it has been 
  1017.  
  1018.               deleted.  The cursor finishes up on the line below the deleted 
  1019.  
  1020.               block.   If needed,  the 'undo' key will restore the block you 
  1021.  
  1022.               have just deleted.
  1023.  
  1024.               The other block commands behave similarly.  Move the cursor to 
  1025.  
  1026.               the beginning of the block,  type ^O to start a block command, 
  1027.  
  1028.               select the approriate option,  then mark the end of the block.  
  1029.  
  1030.  
  1031. write block   The 'Write to a file' option will next ask for the name of the 
  1032. to file       file  to  write to (and ask for confirmation if the  name  you 
  1033.  
  1034.               give is that of an already existing file) before a copy of the 
  1035.  
  1036.               block  is written to the file.   
  1037.  
  1038. print block   The 'Print' option prints as soon as you define the end of the 
  1039.  
  1040.               block.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050. The  e   screen editor                             Page 12
  1051.  
  1052.  
  1053.  
  1054. move block    The  'Move' and 'Copy' options both request  that,  after  the 
  1055.  
  1056. copy block    block  has been defined,  the cursor be moved to the  position 
  1057.  
  1058.               where  the block itself (or with the 'Copy' option,  a copy of 
  1059.  
  1060.               the block) is to go.
  1061.  
  1062.               The 'Shift' option is a little more complicated.   It is meant 
  1063.  
  1064.               particularly  for occasions when you want to move a  block  of 
  1065.  
  1066. shift block   text  'sideways',  ie by adding or deleting spaces or tabs  at 
  1067.  
  1068.               the  beginning  of each line in the block (useful to  preserve 
  1069.  
  1070.               the  indentation  pattern when modifying programs  written  in 
  1071.  
  1072.               block-structured  languages).   After  you  have  defined  the 
  1073.  
  1074.               block, the cursor will be placed at the beginning of the first 
  1075.  
  1076.               line of the block.   You can then type spaces or tabs,  or use 
  1077.  
  1078.               the  DEL  (RUBOUT) key to delete tabs or spaces,  to  get  the 
  1079.  
  1080.               first line in its right position.   Then press Return, and the 
  1081.  
  1082.               other lines in the block will follow suit,  moving to the left 
  1083.  
  1084.               or right in parallel with the first line.  
  1085. Escape and         Have  a  go  on a piece of the text and  experiment  will 
  1086. block         these  block  commands.   If  you change your  mind  half  way 
  1087.  
  1088. commands      through  a block command,  press the Escape  key.   This  will 
  1089.               interrupt the command, and return you to ordinary editing.
  1090.  
  1091.               t)  The command ^C allows you to examine and change the 'Edit' 
  1092.  
  1093. context       and the 'File' contexts.   Type ^C, and the text on the screen 
  1094.  
  1095.               will be replaced by a screen showing the current Edit context.  
  1096.  
  1097.               The current settings of a number of options are shown, and you 
  1098.  
  1099.               can  change these now you are in the Edit context.   You  have 
  1100.  
  1101.               already  come across the Auto Indent feature,  which  provides 
  1102.  
  1103.               the indentation useful for block structured languages.
  1104. auto indent   Typing   A    will  change the  Auto  indent  option  setting, 
  1105.  
  1106.               turning it on or off.  
  1107.               Similarly,  typing B will change the Backup option.   When you 
  1108.  
  1109. backup        file  the  text you are editing,  if this option  is  on,  any 
  1110.  
  1111.               previously  existing version of the file you have been editing 
  1112.  
  1113.               will have its name changed so that it ends with the  extension 
  1114.  
  1115.               ".BAK"  (if a ".BAK" file already existed,  it will be deleted 
  1116.  
  1117.               first),  so that you always have the last version of your text 
  1118.  
  1119.               as  a backup to the current version.   With the backup  option 
  1120.  
  1121.               off,  the  new  text  simply replaces the  old  text  in  your 
  1122.  
  1123.               existing file. 
  1124.  
  1125.               The  Tab  stops  option  allows you to change  the  number  of 
  1126.  
  1127. tab stops     columns  skipped for every tab (usually it is 8).   Type T  to 
  1128.  
  1129.               change it;  you will then be asked for the new setting.   Note 
  1130.  
  1131.               that this option only changes the number of columns skipped by  
  1132.  
  1133.               e ,  and it will have no effect on,  for instance, the display 
  1134.  
  1135.               produced by the CP/M utility TYPE.
  1136.                    Normally, e ignores any trailing (right hand edge) spaces 
  1137.  
  1138.               or  tabs  that you might stick on the end of a line  of  text, 
  1139.  
  1140. strip         since  such 'white space' is usually no more than a  nuisance.  
  1141. trailing      But  sometimes it is useful to be able to enter such  trailing 
  1142. blanks        white  space,  and the Strip option can be changed (type S) to 
  1143.  
  1144.               allow this.
  1145.                    You  will have seen that the cursor  position,  line  and 
  1146.  
  1147.               column  number,  is displayed at the top of the screen.   Some 
  1148.  
  1149. display of    people find the constant updating of this position  disturbing 
  1150.  
  1151. cursor        or irritating, so the L option is provided to turn off (or on) 
  1152.  
  1153. position      this display.
  1154.  
  1155.  
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163. The  e   screen editor                             Page 13
  1164.  
  1165.  
  1166.                    When a line is too long to display it all on the  screen, 
  1167.  
  1168.               only  the first part is shown.   If you move the cursor on  to 
  1169.  
  1170.               the  'hidden'  part  of  the line,  e shifts  the  whole  line 
  1171.  
  1172. horizontal    leftwards,  thus  ensuring that the part of the line on  which 
  1173.  
  1174. scrolling     the  cursor rests is displayed.   This is known as  horizontal 
  1175.  
  1176. by line or    scrolling.  Usually, the scroll affects only the current line, 
  1177.  
  1178. page          the  rest of the screen being displayed as  normal.   Changing 
  1179.  
  1180.               the  H option,  however,  makes the whole screen  scroll as  a 
  1181.  
  1182.               unit.   This  has the advantage that you can see more  clearly 
  1183.  
  1184.               what  you are doing in relation to the rest of the  text,  and 
  1185.  
  1186.               the  disadvantage that the scroll operaton has to rewrite  the 
  1187.  
  1188.               whole screen, which takes time.
  1189.                    Finally,  the display shows you how many lines of text  e  
  1190.  
  1191.               can hold.  As explained in the section above on how  e  works, 
  1192.  
  1193. max size of   there  is  no limit on the amount of text  e   can  handle  at 
  1194. file          once,  but  there is a (large) limit on the number of lines of 
  1195.               text.   What  the limit is depends on the setting of  the  'x' 
  1196.  
  1197.               command line option (see below) and on the amount of memory in 
  1198.  
  1199.               your computer.   With the 'x' option on,  or with more memory, 
  1200.  
  1201.               the limit is larger.
  1202.  
  1203.               There are two more options you may choose in the Edit context: 
  1204.  
  1205.               typing Return takes you back to normal editing;   and F  takes 
  1206.  
  1207. file          you into the File context.  So, for now, type F.
  1208. context
  1209.                    The File context will be displayed.   It is a list of the 
  1210.  
  1211.               files on the currently logged-in disk,  with an indication  of 
  1212.  
  1213.               how  much free space there is left on the disk.   There are  a 
  1214. file context  number of further commands available here:
  1215. commands           V lets you look at another directory's files.
  1216.                    R allows you to change the name of a file, other than the 
  1217.  
  1218.                          one you are currently editing.
  1219.                    D will delete a file.
  1220.                    C enables you to change the name of the file in which the 
  1221.  
  1222.                          text you are editing will eventually be saved.
  1223.                    [return] will take you back to editing your text.
  1224.  
  1225.               u)   That more or less concludes our tour through   e.   There 
  1226.  
  1227. entering      are one or two extras to mention.  Escape has one more use, to 
  1228. control       enter control characters into the text.   Type Escape and then 
  1229. characters    a  letter  of  the alphabet.   If your terminal  supports  the 
  1230.  
  1231.               feature,  the  letter will appear dimmer than the rest of  the 
  1232.  
  1233.               line,  to indicate that it is not an ordinary character, but a 
  1234.  
  1235.               control character.
  1236.  
  1237.               Now type ^Q,  ^A,  and ^E to exit from  e , without saving the 
  1238.  
  1239.               results of your practice editing.
  1240.               There remains only the command line options to describe.   All 
  1241.  
  1242.               the  Edit context options and a number of further options  can 
  1243.  
  1244. command       be  set by adding single letter 'flags',  each preceded  by  a 
  1245. line          dash,  on  the command line when you start up e.   The options 
  1246. option flags  available are:
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.  
  1262. The  e   screen editor                             Page 14
  1263.  
  1264.  
  1265. -A   change  the  setting  of the Auto indent option from that  set  as  the 
  1266.  
  1267.      default  (see  below for how to establish the default settings for  all 
  1268.  
  1269.      these options).
  1270.  
  1271. -B   change the setting of the Backup option from the deafult
  1272.  
  1273. -D   this  flag  should be followed by a letter,  in the range A  to  P,  to 
  1274.  
  1275.      indicate  the  drive  on  which  e  temporary  buffer  file  should  be 
  1276.  
  1277.      created,  if one is needed.   If this flag is not given on the  command 
  1278.  
  1279.      line,  the  currently  logged-in disk is used to keep the buffer  file.  
  1280.  
  1281.      The buffer file is only created if the file being edited is too big  to 
  1282.  
  1283.      fit  into  memory,  and it is always deleted automatically  before  you 
  1284.  
  1285.      leave the editor.   If created,  the buffer file will be visible as the 
  1286.  
  1287.      file e$$$.$$$ in the directory displayed by the File context.
  1288.  
  1289.      Example:    A> e myfile -d b
  1290.  
  1291. -S   change  the setting of the Strip trailing blanks and tabs  option  from 
  1292.  
  1293.      the default.
  1294.  
  1295. -T   this  option should be followed a space and then a number  to  indicate 
  1296.  
  1297.      the  tab  stop  width desired.   It changes the tab setting  from  that 
  1298.  
  1299.      established by default.
  1300.  
  1301.      Example:    A> e myfile -t 6
  1302.  
  1303. -V   if  by default the editor starts with the help menu  displayed,  giving 
  1304.  
  1305.      this  option on the command line will cause it to start with  the  help 
  1306.  
  1307.      menu not displayed, and vice versa.
  1308.  
  1309. -X   normally,  e  saves  time by using a trick to avoid CP/M doing a  'warm 
  1310.  
  1311.      boot' each time you leave e.    However,  this takes up memory.  Giving 
  1312.  
  1313.      the  -X flag on the command line instructs  e  to maximise  its  memory 
  1314.  
  1315.      usage,  and  it will therefore exit with a warm boot.   Setting the  -X 
  1316.  
  1317.      option allows an additional 700 lines or so of text to be edited.
  1318.  
  1319. -99  a  dash followed by a number (rather than a letter,  as with the  other 
  1320.  
  1321.      options)  tells 'e' to start with the current line set to that  number.  
  1322.  
  1323.      For instance, if you edit a file using the command line
  1324.  
  1325.      Example:   A> e myprogram -34
  1326.  
  1327.      the  cursor will be placed on line 34 when you start editing.   This is 
  1328.  
  1329.      useful if a compiler has reported that there is a bug on that line, for 
  1330.  
  1331.      example.
  1332.  
  1333.  
  1334.  
  1335.  
  1336.  
  1337.  
  1338.  
  1339.  
  1340.  
  1341.  
  1342.  
  1343.  
  1344.  
  1345.  
  1346.  
  1347.  
  1348.  
  1349.  
  1350.  
  1351.  
  1352.  
  1353.  
  1354. The  e   screen editor                             Page 15
  1355.  
  1356.  
  1357.  
  1358.                     7. Implementing  e  on your terminal
  1359.  
  1360. e    has to be configured for the characteristics of,  and the control codes 
  1361.  
  1362. used by, your terminal.  This section describes how to do so.
  1363.  
  1364. Implementation is straightforward for TeleVideo 912/920, Hazeltine 14xx, and 
  1365.  
  1366. ADDS terminals,  and the KayPro portable computer, since the requisite files 
  1367.  
  1368. are provided as part of the  e  package.     If you have a terminal made  by 
  1369.  
  1370. Televideo  or  one  which can emulate a Televideo  terminal,  you  can  pass 
  1371.  
  1372. straight  on  to  the next section of this manual,  which describes  how  to 
  1373.  
  1374. establish the default option settings.   If you have an ADM-31, you are also 
  1375.  
  1376. in luck,  because the terminal control codes this terminal uses are the same 
  1377.  
  1378. as those of the TeleVideo range - pass straight on to the next section.   If 
  1379.  
  1380. your terminal is one of the others mentioned (or offers an emulation of  one 
  1381.  
  1382. of them) you need to take the following two steps:
  1383.  
  1384.      1.   Change  the name of the file 'eterm' supplied on the  distribution 
  1385.  
  1386. disk to 'etvi', using the CP/M command:
  1387.  
  1388.           ren etvi=eterm
  1389.  
  1390.      2.    Change the name of the supplied file 'ehaze', 'eadds', or 'ekay', 
  1391.  
  1392. as appropriate, to 'eterm', thus:
  1393.           
  1394.           ren eterm=ehaze
  1395.  
  1396. Now proceed to the next section on setting default options.
  1397.  
  1398.  
  1399. Implementation  on  other  terminals requires a  passing  knowledge  of  the 
  1400.  
  1401. programming  language C,  since you will have to modify one of the e program 
  1402.  
  1403. files.  You will also need an editor of some kind to do the modifications.
  1404.  
  1405. The  interface  between  the terminal and the rest of the  editor  is  coded 
  1406.  
  1407. entirely  in the supplied file 'eterm',  and this is probably the only  file 
  1408.  
  1409. which  will  need  modification to suit e  to  your  terminal.   'eterm'  is 
  1410.  
  1411. supplied  configured for a TeleVideo.   'eterm' includes extensive  comments 
  1412.  
  1413. describing the terminal interface to help you with any changes which may  be 
  1414.  
  1415. needed.
  1416.  
  1417. Before  starting configuring 'eterm',  you should have to hand the  terminal 
  1418.  
  1419. manual to guide you on the control codes to use.  You will need to establish 
  1420.  
  1421. what  codes  should  be  sent  to the  terminal  to  perform  the  following 
  1422.  
  1423. functions:
  1424. *    put  the  cursor  on  any specified position  on  the  screen  ('cursor 
  1425.  
  1426.      addressing')
  1427. *    clear  the line from the cursor position to the right hand edge of  the 
  1428.  
  1429.      screen to spaces (clear to end of line)
  1430. *    delete  the  line on which the cursor is resting,  and  move  following 
  1431.  
  1432.      lines up one (delete line)
  1433. *    delete the line containing the cursor and all the lines below it to the 
  1434.  
  1435.      end of the screen (delete to end of page)
  1436. *    insert  a  blank line at the cursor line,  moving the cursor  line  and 
  1437.  
  1438.      lines below down one (insert line)
  1439. *    if  available - start and stop displaying characters in 'dim' or  half-
  1440.  
  1441.      intensity  mode  (note  that these are optional,  and  will  only  work 
  1442.  
  1443.      properly with  e if they do not themselves take up space on the screen).
  1444. The conventional names for these operations are those given in brackets.
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454. The  e   screen editor                             Page 16
  1455.  
  1456.  
  1457. Using  the  C functions provided in 'eterm' as a  guide,  new  functions  to 
  1458.  
  1459. implement these terminal control sequences should be written and edited into 
  1460.  
  1461. 'eterm'.
  1462.  
  1463. Next, you need to determine which keys should be used to request each of e's 
  1464.  
  1465. commands.   It  is  as  well to keep to the  command  - key  correspondences 
  1466.  
  1467. normally  used by e,  at least to start with,  although you may want to take 
  1468.  
  1469. adavantage  of  any special keys offered on your terminal's  keyboard.   The 
  1470.  
  1471. first  step is to alter the help menu so that it is appropriate to your  key 
  1472.  
  1473. selections.
  1474.  
  1475. At  the  end of the file 'eterm' is the C function which provides  the  help 
  1476.  
  1477. menu.  Edit this to make it correspond to your selected command-key choices.  
  1478.  
  1479. Note  that the vertical bar included in the help menu text is not  displayed 
  1480.  
  1481. as part of the menu - it is used to signal a change from dim to bright (half 
  1482.  
  1483. to  full  intensity) text and vice versa (if you have  not  implemented  the 
  1484.  
  1485. codes  to  change  intensity,  the  vertical bar  character  is  ignored  in 
  1486.  
  1487. displaying the help menu).
  1488.  
  1489. Finally,  modify  the  key  translation  table to be  found  in  C  function 
  1490.  
  1491. keytransalate  (located  immediately above the help  menu  function).   This 
  1492.  
  1493. table  converts  the  codes  sent  by  your  terminal  in  response  to  key 
  1494.  
  1495. depressions into the internal codes used by e to represent editing commands.  
  1496.  
  1497. Some  terminals send two codes when certain keys are depressed:  a 'lead in' 
  1498.  
  1499. character, followed by a character to indicate which key was pressed.  There 
  1500.  
  1501. are comments in the keytranslate function about how to deal with such cases.
  1502.  
  1503. e assumes that the terminal's display screen is 80 columns wide and 24  rows 
  1504.  
  1505. deep.   If  your screen is smaller (eg 64 by 16),  you will need to (a) edit 
  1506.  
  1507. the help menu to fit it into the smaller width; (b) reduce the width of some 
  1508.  
  1509. of the command prompts (these are scattered about the program text); and (c) 
  1510.  
  1511. change  the values of the defined constants SWIDTH and SHEIGHT.   These  two 
  1512.  
  1513. constants  are  defined in the header file 'e.h',  and should be set to  one 
  1514.  
  1515. less than the terminal screen width,  in columns,  and height,  in rows.  If 
  1516.  
  1517. your   screen  is  larger  than  80  by  24,   adjust  SWIDTH  and   SHEIGHT 
  1518.  
  1519. appropriately.  The help menu will probably not need changing.  Note that  e  
  1520.  
  1521. has not been tested with screens of size other than 80 by 24.
  1522.  
  1523.  
  1524.  
  1525.  
  1526.  
  1527.               8. Changing the default settings of the options
  1528.  
  1529. The  options  settable using flags on the command line each have  a  default 
  1530.  
  1531. value defined in the 'main' function of  e.  This function is to be found in 
  1532.  
  1533. the supplied file 'e',  and is clearly commented and marked out.   You  will 
  1534.  
  1535. probably  not  need to change any of the default option settings,  at  least 
  1536.  
  1537. until you have got used to using the editor.
  1538.  
  1539. You amy also want to set the value of CURSORWAIT, defined at the top of file 
  1540.  
  1541. e.h,  to suit the clock rate of your microprocessor.   This just affects the 
  1542.  
  1543. speed  at  which the cursor flips between brackets and between the  Replace? 
  1544.  
  1545. prompt and the string to replace in the Alter command, so getting CURSORWAIT 
  1546.  
  1547. right is not vital for the operation of the editor.
  1548.  
  1549.  
  1550.  
  1551.  
  1552.  
  1553.  
  1554.  
  1555.  
  1556.  
  1557.  
  1558.  
  1559.  
  1560. The  e   screen editor                             Page 17
  1561.  
  1562.  
  1563.                          9. Compiling and loading e
  1564.  
  1565. e  is written in the programming language C, and was developed using the BDS 
  1566.  
  1567. C  compiler  for CP/M,  version 1.50a.  It is not recommended that  you  use 
  1568.  
  1569. versions of BDS C earlier than 1.46 - e uses facilities that were introduced 
  1570.  
  1571. with  1.46.   With other C compilers,  you will need to do some  preliminary 
  1572.  
  1573. work  to  make the source code compatible.   There may be trouble  with  the 
  1574.  
  1575. setjmp()  and longjmp() library functions,  and with the file i/o.   You are 
  1576.  
  1577. warned!  
  1578.  
  1579. The following files make up the  e  package:
  1580.  
  1581.      e.doc          this file
  1582.      e.sub          a command file to compile and load e
  1583.      l2.com         Mark of the Unicorn's space saving loader (included here 
  1584.  
  1585.                     for convenience - e MUST be loaded with this loader, not 
  1586.  
  1587.                     with the standard BDS C loader, clink)
  1588.      e              the  first  program  source file for  e  - contains  the 
  1589.  
  1590.                     'main' function (and others)
  1591.      e1..e10        the rest of the source code
  1592.      eterm          the terminal interface functions (supplied set up for  a 
  1593.  
  1594.                     TeleVideo terminal)
  1595.      ehaze          the same as eterm, but set up for a Hazeltine terminal
  1596.      eadds          ... for the ADDS range of terminals
  1597.      ekay           ... for the KayPro portable computer
  1598.      e.com          the  e  editor,  compiled and loaded,  for  a  TeleVideo 
  1599.  
  1600.                     terminal
  1601.  
  1602. To  compile  and  load the editor,  it is best to PIP the  following  BDS  C 
  1603.  
  1604. compiler  files onto the disk containing the above files (only  these  files 
  1605.  
  1606. are needed):
  1607.      cc.com
  1608.      cc2.com
  1609.      c.ccc
  1610.      deff.crl
  1611.      deff2.crl
  1612.  
  1613. Then put the disk in drive A: and use CP/M's SUBMIT utility with e.sub to do 
  1614.  
  1615. all  the  work.   The compilation and loading will need about 300K  of  disk 
  1616.  
  1617. space.   If you don't have that much to spare,  you can move e.doc elsewhere 
  1618.  
  1619. first, to save about 40K.
  1620.  
  1621. The  e.sub  file  specifies  the address the C compiler is  to  use  as  the 
  1622.  
  1623. location of the bottom of the external data area,  and the address where the 
  1624.  
  1625. stack  is to start.   These addresses should allow about 400 bytes of  stack 
  1626.  
  1627. space (which is just enough).   The stack space is reported by the L2 linker 
  1628.  
  1629. at the end of the link.  The remaining memory from the stack top to the base 
  1630.  
  1631. of CP/M is used as work space to store pages of the text being  edited.   If 
  1632.  
  1633. you  are  using other versions of BDS C,  a complex 'eterm' file,  or  other 
  1634.  
  1635. compilers,  you will probably have to change these addresses.   Try to  keep 
  1636.  
  1637. them  as  low as possible,  whilst still not allowing the data  and  program 
  1638.  
  1639. areas to overlap, and keeping about 400 bytes of stack space.
  1640.  
  1641. The addresses are defined in the '-e' option to the cc compiler, in the '-t' 
  1642.  
  1643. option to the L2 loader, and in the header file 'e.h'.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655.  
  1656. The  e   screen editor                             Page 18
  1657.  
  1658.  
  1659. If  you  need to change these addresses,  be sure to make all the  following 
  1660.  
  1661. amendments:
  1662.  .   change the address of the external data area specified to the compiler, 
  1663.  
  1664. by altering the -e option setting for all cc compiler comands in the command 
  1665.  
  1666. file 'e.sub'.
  1667.  .    change the address of the 'top' of the data area,  specified in the -t 
  1668.  
  1669. option to L2 in the file 'e.sub'.
  1670.  .    change  the value of the #defined constant TOP in file 'e.h' to  match 
  1671.  
  1672. the L2 -t option
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682.  
  1683.  
  1684.  
  1685.  
  1686.  
  1687.  
  1688.  
  1689.  
  1690.  
  1691.  
  1692.  
  1693.  
  1694.  
  1695.  
  1696.  
  1697.  
  1698.  
  1699.  
  1700.  
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706.  
  1707.  
  1708.  
  1709.  
  1710.  
  1711.  
  1712.  
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.  
  1724.  
  1725.  
  1726.  
  1727.  
  1728.  
  1729.  
  1730.  
  1731.