DEBIT [X.B] Display Editor for Basic Interactive Terminals Debit is a full screen text editor, easing the task of entering and revising a text file. As its name implies, DEBIT works with several terminals (among them the Series-II, the Hazeltine 1510, and OMRON). For information on how to make DEBIT work for your terminal see the section on "Configuring DEBIT" in this document. The Basic Details _________________ DEBIT divides the display screen of the CRT into two areas: the first line is reserved for the command prompt line, and the rest of the screen is used for text display. Basic information on the form of commands and on the display is given below: Command level: The outer or entrance level of the editor is called _____________ the Command level. From this level each of the basic editor commands can be reached. Whenever you enter or return to the Command level, the editor displays the "Edit:" prompt line: >Edit: A(djst C(py D(lete E(nv F(ind I(nsrt J(mp R(place Q(uit X(chng [X.B] It is one of those unfortunate facts of life that all of the names of the basic commands do not fit on the command prompt. The most commonly used ones appear, while all are documented here. The commands are grouped in this document in the following categories: the moving commands (cursor moving commands, Jump, Page, Equals), the text changing commands (Insert, Delete, Copy, eXchange), the Find and Replace commands, the formatting commands (Adjust, Margin), and the miscellaneous commands (Set, Environment, Verify and Quit). Command and mode: At the Command level there are many options. For __________________ convenience we will refer to some of these options as commands and some of them as modes depending on whether they issue a new prompt (or menu) for further specification of the command. If an option executes a task and returns control to the Command level we will call that option a command. If an option issues a new prompt and gives the user another level of options we will call that option a mode. Repeat-factors: Most of the commands allow repeat-factors. A repeat- ______________ factor is applied to a command by typing a number or a slash ("/") immediately before issuing the command. The slash means "infinite". The executon of the command is repeated for the number of times Page 1 indicated by the repeat-factor. For example: typing "2 " will cause the command to be exectued twice moving the cursor down two lines; typing "/ " will cause the cursor to be position at the beginning of the file. Commands which allow a repeat-factor assume the repeat-factor to be 1 if no number is typed before the command. The cursor: It should be remarked that the cursor is never really __________ "at" a character. The cursor is only allowed to be "between" characters. When we say the cursor is at the letter "R", it is actually between the letter "R" and the letter in front of it. You can notice this most clearly on the insert command when it inserts in front of the character the cursor was "at". On the screen the cursor is placed "at" "R" when it is really before "R" to make it easier to display. The keys: The four keys which this document refers to as , , and are terminal dependant. On most terminals these are available as cursor control keys on the keyboard, on terminals without cursor movement keys, they can be implemented as control keys. Direction: DEBIT always has a _________ direction in effect, indicated by the arrow ("<" or ">") in front of the prompt line at the top of the screen ("<" for backward and ">" for forward). On entering the editor, the direction is forward. The direction can be changed whenever the "Edit:" prompt line is present and you type the appropriate command ("<" or ">"). The period and the comma are also allowed to change direction because on many standard keyboards, "." is the lower-case for ">" and "," is the lower-case for "<". Certain commands are affected by the direction. If the direction is forward then they operate forward through the file (i.e., towards the end of the file). If the direction is backward then they operate in the opposite direction through the file (towards the beginning). When direction affects the command, it is specifically noted. The user may change the direction by typing the appropriate commands. Page 2 MOVING COMMANDS _______________ Basic Moving Commands: Moves down Moves up Moves right Moves left Moves direction Moves left Moves left Moves direction to the next position which is a multiple of the tab-size from the left side of the screen Moves to the beginning of the next line according to direction "<" or "," or "-" Changes the direction to backward ">" or "." or "+" Changes the direction to forward Repeat-factors can be used with any of the above commands. The editor, for user convenience, maintains the column position of the cursor while you are using the and , however, when the cursor is outside the text, the editor treats the cursor as though it were immediately after the last character (or before the first) of the line. Jump JUMP mode is reached by typing "J" while at the Command level. ____ On entering JUMP mode, the following prompt line appears: Jump to what marker? You must enter the name of the marker followed by a . The editor will then move the cursor to the place in the file with that name. If the marker is not in the file the editor will display an error message. Of course to be able to jump to a marker you must first set the marker. See the SET mode (under "Miscellaneous Commands") for how to do this. Page ____ The PAGE command is executed by typing "P" while at the Command level. The PAGE command moves the cursor one whole screenful up or down depending on the direction in effect. The cursor moves to the start of the corresponding line on the new page. A repeat-factor may be used before this command to go several pages. Page 3 Equals ______ The EQUALS command is executed by typing "=" while at the Command level. The EQUALS command causes the cursor to jump to the beginning of the last string which was inserted, found, or replaced. Page 4 TEXT CHANGING COMMANDS ______________________ Insert ______ INSERT mode is reached by typing "I" while at the Command level. On entering INSERT mode, the following prompt line appears: >Insert: Text { a char, a line} [ to insert, to abort] One of the options here is to type in text followed by or . If you have inserted a character which you do not want, it is possible to get rid of it without leaving the INSERT mode by back-spacing over it. The INSERT prompt line indicates this by " a char" ( is the rubout key on most keyboards). If you want to get rid of the entire line which you just typed, type ( is the control-X key on most keyboards). The INSERT prompt line indicates this by " a line". When you type , INSERT starts a new line at the level of indentation specified by the options you have turned on in the current Environment. See the ENVIRONMENT mode for how to set these options. Auto-indent: If Auto-indent is True a causes the cursor to ___________ start the next line with an indentation equal to the indentation of the current line. If Auto-indent is False a causes the cursor to start the next line at the first position. Note: if Filling is True the first position is what you set as the Left-margin. Filling: If Filling is True then the editor will insist that all your _______ insertions are between the right and left margins by automatically inserting 's between "words" whenever you would have otherwise exceeded the Right-margin and by indenting to the Left-margin whenever a new line is started. The editor considers anything between two spaces or between a space and a hyphen to be a word. If both Auto-indent and Filling are True, then Auto-indent controls the Left-margin while Filling controls the Right-margin. In any case, you can directly change the level of indentation by using the and keys immediately after a . Important note: you can do this only immediately after a before you start entering text. Filling also causes the editor to adjust the margins on the portion of the paragraph following the insertion. (A paragraph is a set of lines delimited by blank lines.) Any line beginning with the Command character (see ENVIRONMENT mode) is not touched when filling does this adjustment, and that line is considered to terminate the paragraph. If you make an insertion and accept it, that insertion is available for use with the COPY command. If you enter the INSERT mode and there is no string available for COPY. Delete ______ Page 5 DELETE mode is reached by typing "D" while at the Command level. On entering DELETE mode, the following prompt line appear: >Delete: < > [ to delete, to abort] When you enter DELETE, the editor remembers where the cursor is. That position is called the anchor. The object for you is to bracket the text you want to delete between the cursor and the anchor using the normal moving commands. As you bracket text it will disappear from the screen. To accept the deletion, type , to abort and not delete, type . The text that was deleted (or potentially deleted if the delete operation was aborted with ) is saved and is available for use with the COPY command. Copy ____ The COPY command is executed by typing "C" while at the Command level. On executing the COPY command the editor immediately copies the contents of the copy buffer into the file at the location of the cursor when "C" was typed. On the completion of the copy, the cursor returns to the point immediately before the text which was copied. Use of the COPY command does not change the contents of the copy buffer. The copy buffer is affected by the following commands: 1) DELETE: If you have accepted a deletion, the buffer is loaded with what you have deleted; if you aborted a deletion, the buffer is loaded with what would have been deleted if you had accepted. 2) INSERT: If you have accepted an insertion, the buffer is loaded with what you have inserted. If you have aborted an insertion, the copy buffer is empty. Note that the copy buffer is always affected by the insert command, even if you did not type any text (an "I" followed immediately by will wipe out the copy buffer). The copy buffer is of limited size. Whenever you have deleted so much text that the buffer will not hold all of it, the editor will warn you upon your accepting a delete with the line: There is no room to copy the deletion. Do you wish to delete anyway (y/n) eXchange ________ EXCHANGE mode is reached by typing "X" while at the Command level. On entering EXCHANGE mode the following prompt line appears: >eXchange: text { a char} [ to change, to abort] Page 6 EXCHANGE mode replaces one character in the file for each character of text you type. Typing a ( is the rubout key on most keyboards) will back the cursor one character and cause the original character in that position to reappear. As with most other commands, when in EXCHANGE mode, leaves the mode without making any of the changes indicated since entering the mode, while makes your changes part of the file. The keys have special meaning in EXCHANGE mode. The will pass by the current character without changing it; the will go back a character, restoring the character to its value before the exchange; the will uppercase the current character if it is a lower case alphabetic; and the will lowercase the current character if it was in upper case. If a carriage return is entered while in EXCHANGE mode or if the EXCHANGE goes to the end of the current line, then the editor will automatically enter the INSERT mode, signalled by a change in the prompt line and by ringing the bell. Note that the insert mode starts at the current cursor position, therefore it is not possible to backspace over the insertion point back into the original text. If the insertion is accepted by an , then the exchanged text is also accepted. If the insertion is aborted by a , then the exchanged text is restored. Get ___ GET command is reached by typing "G" while at the Command level. The GET command operates exactly the same as the insert command, except that the text to be inserted is read from an external file. The command will prompt for the name of the input file to read. If the file is too big, the user is warned of the buffer overflow. Otherwise the contents of the file is inserted into the text buffer. If the open/read operations are error free the prompt line will indicate that DEBIT is reading the file; otherwise nothing will happen. Page 7 FIND and REPLACE COMMANDS _________________________ In both modes, the use of a repeat-factor is valid. The repeat-factor appears in brackets on the prompt line. Strings: Both modes operate on delimited strings. The editor has two _______ string buffers (each of length 60). One, called by the prompt lines, is the target string and is referred to by both commands, and the other, called by the prompt line, is the substitute and is used only by REPLACE. The following rules apply to both these strings. 1) The terminating delimiter of the string will be the second occurance of the the delimiter used as the starting delimiter. For example, the following REPLACE command is valid and will replace the first occurance of the character "[" with the character "]": "R<[<)])". Here "<" and ")" are the delimiters. 2) The strings may not contain control characters such as or or
. Delimiters: The editor considers any character which is not a letter __________ or digit to be a delimiter, except or . Direction: Both FIND and REPLACE take the direction setting into _________ account. If the direction is backward the target pattern will be found if the end of the pattern is not immediately in front of the cursor. Literal and Token mode: If you are in Literal mode (set in DEBIT's _________________________ environment via the "E)nv" mode) the editor will look for occurances of the target string. If you are in Token mode the editor will look for isolated occurances of the target string. The editor considers a string isolated if it is surrounded by any non-alphanumeric delimiter. For example, in the string below, the identifier "LENGTH" is isolated by the delimiters "=" and "*": AREA:=LENGTH*WIDTH; If you wish Token mode you type "T" after the prompt line and before the target string. If you wish Literal mode you type "L" in the same place. If you do not type either character, the mode will be set to the default value found in the Environment. If the default is Literal the prompt line will remind you that if you wish Token mode you must type "T" by diaplaying "T(ok". If the default value is Token mode the prompt line will remind you that you must type "L" if you wish Literal mode by displaying "L(it". The Same option: In both FIND and REPLACE _______________ you may type "S" instead of any of the delimited strings. The "S" indicates to the editor that it is to use the same string as previously used. For example, typing "RS//" causes the REPLACE mode to use the previous target string, while typing "R//S" causes the previous substitute to be used. Typing "RSS" will perform the same replacement as the last one, while typing "FS" will find the next occurance of the same string. Page 8 Find ____ FIND mode is reached by typing "F" while at the Command level. On entering FIND mode, one of the following prompt lines appears. >Find[n]: L(it => >Find[n]: T(ok => The FIND mode finds the n-th occurance of the string starting from the current position and going in the current direction. The number "n" is the repeat-factor and is shown on the prompt line in the brackets "[n]". The arrow at the beginning of the prompt line always gives the current direction. Replace _______ REPLACE mode is reached by typing "R" while at the Command level. On entering REPLACE mode, one of the following prompt lines appears. >Replace[n]: L(it V(fy => >Replace[n]: T(ok V(fy => >Replace[n]: L(it => >Replace[n]: T(ok => V(fy: The verify option permits you to examine each occurance of the string (up to the limit set by the repeat-factor) and decide if that occurance is to be replaced. If the verify option is specified, "V(fy" will not appear in the prompt line. The following prompt line appears whenever REPLACE mode has found the pattern in the file and verification has been requested: >Replace[n]: [ to replace, to stop] Typing at this point will cause a replacement; typing will cause the REPLACE mode to be terminated; and typing any other character will cause the REPLACE mode to search for the next occurance provided the repeat-factor has not been reached. The repeat-factor counts the number of times an occurance is found, not the number of times replacement was made. Page 9 FORMATTING COMMANDS ___________________ Adjust ______ ADJUST mode is reached by typing "A" while at the Command level. On entering ADJUST mode the following prompt line appears. >Adjust: L(just R(just C(enter [ to leave] The ADJUST mode is designed to make it easy to adjust the indentation. On any line you may use the and commands to move the whole line. Each time you type a the whole line moves one space to the right. Each moves it one space to the left. When you have the line adjusted to the desired indentation type . You cannot from this mode. ADJUST mode can also justify or center text. Typing "L" while in ADJUST mode will cause the line to be left-justified to the margin set in the Environment. Similarly typing "R" right-justifies to the set margin and typing "C" will cause the line to be centered between the set margins. In writing a program in a structured language (like PL/M) you may find yourself with a whole sequence of lines to adjust. For example when you need an additional DO-END sequence you will want to adjust all the lines in between two spaces to the right. This is done easily. Adjust the last (or first) line of the sequence, then use ( or ) command and the line above (below) will be automatically adjusted by the amount of adjustment on the line from which you came. Repeat-factors are valid when used before any of the commands while in ADJUST mode. Margin ______ MARGIN command is reached by typing "M" while at the Command level. MARGIN is an Environment dependent command, that is, it may only be executed when Filling is True. There are three parameters used by the command: Right-margin, Left- margin, and Paragraph-margin. MARGIN deals with one paragraph and re- aligns the text to compress it as much as possible without violating the above three margins. See the ENVIRONMENT mode for how to set the margin values. A paragraph is defined to be something occuring between two blank lines. To MARGIN a paragraph, move the cursor to anywhere in that paragraph and type "M". If you are doing an exceptionally long paragraph it may take several seconds before the routine is ready to redisplay the screen. Page 10 Command Character: Portions of the text can be protected from being __________________ MARGINed by the use of the Command character. If the command character appears as the first non-blank character on a line, then that line is protected from the MARGIN command. The MARGIN command treats a line beginning with the command character to as though it were a blank line, that is, it will consider that the line to terminate (begin) the paragraph. Page 11 MISCELLANEOUS COMMANDS ______________________ Set ___ SET mode is entered by typing "S" while at the Command level. On entering the SET mode, the following prompt line appears. Set what marker ? When you are editing it is particularly convenient to be able to jump directly to certain places in a long file. The editor enables you to set markers in your file at places of your choosing. Once you have set these markers it is possible to jump to them using the JUMP mode. When the prompt appears, you can enter the name of the marker. You may enter any string up to 8 characters long followed by a . The marker will be entered at the position of the cursor in the text; therefore, first move the cursor to the desired position then set the marker. If the marker already exists you will be asked if you want to reset it by the following prompt: Marker already set, replace marker? (y/n) Environment ___________ ENVIRONMENT mode is entered by typing "E" while at the Command level. On entering the ENVIRONMENT mode the display is replaced by the following prompt. >Environment: {options} [ or to leave] A(uto indent True F(illing False L(eft margin 0 R(ight margin 79 P(ara margin 5 C(ommand ch / T(oken def True H(oriz tab 8 W(orkfile :Fn:DEBIT.DOC 734 bytes used, 6087 available There are several different uses for editing on the computer. Text editing and program editing are the two chief ones. Certain options make it more convenient to write programs while other options make it more convenient to edit text. The editor enables the user to set the environment which the user finds to be the most convenient. When the prompt appears you may change any or all of the options by typing the appropriate letter to select the option. The options shown are the default options which you have upon entering the editor (except for the name of the workfile). Page 12 The Options: A(uto indent: ____________ Auto-indent affects the cursor movement commands, and the INSERT mode of the editor. Auto-indent may be set to True (turned on) by typing "AT". Auto-indent may be set to False by typing "AF". F(illing: ________ Filling affects the INSERT mode and allows the MARGIN command to function. Filling is set to True (turned on) by typing "FT". It is set to False by typing "FF". L(eft margin R(ight margin P(ara margin: When Filling is True the margins set in the Environment are the margins which affect the INSERT mode and the MARGIN command. They also affect the Center and justifying commands in the ADJUST mode. To set the Left-margin type "L" followed by a positive integer. End the integer with a . The positive integer you typed replaces the old value for the L(eft margin in the prompt shown. Setting new values for the other margins is done similarly using the letters "R" and "P". All positive integers with less than four digits are valid margin values, however, the editor does not check that the right margin is greater than the left margin, etc. C(ommand ch: ___________ The Command character affects the MARGIN command and the Filling option in the INSERT mode as described in those sections. You may change Command characters by typing "C" followed by any character. For example typing "C*" will change the Command character to "*". T(oken def: __________ This option affects FIND and REPLACE. Token mode is set to True by typing "TT" and to False by typing "TF". If Token mode is True then FIND and REPLACE will execute in the Token mode, otherwise they will execute in the Literal mode. H(oriz tab: __________ This option specifies the tab expansion on the display. To set the tab size, type "H" followed by a positive integer. End the integer with a . All positive integers with less than four digits are valid, the editor does not check whether the tab size is "reasonable". W(orkfile: _________ Page 13 This option affects the QUIT Update mode. When the editor is first entered, you can specify the name of a workfile, this file becomes the initial contents of the text buffer. When you want to write the contents of the text buffer out, you can write to the workfile without entering it's name again. Verify ______ The VERIFY command is executed by typing "V" while at the Command level. Verify permits you to verify the status of the editor by causing the screen display to be rewritten with the line where the cursor is positioned at the middle of the screen. Quit ____ QUIT mode is reached by typing "Q" while at the Command level. On entering QUIT mode, the following prompt line is displayed: >Quit: E(xit I(nit U(pdate W(rite [ or to leave] You must select one of the options by typing the appropriate letter. E(xit: _____ This causes you to leave the editor without making any changes in the workfile. This means that any modifications you may have made since entering the editor are not recorded. DEBIT will remember if you have performed any operations that could have modfied the text since your last update and will prompt you if you try to exit without having updated a changed file with the following message: Work not saved; ok? (y/n) I(nit: _____ This option causes the current contents of the text buffer to be abandoned, and the editor will reinitialize itself, and it will prompt for the name of a new workfile. This option allows you to edit many different files without leaving the editor. Your old environment settings are carried over after initialization; however, the old markers are meaningless and go away. U(pdate: _______ This causes the workfile to be rewritten. W(rite: ______ This option puts up a further prompt and asks for the output file name. You may write the text buffer to any file of your choosing. If you write to an existing file, the text will replace the old Page 14 file. This option can be aborted by typing a instead of a file name. Aborting will return you to the editor command level. If the Quit mode was entered by mistake, or you want to continue the edit process after updating the workfile or writing out the text buffer to another file, then pressing the space bar or entering the character will return you to the original point within the text buffer before the Quit mode was entered. Page 15 Configuring DEBIT _________________ DEBIT is configured for terminals other than the Hazeltine 1510 (the default) via a "DEBIT.ENV" file (actually "x.ENV" where "x" is whatever you call DEBIT). The form of the file is as follows. If the file begins with "<" the next 26 mystery bytes define various aspects of the terminal. If the file begins with a ">" (or if it begins with "<" followed by the 26 bytes followed by a ">") the following characters (up to 32) are placed in DEBIT's read-ahead buffer. The commands in the read-ahead buffer will be executed as soon as DEBIT comes up. This mechanism will allow you to have DEBIT come up with an environment setting different from the normal default if you place commands to change the environment in the read-ahead part of the ENV file. For example, ">etf " will cause DEBIT to come up with Token mode false. ENV files have been set up for various terminals. Unfortunately you can't use DEBIT to edit them since they contain some funny characters. The best way to create an ENV file with read-ahead information for a terminal other than the 1510 is to take the appropriate ENV file and append read-ahead information to it via the append facility of the ISIS COPY command. Page 16 Details that didn't fit under another Heading _____________________________________________ * Lines must be well formed, ending with a CR-LF sequence (or else a lone LF as generated by the PL/M compiler), with no dangling CR's. * Control characters are displayed as "?". * The key is Control-C. * The key is Rubout. * The key is Control-X. * Since DEBIT is a CRT editor it cannot be run in BATCH mode or with teletypes. DEBIT is located low (at 3200H) to provide as much text space as possible. Page 17