2. COMMAND OVERVIEW One of the nice things about EDIT is how easy it is to use. To create a document named memo1, the user types edit memo1 waits for EDIT to start executing, and then simply starts typing. There is no need to wade through a hierarchy of menus just to get started. To delete a character, the user presses the backspace key. To move the cursor, the user presses one of the the arrow keys on the right side of the keyboard. EDIT's commands are simple, and they are easy to use (just one or two keystrokes), but they are powerful. 2.1. Basic Concepts EDIT is a program that runs on an IBM-PC compatible computer. It allows a user to create and edit documents containing arbitary text. To do this, EDIT must first be started (explained in section 2.2). Once EDIT is started, it allows the user to type text at the keyboard. As each character is typed, EDIT displays it on the CRT screen of the computer. The place where the character will be displayed is indicated by the small, blinking dash on the screen. This line is called the "cursor". After the character is displayed, the cursor moves one position to the right. When the user types the Enter key, the cursor moves one line down and to the left side of the screen (like pressing the return key on a typewriter). EDIT also stores each character the user types in a large storage area in the computer called its "editing buffer", or just "buffer". The buffer holds many more characters than EDIT can display on the screen at once, so EDIT is limited to only displaying 23 lines of the text at any one time. When the user types more lines of text than will fit on the sreen, the cursor can no longer be moved down, so instead, all the lines on the screen are "scrolled" up one line, the top line disappears, and the cursor stays on the bottom line. The user need not worry about the line that disappears from the top of the screen. It is still stored in the editing buffer. EDIT also allows the user to modify the text he has typed. For example, when the user types the Backspace key, the character immediately to the left of the cursor will be erased from the screen, and the cursor will move one position to the left. In fact, all EDIT commands that modify the text affect only the characters immediately adjacent to the cursor. EDIT includes commands for moving the cursor around the screen. This allows the user to go back to characters typed previously and delete them, or insert new text. Whenever the user gives some cursor command that would move the cursor off the top or bottom of the screen (like the up command when the cursor is on the top line of the screen), the screen is scrolled up or down instead, so that the cursor always stays on the screen. EDIT also includes commands for moving the cursor to any point in the text stored in the editing buffer. When the user gives one of these commands, EDIT will completely update the text displayed on the screen, so that the 23 lines adjacent to the cursor are displayed. As explained above, EDIT stores all the text the user is editing in its editing buffer. However, this storage of the text is only temporary, while the user is running EDIT. For a more long-term storage of the text, the user must save it in a DOS file. EDIT includes commands to save text in a file and retrieve the text previously saved in a file. EDIT will warn a user if he attempts to do anything that will lose the text in the editing buffer if it has not been saved in a file. 2.2. How to Start EDIT The command to start EDIT has the following basic form: edit [ filename ] To start EDIT, this command should be entered in response to the DOS prompt. The brackets around "filename" indicate that the file is optional. The user should not type the brackets. The user does not actually type "filename". Instead, he should type the actual name of a DOS file he wishes to edit. If no file is supplied, EDIT will be initialized with an empty editing buffer and the message "No file specified" is displayed in the lower left corner of the screen. If the file already exists, it is read into EDIT's buffer and the cursor is positioned at the beginning of the file. EDIT displays the message "Editing: filename" in the lower left corner of the screen. If the file does not yet exist, EDIT is initialized with an empty buffer, and EDIT displays the message "Creating: filename" in the lower left corner of the screen. Thus, the following are several examples of how EDIT is invoked: edit edit memo.txt edit b:prog1.src The user may also supply the name of a "setting-file" after the name of the file to edit. Thus, the following is the full form of the command to start EDIT: edit [ filename [ settingfile ] ] The setting file is used to initialize the options that effect editing and printing. If no setting file is specified, edit will look for the file "edit.set" on the default DOS device. If this file exists, it will be used to initialize EDIT's settings. Otherwise, EDIT will use its default settings, which have been designed for basic word processing. The setting file is explained in greater detail in section 3.3. Section 3.4 also explains how EDIT automatically looks for a setting file associated with the file currently being edited. The following examples show how the user may start EDIT and specify both a file to edit and a setting file: edit prog2.c color.set edit letter.txt wp.set 2.3. Screen Organization EDIT organizes the screen as follows: Text area: top 23 lines Prompt line: next to the bottom line Status line: bottom line EDIT uses the top 23 lines of the screen to display the portion of the file that contains the cursor. Lines that are longer than 80 characters will only have their first 80 characters displayed, although all commands operate on long lines normally. EDIT uses the 24th line on the screen (the next to the bottom line) for prompts regarding the use of function keys, for input of file names, search strings, and such, and for messages. The bottom line on the screen displays the name of the file being edited and various status indicators. On the far right side of the bottom line EDIT displays the line and column numbers of the current cursor position within the file. To the left of the line and column numbers on the bottom line, EDIT displays the amount of free space currently available in its editing buffer as a percentage of the total space available. 2.4. Command Basics Each key the user types in EDIT may be considered a command, in that each keystroke causes a specific action to take place, and the result of that action is immediately displayed on the screen. Usually this consists of moving the cursor, deleting a portion of text adjacent to the cursor, or inserting the character typed into the buffer at the cursor position. To avoid confusing the user, EDIT always does the same thing for all commands. Thus, EDIT might be called a "modeless" editor. However, EDIT does have different "modes" that determine what happens when a character is typed for insertion into the buffer. These are "Insert" mode and "Replace" mode. In Insert mode, each character typed is inserted into the text at the cursor position and the characters to the right of the cursor are moved over one position to make room for the inserted character. In Replace mode, the character typed replaces the character that was at the cursor position. Likewise, EDIT gives the user control over what it does when characters are inserted or deleted so that a line doesn't fit nicely between the left and right margins. This is EDIT's "Word processing" mode. The different options for the Word processing mode are explained in section 3.3, under the "Set Word processing mode" command. A simple set of rules for EDIT's commands is as follows. All text characters are simply inserted (or "replaced") into the buffer. The cursor control keys (Left, Home, etc.) on the right side of the keyboard generally perform some action that corresponds to the label on the key (Left means move cursor left, and Home means move cursor to beginning of line). In addition, each of these keys also perform some "stonger" version of the same command when it is given with the Shift key depressed (Shift-Left means move left one word, and Shift-Home means move left one sentence). A similar set of rules governs the use of the 10 function keys on the left side of the keyboard. Each of these has a standard command associated with it. The help line lists each of these commands. For example, F9 is the command to delete a block of text and save it in an internal buffer from which it can later be retrieved. However, some of these commands also have a modified version, which is given by holding down the Shift key and simultaneously pressing the function key. Shift-F9 is the command to delete a block of text without saving it. For convenience, the user may use Alt or Ctrl instead of Shift to get the modified version of the function keys on the left side of the keyboard. A few additional commands are obtained by pressing Alt and one of the text keys in the center of the keyboard. Generally the key pressed with Alt is the first letter of the desired command. For example, Alt-C is the Center command, which causes EDIT to center the current line between the left and right margins. Note that it is also possible to use the cursor control keys as a numeric pad, for ease of entering numbers, "+", and "-". To do so, the user should press the Num Lock key. After this key is pressed, these keys will act as a numeric pad until Num Lock is pressed again. 2.5. Command Repetition Several of the commands accept an optional repetition count that indicates the number of times the command should be executed. The repetion count is entered by pressing Esc, followed by a positive number, and then typing the command key. For example, to move the cursor down ten lines, the user may type the following: Esc 10 Down There is a default value for the repetition count that is used if the user simply types Esc followed by the command. The initial value for this default is 5. The default value may be changed by typing Esc, then the new value, and then Enter. The maximum repetition count is 9999. The count may not be negative. The commands that accept a repetition count include the following: - basic cursor movement commands - find commands - replace commands - get command The deletion commands do not accept a repetition count. 2.6. Input to Command Prompts A few EDIT commands require the user to enter a text string - a file name, a string to search for, etc. Other commands require the user to type a single character to select a particular option from a menu of subcommands. In both of these cases, the cursor is moved out of the main text area, and down to the prompt line. To help the user remember the position of the cursor in the file while the cursor is actually down on the prompt line, the character at that position is marked in reverse video. For commands that require the user to enter a string of text, the user should type each character in the string, and then press Enter to terminate the string and execute the command. The Backspace key may be used to delete the last character of the string. Shift-Backspace will delete the entire string. To abort the command requesting the string input, the user may type Esc. Note that the Enter key is the large key just above the key labeled "PrtSc" near the right side of the keyboard. The Backspace key is the large key just to the left of the key labeled "Num Lock" near the right side of the keyboard, just above the Enter key. When a command requires the user to type a single character to select from a menu of subcommands, the subcommands are listed in parentheses on the prompt line, and the cursor appears at the right end of the list. The user selects the desired option by typing its first character. Typing any other character aborts the command. The user need not explicitly abort a command that requires string input or option selection in order to execute a command on one of the cursor control keys on the right side of the keyboard, the function keys on the left side of the keyboard, or one of the Shift commands. Typing one these commands automatically aborts the current command and executes the new command. ƒÄ¸± Pè=cƒÄº ‹¼+™;Ávèn[¸öPèï:ƒÄ‹å]