.! a free Xeroxed copy of this file should be available in D108; .! if necessary, you can use RUNOFF and then PRINT the .mem file. .! .flags overstrike .no autosubtitle .no autoparagraph .no headers .no fill .no justify .no autojustify .keep .no paging .page size 58,73 .left margin 8 .right margin 73 .spacing 1 Educational Computing Kalamazoo College .right;Rev. 9/22/86 .c;Text Editing with EDT .title ########Editing .headers I. Introduction A. Scope and Organization This guide provides the beginning user with an introduction to the EDT text editor. (There are several versions of EDT, the one documented here is technically known as "The VAXTPU EDT Keypad Emulator.") Before using this guide you should read carefully the section "Using the VAX System" in ^&A New User's Introduction to Educational Computing at Kalamazoo College\&. This guide should be used in conjunction with the "EDT Command Guide" to learn how to use EDT with the VT-100 or Z-29 terminal. Most jobs can be done by several different sequences of commands; the command guide does not attempt to discuss all possible ways to do a job, but rather the simplest and most effective. The "+" key is not used in EDT commands, so it will be used below to signify the sequential typing of two or more keys. The contents of this guide are outlined as follows: ^&Topic Page\& I. Introduction A. Scope and organization 1 B. What you can use EDT to do 2 C. Memory Buffers 2 D. Terminal choices 3 II. Running EDT A. Starting an editing session 3 B. An example session 4 C. Terminating a session 5 B. What you can use EDT to do With EDT you can use the VAX to create and modify text files of all types. This document, for example, has been written and .b-1 .c;page 1 .page revised using EDT. Formatted data files for use with BASIC, FORTRAN, and PASCAL programs, including MINITAB and SPSS-X, can also be created and modified with EDT. Creation of a file is done by typing the desired contents on the terminal's keyboard, preceded and followed by a few typed commands. Modifications to text files can be as simple as deleting or inserting a single character, or as complex as splitting the file into several parts, shuffling their order, rearranging the margins, and adjusting the page boundaries. Some modifications can be done in a "semi-automatic" way, such as substituting one string of characters for another one throughout the text; other modifications will require more elaborate manipulations. Although a specialized word-processing editor may be available in the future, EDT is capable of reasonably convenient use with general text, not just programs, especially if used in conjunction with RUNOFF. Those who write programs may well prefer to use EDT for their word-processing also, rather than learn two editors. The command guide includes discussions of several commands that are useful specifically for word-processing applications, in addition to the commands used to create and modify program files. C. Memory buffers This section provides a glimpse into the internal operation of EDT. When you start an editing sesssion, EDT automatically allocates a memory region known as the "main buffer". If you edit an existing disk file, EDT puts a duplicate copy of the file's contents into the main buffer. The text that you insert or revise in the main buffer stays there until you save the buffer (terminate with the EXIT command), or discard it (with QUIT). Whenever you EXIT, a new disk file is created with the next higher version number; existing versions of the file on disk remain unchanged but may well be deleted by subsequent PURGE commands of the VMS operating system (for example, on LOGOUT). During editing, many commands cause EDT to place material into one or another of several special purpose buffers; the contents of these buffers are lost when you terminate EDT. Lines are delineated within the buffer by the carriage return character, "". The "pointer" is the location in the buffer where text alteration commands will be executed. It resides BETWEEN characters. When using the VT-100 for screen editing, the display is controlled to show you the pointer's location: the character immediately AFTER the pointer's position is flashed between normal and reverse video (the "cursor"). For one example, any insertion will go between those two characters, at the location of the pointer, with the pointer moved to the right of the new character. For another example, there are two .page commands for single character deletion: with the VT-100 the key removes the character to the left of the pointer and the KEYPAD "," key removes the character to the right of the pointer, the one that is flashing. D. Terminal choices EDT is designed to be used with many different terminal types. The version of EDT we are using is based on TPU (the VAX Text Processing Utility), which provides quicker response but will work only with VT-100 and compatible screens (for example, GIGI's, or Z-29's). We speak of the desired effect on your text or the pointer's location as a "command"; different terminals may use different combinations of keystrokes to communicate to EDT any given command. The command guide presents a detailed discussion of the keystrokes used with the VT-100. In screen editing the contents of your file close to the text pointer are displayed on the screen as you edit; the screen display is updated as you proceed, so that "what you see is what you get." While screen editing, the [End of MAIN] symbol appears at the end of the buffer, whenever the text pointer is close enough to the last line of the buffer. II. Running EDT A. Starting an editing session To use EDT from the VMS operating system $ prompt, type EDIT filename (If you are creating a new file, it should display a message that your file was not found, because it does not yet exist.) The file name can be any legal filename, but the only files that you can usefully edit are those that contain text material, not binary files of data or compiled programs. You may also start by typing simply "ED filename" from the $ prompt. After you have typed the , EDT will search your disk area for a file named "TPUINI.TPU". If it finds one, it will execute the startup commands contained in that file before accepting keystroke commands from the terminal. If there is no startup command file, EDT enters screen mode immediately. On occasion you will enter line mode commands by typing CTRL/Z to obtain a "*" prompt. Typing "C" from the "*" prompt will put you back into screen mode. .page B. An example session You should find a free VT-100 or Z-29, LOGIN to the system, get to the $ prompt, verify that the "CAPS LOCK" key is released (up on the VT100; light out on the Z-29), type, for example, "EDIT JUNK.TXT", and follow along with this example. Be careful to make the ^&same\& typographical errors, so that they will be corrected in the way that is described here. The boxed sections are the screen display as you will see it, ^¬\& including the various messages that will be displayed in the bottom three lines of the screen. ---------------------------------------------------------------- [End of MAIN] ---------------------------------------------------------------- Now type the following (not including the quotation marks): "The first thong we enter isa series of commands." You will see: ---------------------------------------------------------------- The first thong we enter is a series of commands. [End of MAIN] ---------------------------------------------------------------- The pointer is now at the start of the line following the period; this is shown by the flashing block above the "[". You pretend now to finally notice the error in the first line, and so type the UP ARROW key twice to move the pointer to the start of the line which you want to modify. You could now pound the right arrow key many times, but being lazy, you just type the KEYPAD 1 key (PAD 1 "WORD") three times to bring the pointer to the start of the mistyped word. Then type the RIGHT ARROW key two times to move the pointer until it is before the "o" (the "o" itself will be flashing between normal and reverse video). Delete the mistake by typing the PAD "," key ("DEL C"). (If you hit the RIGHT ARROW key three times, instead of only twice, the pointer will be after the "o" and the "n" will be flashing. In that case, delete the "o" with the key.) Now you see: .page ---------------------------------------------------------------- The first thng we enter is a series of commands. [End of MAIN] ---------------------------------------------------------------- The "n" will be flashing, indicating that the pointer is between the "h" and the "n". Finally, complete the correction by typing "i" to get: ---------------------------------------------------------------- The first thing we enter is a series of commands. [End of MAIN] ---------------------------------------------------------------- Lines with 81 characters, or longer, will have the first 79 characters displayed, followed by a "diamond" in the last column. Nothing is lost, you just can't see it all at once. Since this ordinarily happens only temporarily while adding text in the middle of a line, it should present little difficulty. You ^&can examine\& the vanished text by using + (and later return to normal display with + ), but that will conceal the beginnings of the lines (^&without\& showing diamonds to indicate the loss). C. Terminating a Session To terminate a session from a screen-editing mode, give the EXIT command by typing "PF1 + CTRL/Z". You will leave the editor after a new version of your file has been copied to the disk from the main buffer, reflecting the alterations you made. On the other hand, the QUIT command, given by typing "PF1 + Q" will return you to the operating system with NO newly revised copy of the file saved on disk; you should use QUIT if you inspected the file but made no changes, or if the changes you made were so disastrous that it is simpler to start over fresh. If you have modified the file and attempt to QUIT, you will be asked (on the third line from the bottom of the screen) whether you really want to; respond with Y or N. During the editing session EDT records in a "journal" disk file every command that you type. The journal file (whose name, while it exists is the same as the file you are editing, except for extension .TJL) is deleted when you leave EDT properly, (after creation of the new file if you EXIT) unless you specify otherwise, e.g., type CTRL/Z to get the "*" prompt, and then "EXIT/SAVE" will save the journal file. If the system crashes during your editing session, the journal permits you to take up where you left off by using the /RECOVER option on the editing command: $ EDIT filename/RECOVER If you blunder at the end of a long session, there may be no way to recover gracefully. The best bet is to exit abnormally with a CTRL/Y, hoping that the last, disastrous, command has not yet been written to the journal file. In that case the /RECOVER option will serve you well. Otherwise, it will be necessary to begin your repairs with the previous version of the file, combining it with the remains left when you EXIT from the /RECOVER session. Be careful which version of your file is best and which has been corrupted; the purge commands, ^&including the automatic purge upon logout\&, simply keep the versions with the largest version numbers. Do not make a habit of using the /SAVE option: the journal files will simply waste disk space. ^&DO\& make a habit of exiting from the editor every twenty minutes or so, to reduce the amount of your life that is at risk! If you use CTRL/C to abort a command, the journal file will be invalidated. Therefore, if you do this, immediately exit the editor with + CTRL/Z and then re-enter with + . .b-3 Richard D. Piccard July 19, 1982 Amy S. Courter Rev. 9/22/83 Richard D. Piccard Rev. 9/22/86