1 INTRODUCTION A series of Compaq Language Sensitive Editor (LSE) language and operation extension files are included in the examples directory. These are a slightly modified form of extensions used internally by Compaq. The languages are described in Section 2, the operations in Section 3 and some examples in Section 4. How to use and build the extensions is described in Section 5, the operation routines in Section 6 and the commands and keys used to access the extensions in Section 7. ________________________Note ________________________ These extensions are supplied as is and are not supported nor guaranteed to work. Any keys mentioned in the following sections are the keys set up in VT200 mode (they may be the same for VT100 mode). _____________________________________________________ 2 LANGUAGES The following language description files are included. They either describe complete languages or modifications to existing languages. A help file for LATEX is also included. C-SEM-BEGIN-END.LSE MESSAGE.LSE C-SEM-COMMON.LSE MMS.LSE C-SEM-INDENTED-BEGIN-END.LSE RUNOFF.LSE C-SEM-K-R.LSE SDL.LSE CDU.LSE SHELL.LSE DCL.LSE TABLE.LSE HELP.LSE TEXT.LSE HTML.LSE TPU.LSE LATEX.LSE UNKNOWN.LSE MAKE.LSE LATEX_HELPLIB.HLB 1 Details of how to build environment files containing the above languages are described in Section 5. 3 OPERATIONS The operation extensions are supported by the following files. EMACS_SEARCH.TPU XLSE_COMMANDS.TPU XLSE_COMMON_KEYS.TPU RNF_DIFF.TPU XLSE_EDT_LK201_KEYS.TPU XLSE_COMMON.TPU XLSE_EDT_VT100_KEYS.TPU XLSE_EDT.TPU XLSE_LK201_KEYS.TPU XLSE_COMMAND_HELP.HLP The extensions include: - Emacs-style Incremental Search. - Commands and keys to perform and manipulate a buffer comparison with an external file. - Augmented forms of existing LSE operations. For example routine XLSE_READ_FILE augments LSE's READ FILE command in various ways including allowing a wildcarded file-spec to be specified. - Additional tabbing commands, DETAB, RETAB and PRETAB. - Command to manipulate change bars, BARS. - Many other miscellaneous extensions.. For example routine XLSE_TOGGLE_WIDTH supports toggling the screen width between 80 and 132 characters. Some examples are given in Section 4. The routines that perform the various extensions are described in Section 6. The command definitions and key definitions associated with the routines are described in Section 7. Details of how to build a section file containing the extensions are described in Section 5. 2 4 EXAMPLES This section gives examples for some of the extensions. 4.1 Emacs-style Incremental Search An incremental search is initiated by pressing the GOLD-S key and then typing in a search string at the prompt. For example: _Search for:abc As the search string is typed the search is performed incrementally, in this example the first 'a', 'ab' and 'abc' are found. Characters can be deleted from the search string, this will result in a return to previously found points. ________________________Note ________________________ The search prompt will continue to take characters until terminated with a return character. _____________________________________________________ 4.2 Differences The new command DIFF can be used to compare the current buffer and a specified external file. If no file is specified, the default is the latest version of the file in the buffer (which will be the same as the buffer if the buffer has not been modified). For example: DIFF abc.def The comparison is generated by running DIFFERENCES in a sub process. Two windows are used to show the differences, with the differences highlighted by being underlined. The keys GOLD-N and GOLD-P can be used to advance to the next difference or go back to the previous difference. The command EDIFF is used to end a DIFF session. 3 4.3 C Language Extensions The four language definition files with names starting 'C-SEM' modify the C language definition for various different styles. Examples of the different styles for an 'if else if' statement are shown below: a) if ({@expression@}) { {@statement@}... } else if ({@expression@}) { {@statement@}... } b) if ({@expression@}) { {@statement@}... } else if ({@expression@}) { {@statement@}... } c) if ({@expression@}) { {@statement@}... } else if ({@expression@}) { {@statement@}... } 5 BUILDING AND USING THE EXTENSIONS The following files are supplied to build the extensions. XLSE_BUILD.COM XLSE_HELP.BUI XLSE_ENV.BUI XLSE_SECTION.BUI 4 The following files are generated or copied by the build into the build target directory. XLSE_EDTVT100_SECTION.TPU$SECTION LATEX_HELPLIB.HLB XLSE_EDTVT200_SECTION.TPU$SECTION XLSEHELP.HLB XLSE-SEM-INDENTED.ENV XLSE-SEM-K-R.ENV XLSE.ENV The three environment files provide different C language styles and the two section files cater for different terminal types. To build the extensions: 1. Set to a directory containing the extension files 2. Create a target directory for the files generated by the build 3. @XLSE_BUILD 'target directory' The following shows an example of how to start up an extended LSE. The example assumes logical TGT points to the directory containing the built files. $ lse/int=decw- /env=TGT:XLSE.ENV- /section=TGT:XLSE_EDTVT200_SECTION.TPU$SECTION - example.c ________________________Note ________________________ The build uses the currently installed version of LSE which should be the latest version. The build of the section files executes the routines that set up the commands and keys associated with the extensions and then deletes the routines. The build can be modified to set up any user preferences. _____________________________________________________ 5 6 ROUTINES The routines are described in alphabetical order. 6.1 BSJ$SEARCH Provides an "Emacs-style Incremental Search" feature. 6.2 RNF_DO_DIFF Finds differences between the current buffer and a specified file (by default, the previous version of the file in the buffer - the buffer is assumed to represent the next version of the file, if the buffer has not been changed the specified file should not be defaulted). 6.3 RNF_DO_DIFF_END Ends a DIFF session. 6.4 RNF_DO_DIFF_NEXT Moves to the next difference. 6.5 RNF_DO_DIFF_PREV Moves to the previous difference. 6.6 XLSE_ALIGN_LIST Aligns the first non-blank character of the next line directly below the current cursor position. For example, this procedure can be used to easily align a vertical list of routine call arguments: x = routine( argument1, x = routine( argument1, argument2, ---> argument2, argument3, argument3, argument4 ) argument4 ) 6.7 XLSE_ANNOTATE_QUOTATION Annotates text which is being included in a response to a mail message or in a reply in a VAX Notes conference. The annotation takes the form ... xxx> quoted text ... 6 where "xxx" is repeated from a preceding line. Thus, the annotation that is manually entered on the first line of a quotation can be easily duplicated on succeeding lines. If a region has been selected, the entire region is annotated. Otherwise, the current line is annotated. 6.8 XLSE_BREAK_LINE Performs an XLSE_ENTER_LINE (carriage return) operation, leaving the cursor's position unchanged. 6.9 XLSE_CHANGE_BARS ( ; bars_operation ) Manipulates the change bar commands in a RUNOFF, SDML or LaTeX source file: - disables existing change bars (RUNOFF or SDML) - shrinks existing change bars to .75pt (LaTeX only) - restores all change bars - removes all change bars 6.10 XLSE_CHANGE_CASE ( desired_case ) Changes the case of a specified string of characters. If no select range has been set and the cursor is not positioned on the current search string, the current character is assumed. 6.11 XLSE_COMBINE_BUFFERS Appends the buffer in the previous window to the current buffer and deletes the previous buffer. 6.12 XLSE_COMPILE Compiles the TPU Procedure at the current cursor position, if the current buffer contains TPU source. Otherwise, invokes an LSE COMPILE command. Restrictions: - The PROCEDURE and ENDPROCEDURE statements cannot be indented. - This procedure cannot compile itself since it can't delete itself. 7 6.13 XLSE_COMPILE_MODIFIED_BUFFERS COMPILEs all modified, buffers eligible for compilation. 6.14 XLSE_CURRENT_DATE Returns the current date. 6.15 XLSE_DCL_COMMAND ( dcl_command ) Augments LSE's DCL command: - Splits the current window and puts the $CLI window in the upper window. - Adds a "$" to the user's command string. 6.16 XLSE_DELETE_BUFFER Augments LSE's DELETE BUFFER command: - Saves the contents of the current buffer for XLSE_ UNERASE_BUFFER. - Avoids two windows on the same buffer. - Calls RNF_DO_DIFF_END to delete a DIFF comparison buffer. 6.17 XLSE_DUPLICATE_LINE Duplicates the current line. 6.18 XLSE_DUPLICATE_PAGE Duplicates the current page. 6.19 XLSE_ENTER_LINE ( enter_line_qualifier ) Augments LSE's ENTER LINE command: - Does SET INDENTATION CURSOR if the cursor precedes the first non-blank character; otherwise, does SET INDENTATION CURRENT. - Performs automatic indentation. - Mimics wrap-mode automatic insertion of comment characters. 8 6.20 XLSE_ENTER_REPLACE Prompt the user for replacement string and performs the first string replacement. 6.21 XLSE_ERASE_BUFFER Removes all contents of the current buffer. Erased buffer contents can be re inserted (in any buffer) using the XLSE_UNERASE_BUFFER procedure. 6.22 XLSE_ERASE_PAGE Removes all contents of the current page. Erased page contents can be re inserted using the XLSE_UNERASE_PAGE procedure. 6.23 XLSE_ERASE_STRING Erases the current selected string (from a SEARCH or SET SELECT_MARK command). An erased string can be re inserted using the XLSE_UNERASE_STRING procedure. 6.24 XLSE_EXIT Augments LSE's EXIT command: o Disabled in $BUFFERS buffer. o In DECwindows mode ... - Does a WRITE of the current buffer if it has been modified. - Does a DELETE BUFFER. - Does not EXIT. o In CCT mode ... - Does an END REVIEW if a Review session is active. - Clears the message window. - EXITs the editor. 9 6.25 XLSE_EXPAND Augments LSE's EXPAND command: - Limits the search for a placeholder to just the expanded text. - Backs up a single character when the cursor is positioned after a statement separator (e.g., ";" in BLISS). This allows program statements to be more easily added to existing source code. For example, adding an IF statement becomes the following: IF;^E - Backs up over any number of punctuation characters in text-oriented "languages" (e.g., TEXT, SDML). 6.26 XLSE_FILL ( fill_qualifiers ) Augments LSE's FILL command to ensure correct recognition of DCL comments. 6.27 XLSE_FIND_SYMBOL Prompts the user for a FIND/SYMBOL command. 6.28 XLSE_FREE_SCROLL Starts buffer scrolling. This continuous scroll terminates when any key is pressed. The key which terminates the scrolling is not processed. 6.29 XLSE_FIND_MARK ( direction ) Moves the cursor to the "next" unnamed marker. 6.30 XLSE_GOTO_END_OF_COMMENT ( direction ) Positions the cursor at the last line of a major comment block (i.e., a line consisting of a comment character followed by two hyphens). 10 6.31 XLSE_GOTO_FILE ( default_qualifiers ) Augments LSE's GOTO FILE command: - The file-name and file-type default to the name of the current buffer. - A wildcard file-spec can be specified, in which case all matching files are loaded into separate buffers. - A file containing a list of file-specs can be specified (@setname). - Automatically sets special margins for a Pure-Text file. This procedure prompts the user for the file(s) to be edited. 6.32 XLSE_GOTO_INDICATED_FILE ( default_qualifiers ) Augments LSE's GOTO FILE command: - A /INDICATED operation is simulated by picking up the file name and file type at the current position. - A wildcard file-spec can be specified, in which case all matching files are loaded into separate buffers. - A file containing a list of file-specs can be specified (@setname). - Automatically sets special margins for a Pure-Text file. 6.33 XLSE_GOTO_PAGE ( direction ) Moves to the beginning of a buffer page. This procedure differs from LSE's GOTO PAGE command in three ways: - A page is boundary is a buffer line that begins or ends with a form-feed. LSE simply searches for a form-feed. - The top of the page is positioned near the top of the window. LSE positions the top of the page at a random location in the window. - On a workstation, the window is refreshed instead of being scrolled. 11 6.34 XLSE_GOTO_SCREEN ( direction ) Moves the view on the current buffer forward or backward, leaving only two lines of the current view in the new view. This procedure differs from LSE's GOTO SCREEN command in two ways: - The initial position of the cursor within the scrolling region does not affect the number of lines moved. - On a workstation, the window is refreshed instead of being scrolled. 6.35 XLSE_GOTO_TOP_BOTTOM Moves to beginning or end of the current buffer, based on the current direction. 6.36 XLSE_INSERT_LINE Inserts a blank line before the current line. If the cursor is at the beginning of a line, it moves to the beginning of the inserted blank line. Otherwise, the cursor does not move. 6.37 XLSE_INSERT_PLACEHOLDER Inserts a language-specific "TBS" (to be specified) placeholder at the current position. 6.38 XLSE_JOIN_LINES Joins the current buffer line with the next buffer line, leaving a single space between the actual text from the two lines. 6.39 XLSE_LEARN ( exact_option ) Initiates a keystroke "learn mode" that is compatible with the LSE V2 LEARN command. 6.40 XLSE_LINE_IN_ERROR ( direction ) Performs a NEXT ERROR or PREVIOUS ERROR operation, skipping any errors that are on the same source line as the current error. 12 6.41 XLSE_MATCH_PARENTHESIS ( highlight_mode ) Moves the cursor to the character which matches the "parenthesis" character at the current position. The pairs of characters are supported by this procedure: ( ) [ ] { } < > | & ________________________Note ________________________ The unusual "|&" pair of characters are used in Compaq DOCUMENT tag definitions. _____________________________________________________ 6.42 XLSE_MODIFICATION_REMARK Inserts the current modification remark in the current modification history entry. 6.43 XLSE_NEW_MODIFICATION Inserts a new modification history entry at the end of the first comment block containing "Modification History" or "Modified by". 6.44 XLSE_NEXT_BUFFER Maps the "next" buffer into the current window, skipping buffers that are mapped into another window. 6.45 XLSE_NEXT_WINDOW Moves the cursor down one window, stopping at the bottom window. If there is only one window, this procedure splits the screen into two windows and maps the next user buffer into the bottom window. 6.46 XLSE_PREVIOUS_BUFFER Maps the "previous" buffer into the current window, skipping buffers that are mapped into another window. 13 6.47 XLSE_PREVIOUS_WINDOW Moves the cursor up one window, stopping at the top window. If there is only one window, this procedure splits the screen into two windows and maps the previous user buffer into the top window. 6.48 XLSE_QUIT Erases message buffer and QUITs the current editing session. 6.49 XLSE_QUOTE_LSE_BODY Indents and quotes all or part of the template body of an LSE token or LSE placeholder definition. If a region has been selected, the entire region is quoted. Otherwise, only the current line is quoted. 6.50 XLSE_READ_FILE Augments LSE's READ FILE command: - The file-name and file-type default to the name of the current buffer. - The cursor is positioned at the beginning of the inserted file(s). - A wildcard file-spec can be specified, in which case all matching files are inserted into the current buffer. - A file containing a list of file-specs can be specified (@setname). This procedure prompts the user for the file(s) to be inserted. 6.51 XLSE_REPLACE Replaces the search string at the current location with the current replacement string, maintaining the case of the search string (i.e. case-sensitive replacement). 14 6.52 XLSE_REPLACE_AND_SEARCH Replaces the current search string with the current replacement string and then move to the next occurrence of the search string. 6.53 XLSE_REVIEW Augments LSE's REVIEW command. Executes a GOTO REVIEW if a Review session has been started; otherwise, simply executes a REVIEW command. 6.54 XLSE_SEARCH_INDICATED Augments LSE's SEARCH command to support "search for the current select range" or "indicated word". 6.55 XLSE_SET_MARK Sets an "unnamed" marker, which can later be located using XLSE_GOTO_MARK. 6.56 XLSE_SHOW_SYMBOL ( ; symbol_name ) Displays the type and value of one or more TPU symbols. 6.57 XLSE_SILENT_LSE ( lse_command ) Silently executes a single LSE command, trapping and discarding all messages. 6.58 XLSE_SILENT_TPU ( tpu_statement ) Silently executes a single TPU statement, trapping and discarding all messages. 6.59 XLSE_SPACES_TO_TABS ( entire_line_option, log_option ) Replaces sequences of spaces with tab characters. If a region has been selected, the entire region is processed. Otherwise, only the current line is processed and the cursor moves to the beginning of the next line. ________________________Note ________________________ This procedure assumes that tabs have been set every "n" characters, where "n" can be any number. _____________________________________________________ 15 6.60 XLSE_TABS_TO_SPACES ( log_option ) Replaces tab characters with spaces. If a region has been selected, the entire region is processed. Otherwise, only the current line is processed and the cursor moves to the beginning of the next line. ________________________Note ________________________ This procedure assumes that tabs have been set every "n" characters, where "n" can be any number. _____________________________________________________ 6.61 XLSE_TOGGLE_TABS Toggles GRAPHIC_TABS mode for the current window. 6.62 XLSE_TOGGLE_WIDTH Toggles the screen width between narrow format (80 characters) and wide format (132 characters). 6.63 XLSE_UNERASE_BUFFER Inserts the most recently erased buffer contents into the current buffer, leaving the cursor positioned at the beginning of the inserted text. 6.64 XLSE_UNERASE_PAGE Inserts the most recently erased page contents into the current buffer, leaving the cursor positioned at the beginning of the inserted text. 6.65 XLSE_UNERASE_STRING Inserts the most recently erased string into the current buffer, leaving the cursor positioned at the beginning of the inserted text. 16 6.66 XLSE_WRITE_MODIFIED_BUFFERS WRITEs all modified buffers. 7 KEY AND COMMAND DEFINITIONS The commands and keys are set up by routines in the following files. XLSE_COMMANDS.TPU XLSE_COMMON_KEYS.TPU XLSE_EDT_LK201_KEYS.TPU XLSE_EDT_VT100_KEYS.TPU XLSE_LK201_KEYS.TPU The following tables are ordered on the name of the routine that is associated with the key or command definition. The key definitions are the VT200 definitions. Key Expansion GOLD-S DO/TPU bsj$search GOLD-D DO/TPU copy_text(xlse_current_date) GOLD-N DO/TPU rnf_do_diff_next GOLD-P DO/TPU rnf_do_diff_prev ALT/A DO/TPU xlse_align_list GOLD-CTRL/L DO/TPU xlse_change_case(LOWER) GOLD-CTRL/U DO/TPU xlse_change_case(UPPER) GOLD-O DO/TPU xlse_combine_buffers GOLD-C DO/TPU xlse_compile GOLD-$ DO/TPU xlse_dcl_command('') RETURN DO/TPU xlse_enter_line('') * GOLD-RETURN DO/TPU xlse_enter_line('/NOCOMMENT') * F10 DO/TPU xlse_exit * CTRL/E DO/TPU xlse_expand ` DO/TPU xlse_expand 17 GOLD-F DO/TPU xlse_fill('') * GOLD-KP8 DO/TPU xlse_fill('') F20 DO/TPU xlse_find_mark(FORWARD) GOLD-, DO/TPU xlse_find_mark(FORWARD) F19 DO/TPU xlse_find_mark(REVERSE) GOLD-F17 DO/TPU xlse_goto_file('/CREATE') GOLD-I DO/TPU xlse_insert_placeholder GOLD-J DO/TPU xlse_join_lines * F14 DO/TPU xlse_learn(EXACT) GOLD-F14 DO/TPU xlse_learn(NO_EXACT) GOLD-] DO/TPU xlse_match_parenthesis(BOLD) GOLD-[ DO/TPU xlse_match_parenthesis(NONE) GOLD-| DO/TPU xlse_modification_remark GOLD-\ DO/TPU xlse_new_modification F18 DO/TPU xlse_next_buffer * GOLD-DOWN DO/TPU xlse_next_window F17 DO/TPU xlse_previous_buffer * GOLD-UP DO/TPU xlse_previous_window GOLD-Q DO/TPU xlse_quit GOLD-G DO/TPU xlse_read_file GOLD-R DO/TPU xlse_review GOLD-F19 DO/TPU xlse_set_mark GOLD-M DO/TPU xlse_set_mark GOLD-T DO/TPU xlse_toggle_tabs GOLD-W DO/TPU xlse_toggle_width GOLD-F10 DO/TPU xlse_write_modified_buffers Command Expansion DIFF CALL rnf_do_diff EDIFF CALL rnf_do_diff_end END_DIFF CALL rnf_do_diff_end BARS CALL xlse_change_bars COMPILEALL CALL xlse_compile_modified_buffers * QUOTE CALL xlse_quote_lse_body SYMBOL CALL xlse_show_symbol PRETAB DO/TPU xlse_spaces_to_tabs(OFF,ON) RETAB DO/TPU xlse_spaces_to_tabs(ON,ON) DETAB DO/TPU xlse_tabs_to_spaces(ON) WRITEALL CALL xlse_write_modified_buffers 18 ________________________Note ________________________ The commands are VMSLSE syntax commands and cannot be abbreviated. Command and key definitions that change standard commands and keys are indicated by an asterisk character. _____________________________________________________ 19