.B1 Block Command The block delimiters are set using the mark beginning and end of block keys from window mode as desribed in section 4.4.1. Only one block may be marked at any time. All block commands may be performed from window to window if such is appropriate. Copy Copy inserts the text of a previously marked block at the current cursor position. The current cursor position may be in the marked block, but only the original block is copied. Delete Delete removes a previously marked block from the text. The cursor is moved to the character following the deleted block. Move Move inserts the text of a previously marked block at the current cursor position. The original marked block is then removed from the text. The current cursor position may not be in the marked block, and an error message is displayed if such an attempt is made. Print Print sends the text of the previously marked block to the default printer. No change is made to the text. Read Unlike the other block commands, read does not act on a previously marked block. Read requests a filename and then inserts the text of that file into the current text at the cursor position. If the file does not exist, an error message is displayed. Write Write requests the name of a file. It then writes the previously marked block of text to that file. No change is made to the text. Beginning Beginning moves the cursor to the character that was previously designated as being the beginning of the block. End End moves the cursor to the character that was previously designated as being the end of the block. Show Show blanks the window in which the block is marked except for the block itself. Further, it moves the cursor to the beginning of the block and accepts only the following keys for input: up one line, down one line, page back, page forward, beginning of text and end of text. The enter/exit menu mode key cancels the block display, the cursor position is not changed and the screen is repainted. .B2 Block Write Write requests the name of a file. It then writes the previously marked block of text to that file. No change is made to the text. .B3 Block Read Unlike the other block commands, read does not act on a previously marked block. Read requests a filename and then inserts the text of that file into the current text at the cursor position. If the file does not exist, an error message is displayed. .B4 Block Show Show blanks the window in which the block is marked except for the block itself. Further, it moves the cursor to the beginning of the block and accepts only the following keys for input: up one line, down one line, page back, page forward, beginning of text and end of text. The enter/exit menu mode key cancels the block display, the cursor position is not changed and the screen is repainted. .C1 5.2 Close Command The Close menu contains the commands used by LSE to finish an editing session with the text of a certain window. Quit The quit command abandons the text in the current window and then closes the current window. If this is the only window open, LSE is ended and control is passed back to the operating system. If there are two windows open, the non-active window becomes the current window. The new current window occupies all of the allotted screen space. If you want to abandon texts in all open windows, you can use the quit command to exit LSE faster. Save The save command writes the text in the current window to the file specified by the current filename and then closes the window. If this is the only window open, LSE is ended and control is passed back to the operating system. If there are two windows open, the non-active window becomes the current window. The new current window occupies all of the allotted screen space. Whenever LSE saves text to a file, it renames the current copy of that file. By default, it renames the current copy to filename.BAK erasing any prvious version of filename.BAK. You have the option of changing the default file extension for the backup file and the option of setting up a backup directory. Continue The continue command writes the text in the current window to the file specified by the current filename. This command does not close the current window or alter the current text in any way. Whenever LSE saves text to a file, it renames the current copy of that file. By default, it renames the current copy to filename.BAK erasing any prvious version of filename.BAK. You have the option of changing the default file extension for the backup file and the option of setting up a backup directory. Next The open next command writes the text in the current window to the file by the current filename. You are then prompted for a filename and the text from this file is loaded into the current window. The cursor is placed at the beginning of the text. Whenever LSE saves text to a file, it renames the current copy of that file. By default, it renames the current copy to filename.BAK erasing any previous version of filename.BAK. You have the option of changing the default file extension for the backup file and the option of setting up a backup directory. Flush The flush command abandons the text in the current window, then prompts you for a filename. The text from this file is loaded into the current window. The cursor is placed at the beginning of the text. Rename The rename command allows you to specify a new name for the file in the current window. The current text is not changed. .C2 Block Next The open next command writes the text in the current window to the file by the current filename. You are then prompted for a filename and the text from this file is loaded into the current window. The cursor is placed at the beginning of the text. Whenever LSE saves text to a file, it renames the current copy of that file. By default, it renames the current copy to filename.BAK erasing any previous version of filename.BAK. You have the option of changing the default file extension for the backup file and the option of setting up a backup directory. Block Flush The flush command abandons the text in the current window, then prompts you for a filename. The text from this file is loaded into the current window. The cursor is placed at the beginning of the text. .C3 Close Rename The rename command allows you to specify a new name for the file in the current window. The current text is not changed. .C4 Block Quit The quit command abandons the text in the current window and then closes the current window. If this is the only window open, LSE is ended and control is passed back to the operating system. If there are two windows open, the non-active window becomes the current window. The new current window occupies all of the allotted screen space. If you want to abandon texts in all open windows, you can use the quit command to exit LSE faster. .c1 This section describes the commands that can be performed using LSE's menu structured command mode. When performing one of these advanced commands, you are unable to enter any characters into your current text. There are two ways to execute these commands starting from window mode. These methods are discussed in detail below. Certain LSE commands have menus to select different functions; others need only line numbers or filenames to accomplish their tasks. All LSE commands and command menus are directly accesible while in window mode by a single keystroke. At any level of an LSE command, you may return to window mode by pressing the enter/exit command mode key. This aborts the command with no command operation performed. You may select an option from an LSE menu in one of two ways. The first way is by moving the field of highlighted video over your selection by using the previous character key (normally a left arrow) and next character key (normally a right arrow) and then entering a carriage return. The second way to make a selection from an LSE menu is to press the letter corresponding to the first character of the selection you want. Some LSE menus provide more information than the single word describing the command to be executed. In these menus, as you move the highlighted video area back and forth with the arrow keys, you will notice the text on the input line (the descriptor line) changing, giving a more complete explanation of what the current command option does. On such menus, you may move the highlighted video area back and forth to see what each command option can do in more detail. When you have decided on the option that you want, you may use either one of the two methods described above for choosing your option. An example of this type of menu structure is the main LSE command menu accessible using the enter/exit command mode key. LSE commands allow for cutting and pasting features, system access, saving and clearing buffers, string and regular expression searches, setting of LSE's editing modes, accessing text by line numbers and restoring the last deleted line. LSE Command Summary COMMAND ACTION Block command cutting and pasting of a marked block Close command close a window, save or abandon text Fork command fork command processor for system tasks Grep command regular expression search Line command go to original line number Mode command LSE mode selection and macro assignment New Line command go to new line number Open command open a second window Quit command exit LSE, abandon text Replace command regular expression search and string replace String command string search Undo command restore last deleted line .c2 The invoke keyboard macro key (normally assigned to F10) causes you to enter a menu requesting you to choose a macro to execute. You may have up to 10 macros loaded at any one time. The macros must have been previously loaded. Control of the editor will return to you after all the keystrokes of the macro have been executed. If you attempt to execute an empty keyboard macro, an error message is displayed. .F1 Regular Expression Search The regular expression search command requests the user for a string in regular expression format. Entry of the string is terminated with a carriage return. Search of the text begins at the current cursor position and continues until a match is found or until the end of the text is reached. If the first character of the search string is a control-[ (i.e., ESC), the search proceeds from the current position backward until a string is matched or until the beginning of the text is encountered. In the event that a match is found, the cursor is moved to the beginning of the matching string. If no matching string is found, the cursor location is not changed and the attempted search string is displayed on the status line. Any regular expression search may be aborted using the enter/exit command mode key. The regular expression format is defined in appendix D. Regular expression searches will take longer than string searches, but do provide more flexibility. Note that a separate search buffer is kept for each open window. String Search The string search command requests the user for a simple string. Entry of the string is terminated with a carriage return. Search of the text begins at the current cursor position and continues until a match is found or until the end of the text is reached. If the first character of the search string is a control-[ (i.e., ESC), the search proceeds from the current position backward until a string is matched or until the beginning of the text is encountered. In the event that a match is found, the cursor is moved to the beginning of the matching string. If no matching string is found, the cursor location is not changed and the attempted search string is displayed on the status line. Any string search may be aborted using the enter/exit command mode key. String searches are faster than regular expression searches but do not provide as much flexibility. Note that a separate search buffer is kept for each open window. .F2 Regular Expression Search and Replace The regular expression search and replace command requests the user for a string in regular expression format and a string in a simpler format described below. Entry of each string is terminated with a carriage return. After the entry of the search and replace strings, you are asked if you want to be prompted before each replace. Search of the text begins at the current cursor position and continues until a match is found or until the end of the text is reached. If the first character of the search string is a control-[ (i.e., ESC), the search proceeds from the current position backward until a string is matched or until the beginning of the text is encountered. In the event that a match is found, the cursor is moved to the beginning of the matching string. If you requested prompting before replacement you will be asked to confirm the replacement of the designated search string with specified replace string. 'Y' confirms the replacement, 'Q' cancels this command and returns you to window mode. Any other character input at the replace prompt is assumed to mean skip this replacement but go on to the next match. If no matching string is found, the cursor location is not changed and the attempted search string is displayed on the status line. Any regular expression search and replace may be aborted using the enter/exit command mode key. The regular expression format is defined in appendix D. The replace format is ASCII string replacement except that '\n' and '\t' are recognized and a double backslash must be used to recognize a single backslash character. Backslash followed by any other character causes both characters to be disregarded. Note that a separate search buffer and a separate replace buffer are kept for each open window. .f1 Fork Command Processor The fork command processor function clears the screen and invokes the command processor, allowing the user to access any needed system function. LSE alters your system prompt by adding an asterisk in front of it. This is to remind you that a copy of LSE is running under the currently loaded command processor. Entering EXIT at the command level will return the user to the current character in LSE. .L1 Entering Text and Commands Entering any one of the 96 printable ASCII characters (hex 20 through hex 7f) will insert that character into the text at the current character position. When in overwrite mode, entering the character overwrites the character at the current cursor position Any other 8-bit character code can be entered into the text by preceding it with the escape character. When entering characters causes the width of the current line to exceed the current window width, the current line is reframed to place the current character in the window. As the column of the current character changes, the current line is reframed to keep the current character position in the window at all times. As soon as the cursor is moved off of the long line, that line is reframed in the window starting at column 1. The maximum width for any line in LSE is 256 characters. Any 8-bit character code not in the 96 printable ASCII character set that is input without being preceded by the escape character will be interpreted by LSE as an attempt to execute a command. If the character code does not map to one of the 48 LSE functions, no action is taken by LSE and control is returned to you in window mode allowing further insertion of text. If the character code matches one of the window mode commands (see section 4 for more information), the command is executed, possibly repositioning the cursor and control is passed back to you for further entry of text. If the character code matches an LSE command, another level of input is requested from you. Many LSE commands go to an LSE menu structure. You may select an option from an LSE menu in one of two ways. The first way is by moving the field of highlighted video over your selection by using the previous character key (normally a left arrow) and next character key (normally a right arrow) and then entering a carriage return. The second way to make a selection from an LSE menu is to press the letter corres- ponding to the first character of the selection you want. Some LSE menus provide more information than the single word describing the command to be executed. In these menus, as you move the highlighted video area back and forth with the arrow keys, you will notice text on the input line (the descriptor line) changing, giving a more complete explanation of what the current command option does. On such menus, you may move the highlighted video area back and forth to see what each command option can do in more detail. When you have decided on the option that you want, you may use either one of the two methods described above for choosing your option. An example of this type of menu structure is the main LSE command menu accessible using the enter/exit command mode key. If the 8-bit non-ASCII character code you input to LSE does not generate menu options but does represent a command, you will be requested by the prompt line for a certain type of input. Examples of this type of input includes a filename, a search (and replace) string or a line number. Any command that requires the text of the current window to be reframed, will put the current line on the fifth line of the window. This is to enable you to see some of the context of the line you are working on. For example, if searching for a certain string causes the text in the current window to be reframed, the line containing the matching string will be placed on the fifth line of the display. At any level of an LSE command, you may return to window mode by pressing the enter/exit command mode key. This aborts the command with no command operation performed. In summary, a single keystroke in LSE is designed to perform a complete command, access a menu structure for further command processing or request further input on the input line to execute the command. There are no multiple keystroke sequences in LSE to accomplish a single command without giving you a menu structure or command prompt to help you. .L2 Macros Macros in LSE consist of a redirection of input from your keyboard to a sequence of characters that has been created using the LSE keystroke saver or from a special file that you have created using LSE. When using the keystroke saver, every keystroke from start to termination of the saver is placed into the buffer of the first available macro. After termination, that macro may be executed and all of the keystrokes will be repeated. This macro may then be saved to a file for further use or for editing of the macro. When editing a file that is to be used as a macro, commands must be coded using a special key-to-string mapping. This mapping is listed in appendix A. To enter the string corresponding to the command, enter the escape character then a '\' and then the command key that you want to be entered as a string into the text. The proper string will be entered as the beginning of the next line of text. There may be 10 macros active at any one time. The default filename extension for a macro is ".def" as defined in LSE.MSG. LSE will search your current for a macro file so that macro files may be kept in the same directory as LSE, if desired. .l1 Go To Original Line Number When a file is loaded into a window, each line is ordered numerically. As text is added or deleted, LSE keeps track of the original line numbers. When the original line number command is executed, you are asked to input the line number that you want to be changed to be the current line number. If the line associated with the number exists, the cursor is moved to the beginning of that line. If the line associated with that number does not exist, the cursor is moved to the smallest line number larger than the requested number and an error message is displayed. .l2 Go To Current Line Number When a file is loaded into a window, each line is ordered numerically. As text is added or deleted, LSE keeps track of the current line numbers. When the current line number command is executed, you are asked to input the line number that you want to be changed to be the current line number. If the line associated with the number exists, the cursor is moved to the beginning of that line. If the number specified is greater than the number of lines in the file, the cursor is moved to the last line of the file and an error message is generated. .M1 Set LSE Mode Menu LSE provides several entry modes to make certain tasks such as assembly language programming easier. These LSE modes provide extra processing for input, special coordination between files or special status line display. When in the LSE mode menu stucture, the current mode selections are displayed on the status line. Input Modes There are five input modes supported by LSE. One is the default mode during which there is no post-processing of input. Three modes are assembly language modes. These modes perform case folding and special character field termination. The final mode is power type (word wrap) mode; in this mode carriage returns are automatically inserted when the screen size width is exceeded by the current line length. The assembly language modes provide for the folding of character input into upper case for one, two or three fields. You are asked to specify the character that initiates a comment for your assembler. In any of the assembly language modes, a colon, space or tab moves the cursor location from the first field into the second field. From the second field, a tab or a space moves to the third field, while the comment character moves to the comment field. From the third field, the comment character moves to the comment field. There is never any case folding after the comment character has been entered. If the comment character is placed in the first field, the entire line is designated as a comment and no case folding occurs. The comment character may be entered into the text without causing a move to the comment field by preceding it with a backslash. Entering the comment character in this way preserves any active case folding. Power type mode is used for non-programming tasks such as preparing documents. When the characters you are entering go past the right margin, the entire last word is moved to the next line and processing continues. Note that no justification is done so the left margin will be ragged. Column There are two column oriented mode features available from LSE. The first is the current column display option of the status line. The second column oriented option is the set tab stop option. For those programming languages where column number has significance, the column display option allows the user to specify display of current column on the status line. This display tends to slow down screen performance as the status line must be updated for every character input, instead of just when the line number changes. When a tab is entered into any LSE text, the hex character 9 is entered into the text. Using the set tab stop option you can change the column to which a tab moves the cursor. The current tab stops are displayed in the status line during the execution of this command. Enter the new tab stops using '.' for spaces and 'T' for the tab stop columns. Default tab stops are read from LSE.MSG and may be changed. Please note that spaces are not inserted in the text so that your window display will not match your hardcopy if it was output on a printer that did not have the same tab stops that you selected for LSE. Error Mode Error mode can be entered in two ways, from the system command line or manually using the LSE set mode menu. Error mode expects the contents of window 2 to be the output of the Lattice C compiler and the contents of window 1 to be the source file that generated that output. LSE will scan the contents of window 2 until an error is found and then position the cursor in window 1 on the line number designated by the error message. Using the next error key, causes LSE to find the next error message in window 2 and frame the line number in window 1. Begin Macro Keystroke Saver There are two ways of creating macros for use by LSE. The first is by using the keystroke saver, the second is by creating a text file with specially coded text for processing commands. When the keystroke saver has been initiated, all subsequent keystrokes will be put into a buffer to be assigned to a macro upon keystroke saver termination. While the keystroke saver is active, the '@' is displayed on the status line. If there is no available macro when this command is selected, an error message is generated. Otherwise, the keystrokes entered are assigned to the first available macro as displayed on the status line. Terminate Macro Keystroke Saver Entering this command ends the keystroke saver. All the keystrokes entered since the begin macro command are now available for execution in a macro with the number displayed on the status line. Save Macro The save macro command lets you specify a file to which you can write a currently active macro. The file that results is an ASCII text file which can be edited using LSE. A macro may be created without using the keystroke saver by creating a text file containing the specially coded text for command keystrokes. The input format of this command is: Macro Number, Filename. Load Macro The load macro command asks you to specify a macro number and a file whose text is to be associated with that macro. The macro is not executed at load time. The input format of this command is: Macro Number, Filename. Flush macro The flush macro command asks you to specify a macro number to be removed from the current macro list. This macro will then be available for reassignment with either the keystroke saver or the load macro command. .M2 Input Modes There are five input modes supported by LSE. One is the default mode during which there is no post-processing of input. Three modes are assembly language modes. These modes perform case folding and special character field termination. The final mode is power type (word wrap) mode; in this mode carriage returns are automatically inserted when the screen size width is exceeded by the current line length. The assembly language modes provide for the folding of character input into upper case for one, two or three fields. You are asked to specify the character that initiates a comment for your assembler. In any of the assembly language modes, a colon, space or tab moves the cursor location from the first field into the second field. From the second field, a tab or a space moves to the third field, while the comment character moves to the comment field. From the third field, the comment character moves to the comment field. There is never any case folding after the comment character has been entered. If the comment character is placed in the first field, the entire line is designated as a comment and no case folding occurs. The comment character may be entered into the text without causing a move to the comment field by preceding it with a backslash. Entering the comment character in this way preserves any active case folding. Power type mode is used for non-programming tasks such as preparing documents. When the characters you are entering go past the right margin, the entire last word is moved to the next line and processing continues. Note that no justification is done so the left margin will be ragged. .M3 Column There are two column oriented mode features available from LSE. The first is the current column display option of the status line. The second column oriented option is the set tab stop option. For those programming languages where column number has significance, the column display option allows the user to specify display of current column on the status line. This display tends to slow down screen performance as the status line must be updated for every character input, instead of just when the line number changes. When a tab is entered into any LSE text, the hex character 9 is entered into the text. Using the set tab stop option you can change the column to which a tab moves the cursor. The current tab stops are displayed in the status line during the execution of this command. Enter the new tab stops using '.' for spaces and 'T' for the tab stop columns. Default tab stops are read from LSE.MSG and may be changed. Please note that spaces are not inserted in the text so that your window display will not match your hardcopy if it was output on a printer that did not have the same tab stops that you selected for LSE. .M4 Save Macro The save macro command lets you specify a file to which you can write a currently active macro. The file that results is an ASCII text file which can be edited using LSE. A macro may be created without using the keystroke saver by creating a text file containing the specially coded text for command keystrokes. The input format of this command is: Macro Number, Filename. .M5 Load Macro The load macro command asks you to specify a macro number and a file whose text is to be associated with that macro. The macro is not executed at load time. The input format of this command is: Macro Number, Filename. .M6 In any of the assembly language modes, a colon, space or tab moves the cursor location from the first field into the second field. From the second field, a tab or a space moves to the third field, while the comment character moves to the comment field. From the third field, the comment character moves to the comment field. There is never any case folding after the comment character has been entered. If the comment character is placed in the first field, the entire line is designated as a comment and no case folding occurs. The comment character may be entered into the text without causing a move to the comment field by preceding it with a backslash. Entering the comment character in this way preserves any active case folding. .M7 Flush macro The flush macro command asks you to specify a macro number to be removed from the current macro list. This macro will then be available for reassignment with either the keystroke saver or the load macro command. .O1 Open a New Window When the open a new window command is executed, you are prompted for a filename for text to read into the new window. The screen area of the current window is split in half and the window is reframed to insure that the current character position of the active window is displayed. The new window is opened and the cursor is placed at the first character position of the new text. If you request the open a new window command when two windows are already open, an error message is displayed and editing continues in the window mode. .U1 Undo Command When the undo command is executed, the current undo buffer is displayed on the status line of the current window and you are prompted as to whether you want that buffer inserted at the current cursor position. The undo buffer can hold only one line at a time and is filled when the memory allocated to hold a line buffer is returned to the operating system. It is designed to be used when a single line has been accidentally deleted.