! LSE$GRAMMAR.TPU !************************************************************************* ! * ! © Copyright 2005 Hewlett-Packard Development Company, L.P. * ! * ! Confidential computer software. Valid license from HP required for * ! possession, use or copying. Consistent with FAR 12.211 and 12.212, * ! Commercial Computer Software, Computer Software Documentation, and * ! Technical Data for Commercial Items are licensed to the U.S. * ! Government under vendor's standard commercial license. * ! * !************************************************************************* ! !++ ! FACILITY: ! VAX Language-Sensitive Editor ! ! ABSTRACT: ! This file contains the Portable/LSE main level grammar syntax. ! ! ENVIRONMENT: ! Portable/LSE ! ! Author: Duane Smith ! ! CREATION DATE: 06-April-1990 ! ! MODIFIED BY: ! ! X3.1 DAS 06-Apr-90 New module ! X3.1-1 WC3 14-Jun-90 Add LSE_SET_REPOSITORY and LSE_SHOW_REPOSITORY ! X3.1-2 DAS 28-Jun-90 Fixed marker global name problem (temporary fix) ! X3.1-3 WCC 18-Jul-90 Add LSE_DELETE_WINDOW ! X3.2 WC3 13-Jul-90 Add lse_set_bell_off ! lse_set_bell_all ! lse_set_bell_broadcast ! lse_set_bell_nobroadcast ! lse_set_cursor_bound ! lse_set_cursor_free ! lse_set_keypad_edt ! lse_set_keypad_eve ! lse_set_pending_delete ! lse_set_nopending_delete ! lse_set_tabs_visible ! lse_set_tabs_novisible ! lse_set_tabs_invisible ! X3.2-1 WCC 23-Jul-90 Add LSE_EXIT ! X3.2-2 WCC 18-Jul-90 Add LSE_DELETE_WINDOW ! X3.2-3 DEC 24-Jul-90 Add CAPITALIZE WORD and CHANGE DIRECTION ! X3.2-4 DAS 26-Jul-90 Change from EVE_EXIT to EXIT ! X3.2-5 WC3 24-Jul-90 Add lse_set_font_big, ! lse_set_font_condensed, ! lse_set_font_little, ! lse_set_font_normal, ! X3.2-6 DEC 25-Jul-90 Add lse_forward and lse_reverse ! X3.2-7 WC3 30-Jul-90 Add lse_set_default_directory ! X3.2-8 WCC 30-Jul-90 Add lse_quote ! X3.2-9 AVH 01-AUG-90 Add lse_two_windows ! ! X3.2-10 WCC 30-Jul-90 Add lse_quote ! X3.2-11 WCC 01-Aug-90 Add lse_indent_left and lse_indent_right. ! X3.2-12 DEC 1-Aug-90 Add lse_uppercase(lowercase)_word ! X3.2-13 DEC 03-Aug-90 Add lse_change_case ! X3.2-14 WCC 14-Aug-90 Add lse_next_error, lse_previous_error and lse_move_by_error ! X3.2-15 NMC 16-Aug-90 Add lse_next_screen and lse_previous_screen. ! X3.2-16 NMC 18-Aug-90 Add lse_next_page, lse_previous_page, ! lse_move_by_page and lse_move_by_screen. ! X3.2-17 LRH 21-Aug-90 Add documentation template ! X3.2-18 LRH 21-Aug-90 Spelling correction C-A-T-E-G-O-R-Y ! X3.2-19 DBH 17-Sep-90 Erase character inversion. ! X3.2-20 NMC 03-Oct-90 Add lse_next_end_of_line, lse_previous_end_of_line ! lse_move_by_end_of_line. ! lse_next_start_of_line, ! lse_previous_start_of_line, ! lse_start_of_line, lse_end_of_line, ! lse_move_by_line. lse_move_by_start_of_line ! X3.2-21 NMC 12-Oct-90 Removed lse_move_by_xxx_line routines. ! X3.2-22 NMC 12-Oct-90 Add lse_next_placeholder, lse_previous_placeholder. ! X3.2-23 NMC 17-Oct-90 Add lse_next_word, lse_previous_word. ! X3.2-24 NMC 18-Oct-90 Added lse_previous_character,lse_next_character, ! lse_move_up, lse_move_down ! X3.2-25 NMC 25-Oct-90 Removed lse_move_by_page, lse_move_by_screen ! X3.2-26 NMC 30-Oct-90 Removed lse_move_by_error ! X3.2-27 AVH 06-Nov-90 Added lse_cancel_mark, lse_show_mark, ! lse_show_mark_list, modified lse_go_to_mark ! X3.2-28 AVH 07-Nov-90 Added lse_undo_enter_comment ! X3.2-29 NMC 26-Oct-90 Added lse_recover_buffer ! X3.2-30 NMC 02-Nov-90 Added lse_enter_text ! X3.2-31 LRH 12-Nov-90 Added lse_undefine_key ! X3.2-32 AVH 15-Nov-90 Added lse_search, lse_search_next, and ! lse_search_wildcard ! X3.2-33 NMC 06-Nov-90 Added lse_enter_line ! X3.2-34 AVH 19-Nov-90 Added lse_enter_space, lse_enter_tab. ! X3.2-35 NMC 19-Nov-90 Changed lse$prompt_string to lse$prompt_number in ! lse_line ! X3.2-36 DAS 19-Nov-90 Fixed lse_enter_line "" to enter null string ! Made enter_text expect unmodifiable ! Internal error in LSE_REVIEW_BUFFER fixed ! X3.2-37 DAS 20-Nov-90 Internal protection violation error in WRITE_FILE ! X3.2-38 AVH 21-Nov-90 Fix bug in CHECK LANGUAGE commands. ! X3.2-39 LRH 28-Nov-90 Added parameter parsed_comment to lse_define_key ! X3.2-40 AVH 29-Nov-90 Add lse_substitute, lse_substitute_exact, ! lse_substitute_wildcard and ! lse_substitute_exact_wildcard. ! X3.2-41 LRH 30-Nov-90 Made lse_undefine_key and lse_show_key opt. param. ! X3.2-44 AVH 29-Nov-90 Added lse_tab & lse_untab. ! X3.2-45 AVH 03-Dec-90 Added lse_enter_special. ! X3.2-46 DAS 26-Nov-90 Internal unmodifiable buffer error in ENTER_LINE ! X2.2-47 LRH 06-Dec-90 Added lse_tpu, lse_lse ! X3.2-48 LRH 09-Dec-90 Add error trap to lse_tpu ! X3.2-49 LRH 09-Dec-90 Add execute_buffer_lse, execute_buffer_tpu ! X3.2-50 NMC 19-Dec-90 Added lse_show_buffer, lse_show_buffer_list ! X3.2-51 AVH 27-Dec-90 Modify lse_cancel_mark to cancel all the markers ! in the current position. ! X3.2-52 DAS 03-Jan-91 Unexpected error LSE$_CANTFNDLN in LSE_GO_TO_SOURCE ! X3.2-53 NMC 07-Jan-91 Fix bug in lse_go_to_source ! X3.2-54 SHE 07-Jan-91 Internal unmodifiable buffer error in READ_LINE. ! Cleaned up 2nd argument to eve$message, and ! changed calls to message to calls to eve$message. ! X3.2-55 WC3 09-Jan-90 Fix unexpected error in lse_erase_next_placeholder ! X3.2-55 LRH 26-Dec-90 Change lse_show_key and lse_show_key_list to ! use lse$show. ! X3.2-56 LRH 09-Jan-91 lse_set_directory_read_only - directory_spec to ! the_response. Fixed lse_set_directory_source ! missing quotes around default_directory. ! X3.2-57 LRH 14-Jan-91 Clean-up of lse$prompt_string; always returns string ! X3.2-58 DEC 13-Jan-91 change go_to{source,review,mark} to goto_* and ! lse_buffer to lse_goto_buffer. ! X3.2-59 DEC 18-Jan-90 lse_goto to lse_goto_mark ! X3.2-60 LRH 25-Jan-90 Changed lse$_buffername to lse$bufferprompt in ! lse_execute_buffer_lse, _tpu ! X3.2-61 NMC 22-Jan-91 Modify olse_goto_source to interrogate current ! buffer list position instead of using current line. ! X3.2-62 AVH 29-Jan-90 Make TPU$_EXITFAIL an expected error in lse_exit. ! X3.2-63 LRH 31-Jan-91 Added lse$commandcancel to lse_create_file ! X3.2-64 LRH 07-Feb-91 Added tpu$_nodefinition to lse_undefine_key ! X3.2-65 LRH 12-Feb-91 Added error message to lse_write_* ! X3.2-66 LRH 12-Feb-91 Make lse_new_buffer have optional arguments ! X3.2-67 GJJ 12-Feb-91 Added error handler for LSE$_NOLANG in ! LSE_NEXT_PLACEHOLDER. ! X3.2-68 AVH 18-Feb-91 Instead of previous replace string, use null as ! the default replace string in SUBSTITUTE. ! X3.2-69 SHE 21-Feb-91 Added LSE$_COMMANDCANCEL to lse_read_file ! X3.2-70 SAA 15-Feb-91 Added lse_enable_grammar and lse_disable_grammar ! X3.2-71 AVH 25-Feb-91 Add [TPU$_NOFILEACCESS] as an expected TPU message ! in lse_write_file. ( LSE_XBUGS - 1217 ) ! X3.2-72 WC3 25-Feb-91 Add a bunch of expected errors ! X3.2-73 SHE 28-Feb-91 Added LSE$_NOLANG to lse_enter_comment_line/block. ! Added LSE$_UNMODIFIABLE and TPU$_NOTMODIFIABLE ! to lse_indent_left/right. ! Added LSE$_NOLANG, LSE$_NOCURPARAGRAPH to lse_align. ! (Some of these also added by edit 72) ! X3.2-74 SAA 01-Mar-91 Added lse_repeat ! X3.2-75 SAA 05-Mar-91 Renamed lse_do to lse_goto_command ! (no functionality changes) ! X1.0 dbh 2-Mar-91 Temporary routine added lse_message to report ! errors occurring in messaged applications. ! X3.2-76 SAA 12-Mar-91 Enhanced lse_execute_buffer_lse to do both CLI ! and LSE commands. Implemented continuation lines. ! X4.0-1 WC3 15-Mar-91 Add LSE_SET_CROSS_REFERENCE ! LSE_GOTO_DECLARATION ! LSE_FIND_OCCURRENCES ! X4.0-2 GJJ 17-Mar-91 Corrected typo in ON_ERROR handler for ! LSE_SAVE_SECTION. ! X4.0-3 DAS 18-Mar-91 Temporary workaround to CLI continuation lines ! X4.0-4 SAA 19-Mar-91 Real fix for continuation lines ! X4.0-5 DBH 19-Mar-91 Removed lse_message. ! X4.0-6 LRH 20-Mar-91 Added lse_help, lse_help_keypad ! X4.0-7 SAA 22-Mar-91 lse_execute_buffer_lse now uses status codes ! returned by lse$do_command ! X4.0-8 SAA 25-Mar-91 lse_execute_buffer_lse: do not halt execution ! ! X4.0-9 SHE 28-Mar-91 Added help topic default to lse_help ! X4.0-10 DAS 8-Apr-91 Help work ! X4.0-11 LRH 09-Apr-91 Added lse_help_indicated ! X4.0-12 WC3 09-Apr-91 Added EXPAND/COLLAPSE support for show buffer/mark ! Changed lse_mark to lse_new_mark, lse_cancel_mark ! to lse_delete_mark. Fix LSE_ENTER_LINE to return ! true instead of lse$_normal ! X4.0-13 WC3 10-Apr-91 Fix LSE_SHOW_BUFFER, LSE_SHOW_MARK, sometimes ! got the mark or buffer name wrong. ! X4.0-14 AVH 29-Apr-91 Changed lse_dcl to lse_cli. ! X4.0-15 DAS 23-Apr-91 Do not pass directory spec in file_selection ! got the mark or buffer name wrong. ! X4.0-16 WC3 29-Apr-91 Many changes to support generalized show lists ! X4.0-17 DAS 2-May-91 No hardcoding "$help". Rewrote help_indicated. ! X4.0-18 SAA 2-May-91 Add lse_compile and fixed an eve$message in ! goto_mark ! X4.0-19 SHE 13-May-91 Fixed SET CLIPBOARD prompt default value. ! X4.0-20 DAS 14-May-91 Focus/view source cantoverview expected error ! X4.0-21 SHE 15-May-91 Change lse_show_mark to output a mark-specific ! message when no markers have been set yet. ! X4.0-22 WC3 15-May-91 Portable language consistency ! X4.0-23 SAA 21-May-91 More portable language consistency ! X4.0-24 SAA 24-May-91 Fixed lse_set_font attribute and header ! X4.0-25 WC3 24-May-91 Add lse_set_repository back ! X4.0-26 DAS 27-May-91 Changed *.* to unspecified to work on ULTRIX ! X4.0-27 SAA 31-May-91 Fix lse_lse error handler ! X4.0-28 SHE 03-Jun-91 Add call to lse$$resize_windows from lse_set_height. ! Added minimum value for SET HEIGHT parameter. ! X4.0-29 AVH 06-Jun-91 Fix bug in lse_check_language_definitions and ! lse_check_language_help routines. ! X4.0-30 DBH 10-Jun-91 Fix lse_find_occurences and lse_goto_declaration. ! X4.0-31 SHE 11-Jun-91 lse$$widget_set_find_direction renamed to ! lse$$widget_set_search_direction. ! ! X4.0-32 WC3 13-Jun-91 Prompting consistency ! X4.0-33 DAS 16-Jun-91 Fix default language in LSE_CHECK_LANGUAGE_* ! X4.0-34 SHE 18-Jun-91 Changed lse_help to give an error message on ! an invalid help topic, and to allow help ! topics other than commands. ! Fixed lse_set_cursor to handle an unspecified ! parameter. ! ! X4.0-35 WC3 19-Jun-91 Fix order of parameters in REMOVE_KEY_MAP in ! lse_set_keypad ! X4.0-36 DAS 21-Jun-91 Check for existance of VMS_LSE/LSE when setting ! the language on the prompt buffer ! X4.0-37 DAS 30-Jun-91 Fix unexpected error in COLLAPSE and change calls ! using ERROR to use ERROR_TEXT ! X4.0-38 SHE 1-Jul-91 Added lse_save_as ! Removed brackets from bracketed text that looked ! like undefined tags to DOCUMENT ! Modified lse_set_height to call lse$$resize_windows ! only in non-decwindows mode. ! X4.0-39 WC3 13-Jun-91 Prompting consistency ! X4.0-40 WC3 11-Jul-91 Keymap manipulation for command and list_buffer ! buffers ! Check language existance befre setting ! X4.0-41 LRH 12-Jul-91 help_indicated - added check for library = "" ! X4.0-42 SHE 16-Jul-91 Added lse_set_primary_selection_model. ! X4.0-43 SHE 18-Jul-91 Fixed lse_quit to quit when there aren't modified ! buffers ! ! X4.0-44 WC3 19-Jul-91 Add poor mans SCA integration via global select ! X4.0-45 WC3 22-Jul-91 Complete the poor mans SCA integration via global ! select to include better error handling ! ! X4.0-46 AVH 22-Jul-91 Added lse$_subtypedef as a default in prompting for ! all types of substitute commands. ! X4.0-47 WC3 22-Jul-91 No longer use EVE$PROCESS_COMMAND ! ! X4.0-48 DAS 23-Jul-91 Removed commented out ON_ERROR ! X4.0-49 DAS 24-Jul-91 Comment out use of LSE$_NOCRFMSG ! X4.0-50 WC3 25-Jul-91 Put LSE$_NOCRFMSG back ! X4.0-51 WC3 26-Jul-91 Fix LSE_EXIT so TPU won't prompt about buffers ! to be writter. TPU doen't know how to prompt. ! ! X4.0-52 WC3 26-Jul-91 KP4 and KP5 at the search prompt ! ! X4.0-53 AVH 26-Jul-91 Fix direction problem in SEARCH DIALOG box. ! X4.0-54 WC3 06-Aug-91 Fix SAVE FILE's read oinly directory prompt to ! use the user's input if supplied. ! X4.0-55 WC3 07-Aug-91 Make '*' default for goto buffer ! X4.0-56 DBH 08-Aug-91 Latent repo support; Cref get lse$integrated test. ! X4.0-57 SHE 08-Aug-91 Modified lse_close_file to display an error message ! for CLOSE FILE on a buffer without an output file ! X4.0-58 DAS 09-Aug-91 Cleanup compilation errors ! X4.0-59 WC3 12-Aug-91 Remove use of eve$parser_dispatch ! X4.0-60 WC3 14-Aug-91 Added some info for the writers ! X4.0-61 DAS 18-Aug-91 Unexpected LSE$_NOSELECT in LSE_ALIGN ! X4.0-62 DAS 18-Aug-91 Unexpected LSE$_PLCHNOTDEF in LSE_EXPAND ! Unexpected LSE$_FILEREADFAIL in LSE_OPEN_FILE ! X4.0-63 SHE 20-Aug-91 Use lse$$get_paste_buffer_name for cut/paste operations ! X4.0-64 DAS 21-Aug-91 Call LSE$HELP_TEXT instead of HELP_TEXT ! X4.0-65 LRH 21-Aug-91 Fix open file selected problem where message ! appears when selecting empty file. ! X4.0-66 WC3 22-Aug-91 Use EVE_DO in lse_goto_command for V3.1 ! compatibiliity so that RECALL would work ! X4.0-67 LRH 27-Aug-91 Added lse_help_key, lse_quote_key ! X4.0-68 SHE 30-Aug-91 Fixed lse_show_key to handle a bogus key name ! such as CTRK/K. ! Modified lse_goto_mark to just use the current ! window, which is the 3.1 behavior. ! X4.0-69 SHE 03-Sep-91 Fixed typos of lse_spawn and ! lse_save_environment_changes ! X4.0-70 LRH 03-Sep-91 Moved lse$$keypad code into lse_help_keypad ! X4.0-71 LRH 09-Sep-91 lse_quote no longer calls eve$quote, changed ! lse_quote_key to lse_quote_keyname ! X4.0-72 DBH 10-Sep-91 Added errors for nonintegrated environment. ! X4.0-73 WC3 11-Sep-91 Add lse_new_learn_key ! X4.0-74 WC3 12-Sep-91 Put quotes around the key name in lse_new_learn_key ! ! X4.0-75 LRH 13-Sep-91 Fix close buffer to not delete when save_file fails ! X4.0-76 DAS 16-Sep-91 StreamLF this file ! X4.0-77 SHE 18-Sep-91 Added menu customization commands ! ! X4.0-78 WC3 18-Sep-91 LSE_EXECUTE_BUFFER_LSE no longer saves and ! restores the command language setting ! ! X4.0-79 DBH 18-Sep-91 Added lse_close_all. ! X4.0-80 DBH 19_Sep-91 Fix to lse_close_all. ! X4.0-81 DAS 20-Sep-91 Change LSE$_MNEMONIC_PROMPT to LSE$_MNEMONICPROMPT ! X4.0-82 DBH 20-Sep-91 lse_close_all moved to lse$grammar_util as lse$close_buffer_all ! X4.0-83 SHE 25-Sep-91 Fixed return value of lse_set_menu_mnemonics. ! X4.0-84 LRH 24-Sep-91 Fixed internal error bug in lse_set_directory_close ! lse_set_number_windows. ! X4.0-85 AVH 01-Oct-91 Fixed XBUG 1432 - change lse$_dclcmdprompt to ! lse$_cliprompt & lse$_dclcmddef to lse$_clicmddef. ! X4.0-86 DBH 11-Oct-91 Fix lse_close_buffer always returned false, ! lse_close didn't return any status... ! X4.0-87 DAS 13-Oct-91 LSE$WRITE_FILE returns TPU$_CLOSEOUT if dev full ! X4.0-88 SHE 18-Oct-91 Renamed VMS_LSE to VMSLSE ! Added lse_view_file ! X4.0-89 SAA 21-Oct-91 Minor changes to lse_help and lse_help_indicated ! X4.0-90 WC3 18-Oct-91 Add LSE_SHOW_SYSTEM_BUFFER and modify SHOW BUFFER ! to only display user windows. ! X4.0-91 SAA 25-Oct-91 Added ULTRIX help lookup to lse_help_indicated ! X4.0-92 DAS 27-Oct-91 Missing LOCAL CHOSEN_BUFFER ! Missing LOCAL FACILITY_INDEX ! Missing LOCAL LOCAL_OPTION ! Missing LOCAL OUT_NAME ! Missing LOCAL OPEN_FAILED ! X4.0-93 DAS 28-Oct-91 Unexpand when nothing to unexpand was suppressing ! the error message. I saw this the other day ! when debugging the gold/ctr/e twice problem. ! While testing, the error unmodifiable was not ! being anticipated and caused an unexpected error. ! X4.0-94 DBH 23-Oct-91 Added lse_fetch_element. ! x4.0-95 DBH 31-Oct-91 Doc header mods for lse_new_file. ! X4.0-96 SHE 31-Oct-91 Modified NOTNEARBY error handling for ! lse_erase_next/prev_placeholder ! Added error trap for LSE$_NOCMSCREATE is lse_new_file ! X4.0-97 WC3 31-Oct-91 Correct double prompt on exit for file name of ! modified writable buffers without an output file ! X4.0-98 LRH 05-Nov-91 Removed check for language in find_occurrences ! X4.0-99 SHE 06-Nov-91 Removed lse_other_window. ! X4.0-A1 NMC 7-Nov-91 Suppress prompting in mips for ATTACH. ! X4.0-A2 NMC 12-Nov-91 Default for SAVE AS ! X4.0-A3 SHE 13-Nov-91 Removed eve$message from OTHERWISE clauses of ! error traps in lse_open_file and lse_open_ ! selected_file ! X4.0-A4 LRH 13-Nov-91 Changed show buffer check for user bufffer to ! be > 3 ! X4.0-A5 WC3 12-Nov-91 Re-write SEARCH ! X4.0-A6 WC3 13-Nov-91 Add missing learn aborts ! Remove replace string default in substitute ! X4.0-A7 SAA 17-Nov-91 Changes to lse_help, _help_indicated, and _help_keypad ! X4.0-A8 SHE 21-Nov-91 Fixed unexpected internal errors. ! ! X4.0-A9 WC3 15-Nov-91 Renumber lines at REVIEW time. ! Remove lse_change_direction ! Change wildcard to pattern ! Change lse_set_directory_close to lse_set_directory_readonly ! Fix internal error in lse_erase_comment ! Use a flag to suppress LSE_LSE from resetting the ! command language when LSE_SET_COMMAND_LANGUAGE ! is called. ! Add VMSLSE and LSE as options for SET COMMAND LANG ! Change lse_show_prompt to lse_show_prompt_attributes+ ! Change lse$$k_pkeypad_vmscli to lse$$k_pkeypad_vmslse ! X4.0-AA SAA 22-Nov-91 in lse_enable_grammar, assign '' to help library ! if none specified. ! X4.0-AB WC3 25-Nov-91 Fix the output variable of lse_show_prompt_attributes ! X4.0-AC SAA 22-Nov-91 In lse_enable_grammar, assign '' to help library ! if none specified. ! X4.0-AD SAA 25-Nov-91 Fix lse_help 'unknown topic' bug. ! Change lse_enable_grammar to lse_enable_grammar_prefix. ! Change lse_disable_grammar to lse_disable_grammar_prefix. ! X4.0-AE SAA 27-Nov-91 Changes to lse_set_directory_default and ! lse_set_directory_readonly. ! X4.0-AF LRH 10-Dec-91 Add check for overview lines to lse_spell ! X4.0-B0 SAA 12-Dec-91 Formatting changes to lse_help_keypad. ! X4.0-B1 SHE 13-Dec-91 Removed empty EXAMPLE header fields ! X4.0-B2 WC3 16-Dec-91 Make lse_comple default w/o prompting ! Add lse_compile_review ! Fix defaulting in lse_close_file ! Use message file for parameter to lse_set_buffer_close ! X4.0-B3 DBH 18-Dec-91 Add branchname, comment to lse_*_element commands. ! X4.0-B4 DBH 20-Dec-91 Make the_file be a string type in repo cmds. ! X4.0-B5 WC3 19-Dec-91 Fix lse_help to tell the difference between a ! failed and aborted parse ! Don't pass lse$$search_string directly to prompt ! routine so it doesn't become unspecified ! ! ! X4.0-B6 LRH 19-Dec-91 Added check in set_command_lang for vmslse on ultrix ! X4.0-B7 WC3 03-Jan-91 Separate command prompt display from data ! X4.0-B8 NMC 7-Jan-92 Add error trap LSE$_NOPSEDELIM to lse_focus ! X4.0-B9 SHE 16-Jan-92 Modified lse_align's comments to be ADA comments ! since C comments mess up documentation generation. ! X4.0-BA SAA 17-Jan-92 Installed Walt's fix to lse_help ! X4.0-BB WC3 20-Jan-92 Enhance LSE_EXPAND to goto the next placeholder ! when the expansion is off screen. ! X4.0-BC WC3 23-Jan-92 Add LSE$_INVFILNAM as an expected error in ! LSE_SAVE_FILE ! X4.0-BD WC3 27-Jan-92 Remove LSE$$SEARCH_HOW_EXACT and use ! LSE$$X_SEARCH_HOW_EXACT we were using 2 globals ! for the same thing and they were out of sync. ! X4.0-BE WC3 27-Jan-92 Take language req out of GOTO DECLARATION ! X4.0-BF WC3 27-Jan-92 Add TPU$_NOGBLSELDATA SCA commands ! X4.0-C0 WC3 27-Jan-92 Fix SPAN_SPACE support ! X4.0-C1 WC3 31-Jan-92 Protect window manipulation from begin in the ! command or prompt window. ! Add LSE$_PLCHNOTDEF as an expected error in ! lse_enter_comment ! X4.0-C2 SHE 31-Jan-92 Fix unexpected lse$_unexpandbuf in lse_delete_expand. ! Added TPU$_WRITEERR to SAVE commands. ! X4.0-C3 SAA 7-Feb-92 Fixed lse_help so all help libs treated equally. ! X4.0-C4 WC3 11-Feb-92 Remove prefix parameter from LSE_HELP ! X4.0-C5 WC3 12-Feb-92 Fix internal error when first time to ! pattern search prompt. ! X4.0-C6 WC3 13-Feb-92 Unexpected error ! X4.0-C7 DEC 18-Feb-92 Fixed up docs and parameter names ! X4.0-C8 SAA 18-Feb-92 Fixed "prefix" variable in LSE_HELP ! X4.0-C9 SHE 20-Feb-92 Make lse_exit do file backups. ! X4.0-CA SAA 20-Feb-92 Fixed help_topic_wild in LSE_HELP ! X4.0-CB AVH 20-Feb-92 Fixed help_topic_wild in LSE_HELP ! X4.0-CC SHE 21-Feb-92 Fixed / tags around a ! DESCRIPTION. ! X4.0-CD WC3 21-Feb-92 Fixed LSE_DELETE_WINDOW to delet the right one ! X4.0-C1 above broke it. ! Corrected uses of TPU$_NOTMODIFIABLE for the ! conversion from !AF to !AS ! X4.0-CE WC3 22-Feb-92 Correct doc build problems. ! X4.0-CF WC3 24-Feb-92 Unexpected error in lse_open_selected ! Don't do line/column positioning in ! lse_open_selected when STRING request works ! Make reserve element and replace element ! documented commands ! X4.0-D0 SHE 26-Feb-92 Modified lse_set_directory_default to do a ! file_parse on Ultrix to that ~'s get expanded ! X4.0-D1 DBH 25-Feb-92 CMS and SCCS source control cli interfaces. ! X4.0-D2 WC3 27-Feb-92 Add lse_set_prompt_expandmenu ! X4.0-D3 SHE 28-Feb-92 Fixed lse_substitute to set subs_type to unspec ! when substitute_type is unspecified ! Added else clauses to some lse$prompt_list calls ! X4.0-D4 SAA 1-Mar-92 fixed CMS commands to execute lse$post_command_proc ! X4.0-D5 SAA 2-Mar-92 told lse_enable/disable_grammar_prefix to shut up. ! X4.0-D6 WC3 4-Mar-92 ERASE PLACEHOLDER call post command processing ! Teach ERASE PLACEHOLDER to goto the next placeholder ! when text isn't visible. ! Fix unexpected error in lse_goto_source ! X4.0-D7 SAA 6-Mar-92 fix lse_help for case of valid command but no help library. ! X4.0-D8 WC3 9-Mar-92 Change message for find occur and goto decl not ! begin able to talk to sca ! X4.0-D9 SAA 10-Mar-92 Fix lse_help's handling of ambiguous parses ! X4.0-DA WC3 10-Mar-92 Change X4.0-D8 literal to a message ! X4.0-DB WC3 16-Mar-92 Doc build errors ! X4.0-DC SHE 6-Apr-92 Don't call lse$$unexpected_error from CONTROLC ! Moved compilation work into lse$$compile_buffer, ! and added show support for compilation results ! X4.0-DD SHE 17-Apr-92 Added lse_plse. Allow SET COMMAND LANGUAGE PLSE. ! Changed VMSLSE to LSE; Added LSE to PLSE. ! Added EXECUTE BUFFER PLSE. Fixed internal error ! on NEW LEARN KEY within definition of another ! learn ssequence. ! X4.0-DE WC3 27-Mar-92 Don't use POSITION( # ) in LSE_EXECUTE_BUFFER ! cause it is N^2 for performance. ! X4.0-DF SHE 25-Apr-92 Added lse_set_save_related_buffers ! X4.0-E0 DEC 26-Apr-92 Add enable/disable_vms_integration_commands ! X4.0-E1 SHE 27-Apr-92 Filled in doc header for set_save_related_buffers ! X4.0-E2 DEC 29-Apr-92 Fixed internerr in expand on terminal placs w/ no body ! X4.0-E3 SHE 29-Apr-92 Added Category for SET SAVE RELATED BUFFERS ! X4.0-E4 WC3 27-Apr-92 SEARCH w/span space set with no spaces in the ! string failed ! X4.0-E5 WC3 08-May-92 Added missing local declarations ! X4.0-E6 SHE 11-May-92 Added Save Related Buffers to Save Section docs ! X4.0-E7 SHE 13-May-92 Modified documentation cut, cut append, copy, and ! copy append; also COMPILE documentation ! X4.0-E8 SHE 14-May-92 Modified documentation for NEW MENU LABEL ! X4.0-E9 DEC 21-May-92 Add nullplacdef and nulltokdef error conditions ! to lse_expand ! X4.0-EA SHE 02-Jun-92 Moved code in lse_spell to superseded version of ! eve_spell ! X4.0-EB SHE 05-Jun-92 Added VMS INTEGRATION commands as related commands ! for reserve, etc., and find occurrences, etc. ! X4.0-EC SHE 10-Jun-92 Enable cms bindings under ENABLE VMS INTEGRATION ! X4.0-ED SHE 25-Aug-92 Modified lse_repeat to use eve$x_repeat_* arrays ! and lse's utilities for access the arrays. ! X4.0-EE SHE 26-Aug-92 Modified lse_repeat to detect failed commands ! X4.0-EF SHE 27-Aug-92 Removed remaining "eve$x_repeat_count := 1" ! X4.0-F0 WC3 24-Sep-92 at end of ambiguous prompt during HELP ! ! ! X4.3-1 RKB 05-Jul-94 Added support for UNDO, REDO, SET MAX_UNDO ! X4.3-2 RKB 13-Oct-94 Add jacket routine for lse_position_cursor ! X4.3-3 RKB 24_oct-94 Add UNDO support to search string ! X4.3-4 RAM 05_Dec-94 Update ident and haley headers ! X4.3-5 RKB 05-Jan-95 Save undo command for move word ! Add UNDO support for CENTER LINE ! Changes to lse_position_cursor ! RKB 06-Feb-95 Fix warning message appearing LSE_CENTER_LINE ! RKB 09-Feb-95 Resetting UNDO buffers in LSE_TPU ! RKB 15-Feb-95 Reset UNDO buffers when setting OVERSTRIKE ! RKB 15-Feb-95 Reset UNDO buffers when any of the following commands ! is executed, since UNDO is not supported for them ! - COLLAPSE ! - ENTER COMMENT ! - ERASE COMMENT ! - DELETE EXPAND ! - OVERVIEW SOURCE ! - VIEW SOURCE ! - FOCUS ! RKB 16-Feb-95 Add call to SAVE old and new BPMs in NEXT PLACEHOLDER ! Save current position when INSERT mode is set for the ! the buffer (changed from OVERSTRIKE to INSERT) ! RKB 22-Feb-95 Add call to reset buffers in toggle insert & overstrike ! 4.4-2 RKB 07-Jun-95 Remove the reset all undo buffers message ! 4.4-2 RKB 22-Jun-95 Wishlist item # 294 - Position to beginning of buffer ! in lse_quit before quitting. ! 4.4-2 RKB 22-Jun-95 Wishlist item # 295 - Close $REVIEW buffer before ! recompiling source buffer ! 4.4-3 RKB 17-Jul-95 Add undo support for overview related commands ! 4.4-2 RKB 10-Aug-95 Correct value of record count in lse_position_cursor ! 4.4-3 RKB 23-Aug-95 LSE_XBUGS # 2148 - View file makes readonly buffer ! modified ! 4.4-3 RKB 15-Sep-95 Add LSE_ERASE_NUM_CHARS (erase number of characters ! at current position in the buffer) ! 4.4-3 RKB 13-Oct-95 Check for illegal value for max_undo, LSE_XBUGS # 2194 ! 4.4-4 RKB 06-Dec-95 Fix LSE_XBUGS # 2195 - Accvio searching a file in ! two windows ! 4.5-1 CJH 14-Aug-96 DECset V12.2 GUI Enhancements ! 4.5-1 CJH 15-Nov-96 Fix LSE_XBUGS 2207 ! Disable calls to undo code during execution of ! user TPU code. ! 4.6-1 JBL 10-Nov-97 Add commands SET TABS_HARD and SET UNDO ! Fix LSE_XBUGS 2239 ! ! NOTE - FOR ADDING PROCEDURES ! ! The following is a documentation template which is used with PDF to ! create documentation. When creating a new procedure, copy the template ! above the procedure. The information will be supplied by the documentation ! group. ! !doc_begin ! ! ONE LINE DEFINITION: ! «TBS» ! ! DESCRIPTION: ! «TBS» ! ! RELATED COMMANDS: ! «TBS» ! ! EXAMPLE: ! «TBS» ! ! CATEGORY: ! «TBS» ! !doc_end ! procedure lse$grammar_module_ident return "4.9-0"; endprocedure; procedure lse_align (;column) ! !doc_begin ! ! ONE LINE DEFINITION: ! Aligns trailing comments within the current selected range. ! ! DESCRIPTION: ! (ALIGN) ! This command operates on each line in the range in sequence. For ! each line, LSE checks to see whether the line has a trailing comment. ! Note that the buffer must be associated with a language. ! LSE uses the language definitions to determine what are comments. !

! If a line does not have a trailing comment, it proceeds to the ! next line. If there is a ! trailing comment, then LSE either inserts or deletes ! spaces or tabs as necessary to get the comment to align. If ! there is no room for the comment on the line (that is, if the ! noncommented text extends beyond the comment column), then the ! comment is aligned one space after the end of the noncommented text. !

! The default column number is determined from the language associated ! with the buffer. ! ! RELATED COMMANDS: ! FILL ! SET LANGUAGE TRAILING COMMENTS ! ! EXAMPLE: ! ! The following text is a sample of commented code: ! ! ! -- This is the first line of comments. ! if a:=b: ! -- This is the second line of comments. ! -- This is the third line of comments. -- ! ! !

! If the default column number is associated with the first commented ! line, the ALIGN command rearranges the text as follows: ! ! ! -- This is the first line of comments. ! if a:=b: ! -- This is the second line of comments. ! -- This is the third line of comments. ! ! ! ! CATEGORY: ! Text ! !doc_end ! local column_number; ON_ERROR [LSE$_NOLANG, LSE$_NOCURPARAGRAPH, LSE$_NOSELECT]: eve$message( ERROR_TEXT ); lse$post_command_proc; eve$learn_abort; RETURN FALSE; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_align "); ENDON_ERROR; if lse$prompt_number (column, column_number,'','',-1) then lse_align := lse$align(column_number); else lse_align := FALSE; endif; lse$post_command_proc; endprocedure; procedure lse_attach (;process_name) ! !doc_begin ! ! ONE LINE DEFINITION: ! Allows you to switch control of your terminal to another process. ! ! DESCRIPTION: ! (ATTACH) ! If you do not specify a process name, LSE connects you to the ! parent process. ! ! RELATED COMMANDS: ! SPAWN ! ! CATEGORY: ! Editing ! !doc_end ! LOCAL the_response; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_attach "); ENDON_ERROR; if eve$x_ultrix_active AND (process_name = tpu$k_unspecified) then process_name := ""; endif; if lse$prompt_string( process_name, the_response, lse$_prcnamprompt, '', lse$get_message_text( lse$_prcnamdef ) ) then lse_attach := eve_attach (the_response); else lse_attach := false; endif; lse$post_command_proc; endprocedure; procedure lse_balance_windows ! !doc_begin ! ! ONE LINE DEFINITION: ! Resizes all user windows on the screen to the same size. ! DESCRIPTION: ! (BALANCE WINDOWS) ! ! RELATED COMMANDS: ! SET BALANCE WINDOWS ! SET MAXIMUM WINDOWS ! SET MINIMUM WINDOW LENGTH ! SHOW WINDOW ATTRIBUTES ! ! CATEGORY: ! Screen ! !doc_end ! ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_balance_windows"); ENDON_ERROR; lse_balance_windows := lse$$balance_wind_always; lse$post_command_proc; endprocedure; procedure lse_bottom ! !doc_begin ! ! ONE LINE DEFINITION: ! Moves the cursor to the end of the current buffer. ! DESCRIPTION: ! (BOTTOM) ! ! RELATED COMMANDS: ! TOP ! ! CATEGORY: ! Cursor ! !doc_end ! ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_bottom"); ENDON_ERROR; ! ! Save OLD BPM for UNDO ! lse$$save_old_bpm; lse_bottom := lse$bottom; ! ! Save NEW BPM for UNDO ! lse$$save_new_bpm; lse$post_command_proc; endprocedure; procedure lse_goto_buffer (;buffer_name ) ! !doc_begin ! ! ONE LINE DEFINITION: ! Moves the specified buffer to the current window. ! ! DESCRIPTION: ! (GOTO BUFFER) ! This command moves the cursor to the last editing ! position in the specified buffer. ! ! RELATED COMMANDS: ! NEXT BUFFER ! NEW BUFFER ! PREVIOUS BUFFER ! ! CATEGORY: ! Screen ! !doc_end ! local buffer_ptr, saved_buffer, saved_window; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_goto_buffer "); ENDON_ERROR; ! ! Get the buffer pointer either from the argument or from the user. ! If the user doesn't enter anything, loop until something is entered. ! if lse$prompt_existing_buffer( buffer_name, buffer_ptr, lse$_bufferprompt, '', '*') then if lse$is_user_window( current_window ) then ! We are in a user window, just do it ! lse_goto_buffer := lse$buffer_util(buffer_ptr); else ! We are not in a user window, i.e. the command, prompt, message window ! So save and unmap to get the the "right" user window ! if NOT lse$is_user_window( current_window ) then ! We still aren't in a user window. So use the first window ! position( eve$$x_windows{1} ); lse_goto_buffer := lse$buffer_util(buffer_ptr); else saved_window := current_window; saved_buffer := get_info( saved_window, 'buffer' ); unmap( current_window ); lse_goto_buffer := lse$buffer_util(buffer_ptr); map( saved_window, saved_buffer ); endif; endif; else lse_goto_buffer := false; endif; lse$post_command_proc; endprocedure; procedure lse_new_buffer (;new_buffer_name) ! !doc_begin ! ! ONE LINE DEFINITION: ! Creates a new buffer in the current window. ! ! DESCRIPTION: ! LSE copies the attributes from the $DEFAULTS buffer to the new buffer. ! (NEW BUFFER) ! ! RELATED COMMANDS: ! GOTO BUFFER ! NEW FILE ! OPEN FILE ! SHOW BUFFER ! NEXT BUFFER ! PREVIOUS BUFFER ! ! CATEGORY: ! File ! !doc_end ! local buffer_ptr; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_new_buffer "); ENDON_ERROR; if lse$prompt_create_buffer ( new_buffer_name, buffer_ptr, lse$_bufferprompt ) then lse_new_buffer := lse$buffer_util(buffer_ptr); else lse_new_buffer := false; endif; lse$post_command_proc; endprocedure; procedure lse_capitalize ! !doc_begin ! ! ONE LINE DEFINITION: ! Capitalizes the first letter of the current word, or all words in ! the selected range. ! ! DESCRIPTION: ! (CAPITALIZE) ! If a word is in uppercase letters, this command changes all but ! the first letter to lowercase. The cursor then moves to the first letter ! of the word following the target word or selected range. ! ! RELATED COMMANDS: ! CHANGE CASE ! LOWERCASE ! UPPERCASE ! ! CATEGORY: ! Text ! !doc_end ! ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_capitalize"); ENDON_ERROR; lse_capitalize := eve_capitalize_word; lse$post_command_proc; endprocedure; procedure lse_center_line ! !doc_begin ! ! ONE LINE DEFINITION: ! Centers the current line between the left and right margins. ! ! DESCRIPTION: ! (CENTER LINE) ! ! RELATED COMMANDS: ! SET BUFFER LEFT MARGIN ! SET BUFFER RIGHT MARGIN ! ! CATEGORY: ! Text ! !doc_end ! local old_line_str, new_line_str, new_line_range, the_position; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_center_line"); ENDON_ERROR; ! ! Save the current line in a string for the SUBSTITUTE command ! the_position := mark (NONE); IF (the_position = end_of(current_buffer)) THEN old_line_str := 0; ELSE old_line_str := CURRENT_LINE; ENDIF; ! ! Save any text that was inserted between last command and this one ! lse$$save_inserted_text; lse_center_line := eve_center_line; ! ! Reset the current position (for UNDO) because inserted text has already ! been saved ! lse$$save_current_position; ! ! Now save the current line again in a range and string and add the ! SUBSTITUTE command to the UNDO command buffer ! new_line_range := create_range (LINE_BEGIN, LINE_END); the_position := mark (NONE); IF (the_position = end_of(current_buffer)) THEN new_line_str := 0; ELSE new_line_str := CURRENT_LINE; ENDIF; IF (old_line_str <> 0) THEN lse$$start_substitute (new_line_str); lse$$add_substitute_entry ( old_line_str, beginning_of(new_line_range), ''); lse$$end_substitute(); ENDIF; lse$post_command_proc; endprocedure; procedure lse_change_case ! !doc_begin ! ! ONE LINE DEFINITION: ! Changes the case of the letter(s) in the selected range and ! moves the cursor to the next character. ! ! DESCRIPTION: ! If no range is selected, the current character's case is changed. ! (CHANGE CASE) ! ! RELATED COMMANDS: ! CAPITALIZE ! LOWERCASE ! NEW SELECTION MARK ! UPPERCASE ! ! CATEGORY: ! Text ! !doc_end ! ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_change_case"); ENDON_ERROR; lse_change_case := eve$edt_chngcase; lse$post_command_proc; endprocedure procedure lse_check_language_help (;defined_language) ! ! Add DEFINE PLACEHOLDER and DEFINE TOKEN to related commands. ! !doc_begin ! ! ONE LINE DEFINITION: ! Detects and reports invalid topic strings associated with a language. ! ! DESCRIPTION: ! ! (CHECK LANGUAGE HELP) ! By default, LSE uses the language associated with the current buffer. ! A topic string is invalid if there is no corresponding HELP text in the ! HELP library for the language for the topic string. ! ! RELATED COMMANDS: ! CHECK LANGUAGE DEFINITIONS ! ! CATEGORY: ! Language ! !doc_end ! local out_lang, default_language; ON_ERROR [LSE$_FILEOPENFAIL]: EVE$MESSAGE( ERROR_TEXT ); lse$post_command_proc; eve$learn_abort; RETURN FALSE; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_check_language_help "); ENDON_ERROR; ! ! Default to either unspecified or the current language ! default_language := get_info (current_buffer, "lse$language"); if default_language = 0 then default_language := tpu$k_unspecified; endif; if not lse$prompt_string (defined_language, out_lang, '', lse$_langnotdef, default_language) then lse_check_language_help := false; else lse_check_language_help := lse$check_language_help(out_lang); endif; lse$post_command_proc; endprocedure; procedure lse_check_language_definitions (;defined_language) ! !doc_begin ! ! ONE LINE DEFINITION: ! Analyzes the definitions associated with a language and reports errors. ! ! DESCRIPTION: ! ! (CHECK LANGUAGE DEFINITIONS) ! This command detects and reports the following information: ! (UNNUMBERED) ! Undefined tokens -- An undefined token ! appears in a menu placeholder body. ! Undefined placeholders -- An undefined placeholder ! appears in the body of a token, or a nonterminal or menu-type ! placeholder; or it is referenced by an alias-type placeholder or ! token; or it appears as the value of the token or placeholder help topic. ! Unreferenced placeholders -- A placeholder ! has been defined that does not appear in ! the body of any token, nor is it referenced by any alias type tokens or ! placeholders. ! Routines with the same name as tokens -- A token name ! conflicts with the name of one of the routines in a package associated ! with the language. ! Parameters with the same name as placeholders -- A placeholder ! name conflicts with the name of a routine parameter in a package associated ! with the language. ! Routines and parameters defined with the same name in multiple ! packages associated with the language. ! ! ! RELATED COMMANDS: ! CHECK LANGUAGE HELP ! ! CATEGORY: ! Language ! !doc_end ! local out_lang, default_language; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_check_language_definitions "); ENDON_ERROR; ! ! Default to either unspecified or the current language ! default_language := get_info (current_buffer, "lse$language"); if default_language = 0 then default_language := tpu$k_unspecified; endif; if not lse$prompt_string (defined_language, out_lang, '', lse$_langnotdef, default_language) then lse_check_language_definitions := false; else lse_check_language_definitions := lse$check_language_defs(out_lang); endif; lse$post_command_proc; endprocedure; procedure lse_close ! !doc_begin ! ! ONE LINE DEFINITION: ! Writes the current buffer to its associated file, if it is writable ! and has been modified, and then deletes the buffer. ! DESCRIPTION: ! (CLOSE) ! ! RELATED COMMANDS: ! CLOSE BUFFER ! CLOSE FILE ! SAVE FILE ! SAVE AS ! ! CATEGORY: ! File ! !doc_end ! ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_close"); ENDON_ERROR; RETURN (lse_close_buffer( current_buffer )); endprocedure; procedure lse_close_buffer( ;buffer_name ) ! !doc_begin ! ! ONE LINE DEFINITION: ! Writes and deletes a buffer. ! ! DESCRIPTION: ! (CLOSE BUFFER) ! If the specified buffer is writable and has been modified, LSE writes ! it to its associated file, and then deletes the buffer. If a file is not ! associated with the buffer, LSE prompts you for a file name. If no ! buffer is specified, the current buffer is used. ! ! RELATED COMMANDS: ! CLOSE ! CLOSE FILE ! SAVE FILE ! SAVE AS ! SET BUFFER CLOSE ! ! CATEGORY: ! File ! !doc_end ! LOCAL status, the_buffer; ON_ERROR [LSE$_NOREVIEW]: lse$$pop_position; EVE$MESSAGE( ERROR_TEXT ); lse$post_command_proc; eve$learn_abort; RETURN FALSE; [OTHERWISE]: lse$$pop_position; lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_close_buffer"); ENDON_ERROR; ! Get the_buffer, return if we don't ! IF NOT lse$prompt_existing_buffer (buffer_name, the_buffer, "", "", current_buffer) THEN lse$post_command_proc; return (false); ENDIF; ! If a review buffer, close it ! IF lse$is_review( the_buffer ) THEN lse_close_buffer := lse$close_review; lse$post_command_proc; return; ENDIF; ! check if the buffer is writeable, and has been modified, ! if so, write it. ! IF (GET_INFO(the_buffer, "no_write") = false) AND (GET_INFO(the_buffer, "modified") = true) THEN lse$$push_position; position( the_buffer ); status := lse_save_file (''); lse$$pop_position; IF NOT status THEN RETURN(status); ENDIF; ENDIF; ! no_write prevents lse_delete_buffer from writing ! set (no_write, the_buffer); lse_close_buffer := lse_delete_buffer (the_buffer); lse$post_command_proc; endprocedure; procedure lse_cli (;cli_command) ! !doc_begin ! ! ONE LINE DEFINITION: ! Executes a Command Language Interpreter (CLI) command from within your ! editing session. ! ! DESCRIPTION: ! (CLI) ! ! LSE spawns a subprocess for the CLI command you specify and ! creates a buffer named $CLI to contain the output from the command. ! If you do not specify a command, LSE prompts for one. The command ! is executed in your current command-line interpreter; this is usually ! DCL for OpenVMS users. ! ! EXAMPLE: ! ! LSE> CLI DIRECTORY *.TXT ! ! ! CATEGORY: ! Editing ! !doc_end ! LOCAL the_response; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_cli "); ENDON_ERROR; if lse$prompt_string( cli_command, the_response, lse$_cliprompt, '', lse$get_message_text( lse$_clicmddef ) ) then if the_response <> '' then lse_cli := eve_dcl (the_response); lse_cli := true; else eve$message (EVE$_NODCLCMD); lse_cli := false endif; else lse_cli := false endif; lse$post_command_proc; endprocedure; ! lse_cli procedure lse_delete_buffer (;buffer_name) ! !doc_begin ! ! ONE LINE DEFINITION: ! Deletes a buffer. ! ! DESCRIPTION: ! (DELETE BUFFER) ! By default, LSE deletes the current buffer. ! If the buffer is being displayed, LSE replaces it with another buffer. ! If the indicated buffer has been ! modified and is not read-only, LSE prompts you to make sure you ! really want to delete the buffer. ! ! RELATED COMMANDS: ! GOTO BUFFER ! NEW BUFFER ! SHOW BUFFER ! CLOSE BUFFER ! CLOSE FILE ! ! CATEGORY: ! File ! !doc_end ! local buffer_ptr; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_delete_buffer "); ENDON_ERROR; if lse$prompt_existing_buffer ( buffer_name, buffer_ptr, "", "", current_buffer) then lse$$delete_undo_buf (buffer_ptr); lse$$widget_buffer_deleted (buffer_ptr); lse_delete_buffer := eve$delete_buffer (buffer_ptr, true); else lse_delete_buffer := FALSE; endif; lse$post_command_proc; endprocedure; ! lse_delete_buffer procedure lse_delete_window ! !doc_begin ! ! ONE LINE DEFINITION: ! Deletes the current window. ! ! DESCRIPTION: ! (DELETE WINDOW) ! The remaining windows are enlarged to occupy the entire screen. ! ! RELATED COMMANDS: ! ONE WINDOW ! BALANCE WINDOWS ! SET BALANCE WINDOWS ! NEW WINDOW ! TWO WINDOWS ! ! CATEGORY: ! Screen ! !doc_end ! LOCAL saved_prompt_window, saved_prompt_buffer; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_delete_window"); ENDON_ERROR; IF (CURRENT_WINDOW = lse$command_window) OR (CURRENT_WINDOW = lse$prompt_window) THEN saved_prompt_window := current_window; saved_prompt_buffer := current_buffer; UNMAP( CURRENT_WINDOW ); ENDIF; lse_delete_window := eve_delete_window; lse$$balance_windows; IF saved_prompt_window <> 0 THEN MAP( saved_prompt_window, saved_prompt_buffer ); ENDIF; lse$post_command_proc; endprocedure; procedure lse_disable_grammar_prefix(;prefix) ! !doc_begin ! ! ONE LINE DEFINITION: ! Disables a prefix associated with a customized command language. ! ! DESCRIPTION: ! (DISABLE GRAMMAR PREFIX) ! ! LSE keeps the enabled grammar prefixes in a stack in the ! order in which they were defined. This command deletes a prefix ! from anywhere in the stack. If the prefix is the only one ! in the stack, no action is taken. The default is to delete the ! prefix at the top. ! ! RELATED COMMANDS: ! ENABLE GRAMMAR PREFIX ! ! CATEGORY: ! Tailor ! !doc_end ! LOCAL i, top_prefix, the_prefix; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_disable_grammar_prefix"); ENDON_ERROR; top_prefix := lse$$x_prefix_stack{ get_info (lse$$x_prefix_stack, "last") }; if lse$prompt_string (prefix, the_prefix, lse$_grpfix_d,, top_prefix) then i := lse$$grammar_prefix(edit(the_prefix,UPPER), lse$$k_prefix_exact); if i = 0 then eve$message (lse$_grpfix_ne, 0, the_prefix); lse_disable_grammar_prefix := FALSE; ! no prefix disabled else ! if this is the only prefix, don't disable. if lse$$grammar_prefix(the_prefix, lse$$k_prefix_count) = 1 then eve$message (lse$_grpfix_only, 0, the_prefix); lse_disable_grammar_prefix := FALSE; ! no prefix disabled else ! it's OK to disable this prefix lse$$x_prefix_stack { i } := tpu$k_unspecified; lse$$x_prefix_name { the_prefix } := tpu$k_unspecified; lse$$build_prefix_pattern; lse_disable_grammar_prefix := TRUE; ! prefix disabled endif; endif; else lse_disable_grammar_prefix := FALSE; ! no prefix disabled endif; lse$post_command_proc; endprocedure; procedure lse_enable_grammar_prefix(;prefix, help_library) ! !doc_begin ! ! ONE LINE DEFINITION: ! Enables a prefix for use with a customized command language. ! ! DESCRIPTION: ! (ENABLE GRAMMAR PREFIX) ! This command allows you to create your own command language ! by defining a prefix that is attached to the name of a TPU procedure. ! ! RELATED COMMANDS: ! DISABLE GRAMMAR PREFIX ! HELP ! ! EXAMPLE: ! This example enables a prefix "USER_" and associates ! a help library with it. Note that LSE uses exactly ! the characters you type. If you wish to use an underscore, ! it must be entered explicitly. ! ! ! LSE> ENABLE GRAMMAR PREFIX user_ user_help.hlp ! ! !

As a result, if you have defined a TPU procedure named ! USER_LIST_FILES, you can execute it by typing the command ! ! ! LSE> LIST FILES ! ! ! CATEGORY: ! Tailor ! !doc_end ! LOCAL i, the_prefix; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error(ERROR, ERROR_TEXT, ERROR_LINE, "lse_enable_grammar_prefix"); ENDON_ERROR; if lse$prompt_string ( prefix, the_prefix, lse$_grpfix_e ) then ! First remove if it exists i := lse$$grammar_prefix(edit(the_prefix,UPPER), lse$$k_prefix_exact); if i <> 0 then lse$$x_prefix_stack { i } := tpu$k_unspecified; lse$$x_prefix_name { the_prefix } := tpu$k_unspecified; endif; ! Add it to the top of the "stack" lse$$x_prefix_top := lse$$x_prefix_top + 1; lse$$x_prefix_stack { lse$$x_prefix_top } := the_prefix; lse$$x_prefix_name { the_prefix } := lse$$x_prefix_top; ! Construct search pattern used in eve$$parse ! lse$$build_prefix_pattern; ! Enable a help library if one is specified. ! If none is specified, assign the empty string. ! This is done to "cancel out" any library that ! may have previously been associated with this ! prefix. ! if help_library = tpu$k_unspecified then eve$declare_help_library (the_prefix, "", "", ""); else eve$declare_help_library (the_prefix, help_library, "", ""); endif; lse_enable_grammar_prefix := TRUE; ! prefix enabled else lse_enable_grammar_prefix := FALSE; ! no prefix enabled endif; lse$post_command_proc; endprocedure; procedure lse_erase_character ! !doc_begin ! ! ONE LINE DEFINITION: ! Erases a single character from the current cursor position in the ! current direction. ! ! DESCRIPTION: ! (ERASE CHARACTER) ! This command erases the next or previous character, depending on the ! current direction. (Note that the "next character" is the ! character on which the cursor is positioned.) ! ! RELATED COMMANDS: ! SET BUFFER DIRECTION ! ERASE NEXT CHARACTER ! ERASE PREVIOUS CHARACTER ! RESTORE ! ! CATEGORY: ! Text ! !doc_end ! ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_erase_character"); ENDON_ERROR; lse_erase_character := lse$$erase_character (current_direction); lse$post_command_proc; endprocedure; procedure lse_erase_next_character ! !doc_begin ! ! ONE LINE DEFINITION: ! Erases the next character. ! ! DESCRIPTION: ! (ERASE NEXT CHARACTER) ! Note that the "next character" is the ! character on which the cursor is currently positioned. ! A line terminator or ASCII tab character is considered one character. ! In either insert or overstrike mode, the remainder of the line moves ! left one character to close up the space. ! When the cursor is at the end of a line, the carriage control is erased, ! and the text from the following line moves up to the right of the text ! in the current line. ! ! RELATED COMMANDS: ! ENTER TEXT ! RESTORE ! ERASE CHARACTER ! ERASE PREVIOUS CHARACTER ! ! CATEGORY: ! Text ! !doc_end ! on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_erase_next_character"); endon_error; lse_erase_next_character := lse$$erase_character (forward); lse$post_command_proc; endprocedure; procedure lse_erase_previous_character ! !doc_begin ! ! ONE LINE DEFINITION: ! Erases the previous character. ! ! DESCRIPTION: ! (ERASE PREVIOUS CHARACTER) ! ! This command erases the character to the left of the current cursor ! position. For more infformation, see the description for the ! ERASE NEXT CHARACTER command. ! ! RELATED COMMANDS: ! ERASE CHARACTER ! ERASE NEXT CHARACTER ! RESTORE ! ! CATEGORY: ! Text ! !doc_end ! on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_erase_previous_character"); endon_error; ! ! Save OLD BPM for insert string ! lse$$save_old_bpm(); lse_erase_previous_character := lse$$erase_character (reverse); lse$post_command_proc; endprocedure; procedure lse_exit ! !doc_begin ! ! ONE LINE DEFINITION: ! Ends an LSE editing session and returns control to the calling ! process or the command-line interface. ! ! DESCRIPTION: ! (EXIT) ! The contents of buffers that are associated with ! files are written to those files if they ! have been modified. Buffers with the READ_ONLY (on) attribute ! are not written. ! ! RELATED COMMANDS: ! ATTACH ! QUIT ! SPAWN ! SET BUFFER CLOSE ! ! CATEGORY: ! Editing ! !doc_end ! LOCAL version_number, response, the_buffer; ON_ERROR [TPU$_EXITFAIL]: eve$learn_abort; lse$post_command_proc; return false; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_exit"); ENDON_ERROR; ! This loop makes sure the TPU doesn't prompt, they don't know how. ! the_buffer := get_info (BUFFERS, "first"); loop exitif the_buffer = 0; if get_info (the_buffer, "modified") and not get_info (the_buffer, "no_write") then if (get_info( the_buffer, 'file_name' ) = '') and (get_info( the_buffer, 'output_file' ) = 0) then if lse$prompt_string( , response, fao( lse$get_message_text( tpu$_needfilename ), get_info( the_buffer, 'name' ) ), , '' ) then if response = '' then set( no_write, the_buffer, on ); else set( output_file, the_buffer, response ); endif; else return false; endif; endif; ! Always pass in a version number of 0. eve$backup_file ! will increment it behind our back. ! version_number := 0; eve$backup_file (the_buffer, , version_number, eve$x_backup_string); endif; the_buffer := get_info (BUFFERS, "next"); endloop; exit; lse$post_command_proc; endprocedure; procedure lse_extend(;procedure_name); ! !doc_begin ! ! LSE Command: EXTEND ! ! ONE LINE DEFINITION: ! Compiles one or more TPU procedures to extend LSE. ! ! DESCRIPTION: ! (EXTEND) ! Using this command without specifying the procedure name ! compiles the procedure in which the cursor is located. ! To save a compiled procedure in a section file for future editing ! sessions, use the SAVE SECTION command. ! ! RELATED COMMANDS: ! SAVE SECTION ! TPU ! ! CATEGORY: ! Tailor ! !doc_end ! local the_response; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_extend"); ENDON_ERROR; if not lse$prompt_string (procedure_name, the_response, '', '', '' ) then eve$learn_abort; lse$post_command_proc; return false; endif; ! ! Extend this or the named procedure ! if the_response = '' then lse_extend := eve_extend_this () else lse_extend := eve_extend (the_response) endif; lse$post_command_proc; endprocedure; ! procedure lse_fill (;column) ! ! Add DEFINE LANGUAGE to related commands. ! !doc_begin ! ! ONE LINE DEFINITION: ! Reformats the text within a selected range. ! ! DESCRIPTION: ! (FILL) ! The FILL command reformats a block of text or program comments in ! order that as many words as possible fit on each line without ! exceeding the right margin. Reformatted text is indented to ! the left margin for the buffer. Comments are indented to the column ! specified or the current column if none is specified. LSE treats the ! spaces defined placeholders as whole words. !

! If you do not provide a selected range, ! this command reformats the current paragraph. The current ! paragraph includes the text on all previous and subsequent lines until ! LSE encounters a completely blank line. LSE preserves any blank lines ! in the text. !

! If the buffer is associated with a language, and comment delimiters have ! been defined for the language, LSE reformats the commented segments of ! the lines in the selected range. If the buffer is not associated with a ! language, or there are no comment delimiters, LSE performs a text fill. ! ! RELATED COMMANDS: ! SELECT ! SET BUFFER LEFT MARGIN ! SET BUFFER RIGHT MARGIN ! ALIGN ! ! CATEGORY: ! Text ! !doc_end ! local column_number; ON_ERROR [LSE$_NOCURPARAGRAPH]: eve$message (ERROR_TEXT); eve$learn_abort; lse$post_command_proc; return false; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_fill "); ENDON_ERROR; if lse$prompt_number (column, column_number,'','',0) then lse_fill := lse$fill(column_number); else lse_fill := FALSE; endif; lse$post_command_proc; endprocedure; PROCEDURE lse$$build_mark_name_array (default_mark; first_entry) LOCAL i, mark_name_array, temp_mark, user_mark, temp_index, null_text, mark_text, mark_list, user_mark_buffer, buffer_ptr, expand_name_result, default_found; on_error [TPU$_CONTROLC ] : return (""); [TPU$_NONAMES ] : expand_name_result := 0; [TPU$_MULTIPLENAMES] : expand_name_result := 2; [OTHERWISE]: lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse$$build_mark_name_array"); endon_error; expand_name_result := 1; mark_name_array := CREATE_ARRAY; default_found := false; ! Expand the marker variable names. ! All LSE user markers have the prefix LSE$$MARK_. ! mark_list := expand_name (lse$$k_mark_prefix, variables); if first_entry <> tpu$k_unspecified then mark_name_array {0} := first_entry; i := 1; else i := 0; if mark_list = "" then default_mark := ""; return mark_name_array; endif; endif; ! change_case (mark_list, upper); ! Go through the list of user markers. ! loop temp_index := index (mark_list, " "); if (temp_index = 0) then temp_mark := mark_list; user_mark := substr (temp_mark, length(lse$$k_mark_prefix) + 1, length(temp_mark) ); else temp_mark := substr (mark_list, 1, temp_index - 1 ); user_mark := substr (temp_mark, length(lse$$k_mark_prefix) + 1, temp_index - 1); endif; if ( temp_mark <> TPU$K_UNSPECIFIED ) AND ( temp_mark <> '' ) then execute ("lse$$x_user_mark := " + temp_mark); endif; ! Check whether there is at least one valid marker. ! if get_info( lse$$x_user_mark, 'type' ) = MARKER then if not default_found then if default_mark = user_mark then default_found := true; endif; endif; mark_name_array {i} := user_mark; i := i + 1; endif; mark_list := substr (mark_list, temp_index + 1, length(mark_list)); exitif (temp_index = 0); endloop; if not default_found then default_mark := mark_name_array {i - 1}; endif; return mark_name_array; endprocedure; procedure lse_goto_mark (;mark_name) ! !doc_begin ! ! ONE LINE DEFINITION: ! Moves the cursor to a user-defined mark. ! ! DESCRIPTION: !(GOTO MARK) ! If the marker you specify is not in the current buffer, LSE maps that ! buffer to a window. ! ! RELATED COMMANDS: ! NEW MARK ! ! CATEGORY: ! Cursor ! !doc_end ! local the_mark_name, the_lse_mark, the_default, mark_name_array, saved_info, buffer_ptr, buffer_name; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_goto_mark"); ENDON_ERROR; ! Get current informational setting saved_info := set (informational, off); ! Ensure that we have been given a mark name if lse$use_dialog_box then mark_name_array := lse$$build_mark_name_array ( lse$$x_last_new_or_goto_mark); the_default_value := lse$$x_last_new_or_goto_mark; endif; if not lse$prompt_string( mark_name, the_mark_name, lse$_markprompt, LSE$_NOMARKGIVEN, the_default_value, "Goto Mark", mark_name_array ) then set (informational, saved_info); eve$learn_abort; lse$post_command_proc; return false; endif; ! Expand the marker name and check the results. the_lse_mark := lse$expand_user_mark( the_mark_name ); lse$$x_last_new_or_goto_mark := the_mark_name; if (lse$$expand_result = 0 ) then eve$message (LSE$_MARKNOTSET, 0, the_mark_name); set (informational, saved_info); eve$learn_abort; lse$post_command_proc; return false; endif; if (lse$$expand_result = 2 ) then eve$message ( LSE$_AMBMARKNAME, 0, the_mark_name ); set (informational, saved_info); eve$learn_abort; lse$post_command_proc; return false; endif; ! + ! We had not returned by now means we have a valid TPU variable. Execute the ! variable only if it is not UNSPECIFIED. If it is a marker, then goto to ! the corresponding buffer & position on it. ! - if the_lse_mark <> TPU$K_UNSPECIFIED then execute ("lse$$x_user_mark := " + the_lse_mark); if get_info( lse$$x_user_mark, 'type') = MARKER then buffer_ptr := get_info (lse$$x_user_mark, 'buffer'); buffer_name := get_info (buffer_ptr, 'name'); ! Typically, users want to put the marked buffer in the current ! window, and keep whatever they were viewing in other windows. ! V3.1 behavior. ! lse_goto_buffer (buffer_name); position (lse$$x_user_mark); eve$message (LSE$_GOINGTOMARK, 0, the_mark_name); set (informational, saved_info); lse$post_command_proc; return true; endif; endif; ! + ! If it was not a marker (i.e., variable with UNSPCIFIED value) then mark must ! have been cancelled. ! - eve$message (LSE$_MARKCANCELLED, 0, the_mark_name); set (informational, saved_info); eve$learn_abort; lse$post_command_proc; return false; endprocedure; procedure lse_goto_review ! ! Go to review buffer which is in progress. ! ! Add COMPILE REVIEW to Related Commands. ! !doc_begin ! ! ONE LINE DEFINITION: ! Moves the cursor to the currently active review buffer. ! ! DESCRIPTION: ! (GOTO REVIEW) ! LSE maps the review buffer to the screen and positions ! the cursor to the last current position in that buffer. ! ! RELATED COMMANDS: ! REVIEW ! REVIEW BUFFER ! REVIEW FILE ! ! CATEGORY: ! Compile ! !doc_end ! local review_buffer; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_goto_review"); ENDON_ERROR; review_buffer := get_info (BUFFERS, "find_buffer", "$REVIEW"); if ( get_info(review_buffer, "record_count" ) > 0 ) then lse_goto_review := lse$$pop_position_buf("$REVIEW", "$REVIEW"); else eve$message(lse$_noreview); lse_goto_review := FALSE; endif; lse$post_command_proc; endprocedure; procedure lse_goto_source ! ! The functionality of this command has been expanded to support ths buffer ! list buffer. Depending on the current highlight type, LSE will go to the ! right source. If the current highlight type signifies a diagnostic, it will ! displays the source corresponding to the diagnostic. If the current ! highlight type signifies a selected buffer in a buffer list, it will ! displays that selected buffer. ! !doc_begin ! ! ONE LINE DEFINITION: ! Displays the source corresponding to the current diagnostic or show ! list entry. ! ! DESCRIPTION: ! (GOTO SOURCE) ! This command moves the current editing position to the source ! associated with the diagnostic, or to the buffer or mark indicated. ! When a diagnostic is selected in this manner, LSE may display a ! suggested error correction and prompt for a confirmation. !

! When the cursor is located on a diagnostic in a review buffer or ! an entry in a show list of marks or buffers, LSE highlights the ! current list entry or diagnostic. ! ! RELATED COMMANDS: ! SET DIRECTORY SOURCE ! SHOW BUFFER ! SHOW MARK ! COMPILE ! REVIEW ! ! CATEGORY: ! Compile ! !doc_end ! ! Add Cursor and Screen to CATEGORY ! LOCAL saved_mark, show_item, show_type, status; ON_ERROR [LSE$_NOREVIEW, LSE$_SOURCEFNF, LSE$_COMMANDCANCEL, LSE$_CANTFNDLN]: EVE$MESSAGE( ERROR_TEXT ); lse$post_command_proc; eve$learn_abort; RETURN FALSE; [OTHERWISE]: lse$$pop_position; lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_goto_source"); ENDON_ERROR; IF lse$is_show_list( lse$$current_highlight_buffer ) THEN ! Get the mark so we can get the info ! lse$$push_position; POSITION( lse$$current_highlight_buffer ); saved_mark := MARK( NONE ); lse$$pop_position; IF lse$shlst_get_item( saved_mark, show_item ) THEN IF lse$shlst_execute_registered_proc( saved_mark, lse$$k_reg_goto_source_proc, show_item ) THEN lse_goto_source := true; ELSE eve$message(lse$_nosource); lse_goto_source := false; ENDIF; ELSE eve$message(lse$_nosource); lse_goto_source := false; ENDIF; ELSE IF lse$is_review( lse$$current_highlight_buffer ) THEN lse_goto_source := lse$goto_source_review; ELSE eve$message(lse$_nosource); lse_goto_source := false; ENDIF; ENDIF; lse$post_command_proc; endprocedure; procedure lse_line (;number, procedure_name) ! !doc_begin ! ! ONE LINE DEFINITION: ! Moves the cursor to the specified line number. . ! ! DESCRIPTION: ! (LINE) ! When you specify a line number, LSE moves the cursor to that line in ! the current buffer. If you specify the name of a TPU procedure ! defined in the current buffer as well, LSE ! moves to the specfied line number in that procedure. !

! If the specified line is hidden, then overview records are ! expanded to the source level and the cursor is placed on the ! requested line. ! ! RELATED COMMANDS: ! WHAT LINE ! ! CATEGORY: ! Cursor ! !doc_end ! local the_line_number, the_procedure_name; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_line "); ENDON_ERROR; ! Protect EVE from a unspecified procedure name ! if lse$prompt_string( procedure_name, the_procedure_name, '', '', '' ) then ! Prompt for the line number ! if lse$prompt_number( number, the_line_number, lse$_linnumprompt, '', lse$get_message_text( lse$_linnumdef ) ) then ! ! Save the OLD_BPM for UNDO ! lse$$save_old_bpm; lse_line := eve_line (the_line_number, the_procedure_name); ! ! Save the NEW_BPM for UNDO ! lse$$save_new_bpm; else lse_line := false; endif; else lse_line := false; endif; lse$post_command_proc; endprocedure; procedure lse_next_page ! ! ONE LINE DEFINITION: ! ! This command moves the editing position to the next page of text in the ! current buffer. If there is none, the curosr moves to the end of buffer. ! !doc_begin ! ! ONE LINE DEFINITION: ! Moves the cursor to the next page of text in the current buffer. ! ! DESCRIPTION: ! (NEXT PAGE) ! If there is no next page, the cursor moves to the end of the buffer. ! A page is defined by a form-feed character. ! ! RELATED COMMANDS: ! PREVIOUS PAGE ! ! CATEGORY: ! Cursor ! !doc_end ! LOCAL saved_direction; ON_ERROR [OTHERWISE]: IF saved_direction <> tpu$k_unspecified then set (saved_direction, current_buffer); endif; lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_next_page"); ENDON_ERROR; saved_direction := set (forward, current_buffer); ! ! Save OLD BPM for UNDO ! lse$$save_old_bpm; lse_next_page := eve_move_by_page; ! Move to next page break ! ! Save NEW BPM for UNDO ! lse$$save_new_bpm; set (saved_direction, current_buffer); lse$post_command_proc; endprocedure; procedure lse_previous_page ! !doc_begin ! ! ONE LINE DEFINITION: ! Moves the cursor to the previous page of text in the current buffer. ! ! DESCRIPTION: ! (PREVIOUS PAGE) ! If there is no previous page, the cursor moves to the beginning of ! the buffer. A page is defined by a form-feed character. ! ! RELATED COMMANDS: ! NEXT PAGE ! ! CATEGORY: ! Cursor ! !doc_end ! LOCAL saved_direction; ON_ERROR [OTHERWISE]: IF saved_direction <> tpu$k_unspecified then set (saved_direction, current_buffer); endif; lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_previous_page"); ENDON_ERROR; saved_direction := set (reverse, current_buffer); ! ! Save OLD BPM for UNDO ! lse$$save_old_bpm; lse_previous_page := eve_move_by_page; ! Move to next page break ! ! Save NEW BPM for UNDO ! lse$$save_new_bpm; set (saved_direction, current_buffer); lse$post_command_proc; endprocedure; procedure lse_next_screen ! !doc_begin ! ! ONE LINE DEFINITION: ! ! Moves the cursor to the next screen of text. ! ! DESCRIPTION: ! (NEXT SCREEN) ! A screen of text is the number of lines displayed in the current ! window. ! ! RELATED COMMANDS: ! PREVIOUS SCREEN ! ! CATEGORY: ! Cursor ! !doc_end ! ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_next_screen"); ENDON_ERROR; ! ! Save OLD BPM for UNDO ! lse$$save_old_bpm; lse_next_screen := eve$move_by_screen (1); ! ! Save NEW BPM for UNDO ! lse$$save_new_bpm; lse$post_command_proc; endprocedure; procedure lse_previous_screen ! !doc_begin ! ! ONE LINE DEFINITION: ! Moves the cursor to the previous screen of text in the current buffer. ! DESCRIPTION: !(PREVIOUS SCREEN) ! ! RELATED COMMANDS: ! NEXT SCREEN ! ! CATEGORY: ! Cursor ! !doc_end ! ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_previous_screen"); ENDON_ERROR; ! ! Save OLD BPM for UNDO ! lse$$save_old_bpm; lse_previous_screen := eve$move_by_screen (-1); ! ! Save NEW BPM for UNDO ! lse$$save_new_bpm; lse$post_command_proc; endprocedure; procedure lse_lowercase ! !doc_begin ! ! ONE LINE DEFINITION: ! Changes the current word or the selected range to lowercase. ! ! DESCRIPTION: ! (LOWERCASE) ! If the word contains both uppercase and lowercase characters, LSE changes ! all letters to lowercase. If the cursor is between words, LSE changes the ! following word to lowercase. If a selected range is active, all the words ! within that range are changed to lowercase. The cursor then moves to the ! start of the next word after the selected range. ! ! RELATED COMMANDS: ! CAPITALIZE ! CHANGE CASE ! UPPERCASE ! ! CATEGORY: ! Text ! !doc_end ! ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_lowercase"); ENDON_ERROR; lse_lowercase := eve_lowercase_word; lse$post_command_proc; endprocedure; procedure lse_new_mark (;mark_name) ! ! LSE Command: NEW MARK marker-name ! ! !doc_begin ! ! ONE LINE DEFINITION: ! Marks the current cursor position with the supplied name. ! ! DESCRIPTION: ! (NEW MARK) ! ! This command tells LSE to remember the current cursor position ! by the supplied name. ! ! RELATED COMMANDS: ! DELETE MARK ! GOTO MARK ! ! CATEGORY: ! Cursor ! !doc_end ! local the_mark_name, the_default_value, mark_name_array, saved_info; ! Error handling is different than normal because we chose not ! to try to figure out all the errors that might come out of TPU's ! EXECUTE builtin. ! on_error [tpu$_controlc]: lse$post_command_proc; eve$learn_abort; return false; [OTHERWISE]: eve$message ( lse$_badmarkname, 0, the_mark_name); if saved_info <> tpu$k_unspecified then set (informational, saved_info); endif; eve$learn_abort; lse$post_command_proc; return false; endon_error; ! Get current informational setting ! saved_info := set (informational, off); ! ! Ensure that we have been given a mark name ! if lse$use_dialog_box then mark_name_array := lse$$build_mark_name_array ( lse$$x_last_new_or_goto_mark); if (get_info (lse$$x_last_new_or_goto_mark, 'type') <> string) or (lse$$x_last_new_or_goto_mark = '') then lse$$x_last_new_or_goto_mark := '0'; endif; the_default_value := lse$$x_last_new_or_goto_mark; endif; if lse$prompt_string( mark_name, the_mark_name, lse$_markprompt, LSE$_NOMARKGIVEN, the_default_value, "Mark", mark_name_array ) then ! ! Turn informationals off and compile the mark command ! execute (lse$$k_mark_prefix + the_mark_name + " := mark(free_cursor)"); set (informational, saved_info); ! ! Issue a message ! eve$message (LSE$_CURPOSMARKED, 0, the_mark_name); lse_new_mark := true; lse$$x_last_new_mark := the_mark_name; lse$$x_last_new_or_goto_mark := the_mark_name; else set (informational, saved_info); eve$learn_abort; lse_new_mark := false; endif; lse$post_command_proc; endprocedure; procedure lse_next_buffer ! !doc_begin ! ! ONE LINE DEFINITION: ! Moves the next buffer in the list of buffers to the current window. ! ! DESCRIPTION: ! (NEXT BUFFER) ! This command allows you to cycle through all user ! buffers without having to type their names. ! ! If you have only two buffers, repeating NEXT BUFFER toggles between them. ! If you have more than two buffers, the next buffer is determined by the ! order in which you created the buffers. ! Only user buffers are included in the cycle of buffers. ! ! ! RELATED COMMANDS: ! GOTO BUFFER ! PREVIOUS BUFFER ! SHOW BUFFER ! ! CATEGORY: ! Screen ! !doc_end ! ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_next_buffer"); ENDON_ERROR; lse_next_buffer := eve_next_buffer; lse$post_command_proc; endprocedure; procedure lse_next_window ! !doc_begin ! ! ONE LINE DEFINITION: ! Moves the cursor from the current window to the next window. ! DESCRIPTION: ! (NEXT WINDOW) ! ! RELATED COMMANDS: ! DELETE WINDOW ! ENLARGE WINDOW ! ONE WINDOW ! NEXT WINDOW ! PREVIOUS WINDOW ! SHRINK WINDOW ! TWO WINDOWS ! ! CATEGORY: ! Screen ! !doc_end ! ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_next_window"); ENDON_ERROR; ! ! Save any text that has been inserted until now so that if two windows have ! the same buffer in them, there is no ambiguity with cursor positions ! lse$$save_inserted_text; lse_next_window := eve_next_window; ! ! Update the current position ! lse$$save_current_position; lse$post_command_proc; endprocedure; procedure lse_one_window ! !doc_begin ! ! ONE LINE DEFINITION: ! Removes all but the current window from your screen. ! DESCRIPTION: ! (ONE WINDOW) ! ! RELATED COMMANDS: ! DELETE WINDOW ! ENLARGE WINDOW ! NEXT WINDOW ! PREVIOUS WINDOW ! SHRINK WINDOW ! TWO WINDOWS ! ! CATEGORY: ! Screen ! !doc_end ! ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_one_window"); ENDON_ERROR; lse_one_window := lse$$multi_window( 1, '' ); lse$post_command_proc; endprocedure; procedure lse_previous_buffer ! !doc_begin ! ! ONE LINE DEFINITION: ! Moves the previous buffer in the list of buffers to the current window. ! ! DESCRIPTION: ! (PREVIOUS BUFFER) ! This command allows you to cycle through all user buffers ! without having to type their names. ! ! If you have only two buffers, ! repeating PREVIOUS BUFFER toggles between them. ! If you have more than two buffers, the previous buffer is determined by ! the order in which you created the buffers. If you issue a PREVIOUS BUFFER command while you are ! positioned in the first buffer in the list, LSE ! takes you to the last buffer in the list. ! Only user buffers are included in the list of buffers. ! ! ! RELATED COMMANDS: ! GOTO BUFFER ! NEXT BUFFER ! SHOW ATTRIBUTES ! ! CATEGORY: ! Screen ! !doc_end ! ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_previous_buffer"); ENDON_ERROR; lse_previous_buffer := eve_previous_buffer; lse$post_command_proc; endprocedure; procedure lse_previous_window ! !doc_begin ! ! ONE LINE DEFINITION: ! Moves the cursor from the current window to the previous window. ! DESCRIPTION: ! (PREVIOUS WINDOW) ! ! RELATED COMMANDS: ! DELETE WINDOW ! ENLARGE WINDOW ! NEXT WINDOW ! ONE WINDOW ! NEXT WINDOW ! SHRINK WINDOW ! TWO WINDOWS ! ! CATEGORY: ! Screen ! !doc_end ! ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_previous_window"); ENDON_ERROR; ! ! Save any text that has been inserted until now so that if two windows have ! the same buffer in them, there is no ambiguity with cursor positions ! lse$$save_inserted_text; lse_previous_window := eve_previous_window; ! ! Update the current position ! lse$$save_current_position; lse$post_command_proc; endprocedure; procedure lse_quit ! !doc_begin ! ! ONE LINE DEFINITION: ! Ends an LSE session without saving modified user buffers. ! ! DESCRIPTION: ! (QUIT) ! If you have modified any buffers, LSE warns you that you have changes that ! will be lost and asks if you want to continue. ! ! RELATED COMMANDS: ! ATTACH ! EXIT ! SPAWN ! ! CATEGORY: ! Editing ! !doc_end ! local modified_buffers, ! Modified buffers exist saved_success, ! Save current SUCCESS setting the_response, ! Confirmation the_prompt, ! Prompt string the_buffer; ! Buffer to be checked if modified on_error [OTHERWISE]: set (success, saved_success); lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_quit"); endon_error; ! ! Move to beginning of buffer before quitting - Wishlist item # 294 ! position (BUFFER_BEGIN); ! eve$clear_message; saved_success := set (SUCCESS, OFF); the_buffer := get_info (BUFFERS, "first"); modified_buffers := FALSE; loop exitif the_buffer = 0; if get_info (the_buffer, "modified") and not get_info (the_buffer, "no_write") then modified_buffers := TRUE; else the_buffer := get_info (BUFFERS, "next"); endif; exitif modified_buffers; endloop; if (modified_buffers) then if lse$prompt_boolean( tpu$k_unspecified, the_response, eve$_reallyquit, '', lse$_quitdef) then if the_response then quit (OFF, 1); endif; endif; else ! ! no modified buffers, just quit ! quit (OFF,1); endif; set (SUCCESS, saved_success); lse$post_command_proc; endprocedure; procedure lse_refresh ! !doc_begin ! ! ONE LINE DEFINITION: ! Clears and redisplays the screen. ! ! DESCRIPTION: ! (REFRESH) ! This command preserves all valid text, including messages in the message ! window. The cursor returns to its current position without any extraneous ! characters. ! ! CATEGORY: ! Screen ! !doc_end ! ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_refresh"); ENDON_ERROR; lse$$update_status_lines; refresh; lse_refresh := TRUE; lse$post_command_proc; endprocedure; procedure lse_repeat (;number, lse_command) ! ! REPEAT is used to repeat a command issued at the command-line. ! "REPEAT n command" issues the "command" "n" times. N must be 1 or greater. ! Repeat commands may be nested; for example, REPEAT 2 REPEAT 3 FOO executes ! the command FOO a total of 2 x 3 = 6 times. ! ! REPEAT may be used in conjunction with the "GOLD-n" mechanism for repeating ! a keystroke "n" times. For example, consider a key F12 defined thus: ! DEFINE KEY f12 REPEAT 3 BAR. Now the key f12 will execute the BAR command ! 3 times. Furthermore, repeating the f12 key with GOLD-n (the user types ! the 'gold' key (PF1), then the digits of n, then the key-to-be-repeated) ! will execute the BAR command a total of n x 3 times. ! !doc_begin ! ! ONE LINE DEFINITION: ! Repeats a command a specified number of times. ! ! DESCRIPTION: !(REPEAT) ! The LSE keypad equivalent of the REPEAT command is PF1. ! To repeat a single key command, press the PF1 key followed by a ! number to indicate how many times you want the key ! to be executed. Then, press the key to be executed. ! ! EXAMPLE: ! You can use the REPEAT command in conjunction with PF1+n (Gold+n) ! for repeating a keystroke (n) times. !

! In the following example, the F12 key is defined to ENTER LINE 3 ! times: ! ! LSE> NEW KEY F12 REPEAT 3 ENTER LINE ! !

! By using the single keystroke, this example executes the F12 key 4 ! times so that the ENTER LINE command is executed 12 times: ! ! (PF1) (4) (F12) ! ! ! CATEGORY: ! Editing ! !doc_end ! LOCAL response, saved_count, the_count, the_cmd_line, ix; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_repeat"); ENDON_ERROR; ! Get repeat-count parameter ! if not lse$prompt_number( number, the_count, lse$_rcountprompt,, 1 ) then return FALSE; endif; if the_count < 1 then eve$message (lse$_badrepeat); return FALSE; endif; ! Get the command line ! if not lse$prompt_string( lse_command, the_cmd_line, lse$_lsecmdprompt ) then return FALSE; endif; ! Init the repeat variables if needed if eve$x_repeat_count = 0 then eve$init_repeat; endif; ! We must loop and decrement eve$x_repeat_count "manually". ! eve$x_repeat_count must be the induction variable because some of the ! rest of EVE/TPU looks at it. If the command in 'the_cmd_line' is bogus ! (generates some syntax error), the parser will exit and ! eve$x_repeat_count will be set to 1. To detect this error case, the ! CLI loop decrements local counter THE_COUNT along with the global ! induction variable. Thus, if they are suddenly not equal, an error ! condition can be returned. Now, this doesn't detect the case of ! REPEAT 1, but hey, what can I do? the parser returns the same status ! for this error case as it does for a normal case. ! One last hassle: even if the "cli branch" of this IF is taken, the ! command may still end up going to the portable parser (e.g., ! REPEAT 5 LSE FOOBAR). In this case, the portable-grammar parser will ! set eve$x_repeat_count to 0, and we decrement it, so the test for ! "<= 0", not just "= 0" is necessary. ! ! RESTRICTIONS: ! The command you repeat will be in the same grammar that you are ! currently using. You can use the LSE command to issue a portable ! command from any parser; however, there is no complementary command ! for CLI. ! ix := lse$$get_next_repeat_index; if (eve$x_repeat_types {ix - 1} <> LEARN) and (eve$x_repeat_types {ix - 1} <> 0) then ! A repeat followed by this key: multiply last repeat count with this key's ! repeat count, and stop the first repeat by making its count = 1. eve$x_repeat_count {ix} := eve$x_repeat_count {ix - 1} * the_count; eve$x_repeat_count {ix - 1} := 1; else eve$x_repeat_count {ix} := the_count; endif; loop ! Which parser ! if get_info (lse$system, "lse$cli_parser") then lse$do_command (the_cmd_line); else response := eve$$parse( the_cmd_line ); if response = '' then exitif true; else execute( response ); endif; endif; if lse$$get_repeat_index <> ix ! detect command failed then exitif true; endif; if the_count = eve$x_repeat_count {ix} ! detect parsing error then the_count := the_count - 1; endif; eve$x_repeat_count {ix} := eve$x_repeat_count {ix} - 1; exitif eve$x_repeat_count {ix} <= 0; endloop; eve$x_repeat_count {ix} := tpu$k_unspecified; eve$x_repeat_types {ix} := 0; if the_count <> 0 then lse_repeat := FALSE; ! A parsing error terminated the loop else lse_repeat := TRUE; ! executed all iterations successfully endif; lse$post_command_proc; endprocedure; procedure lse_delete_selection_mark ! !doc_begin ! ! ONE LINE DEFINITION: ! Cancels the selected range of the NEW SELECTION MARK command. ! DESCRIPTION: ! (DELETE SELECTION MARK) ! ! RELATED COMMANDS: ! NEW SELECTION MARK ! ! CATEGORY: ! Text ! !doc_end ! ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_delete_selection_mark"); ENDON_ERROR; ! If there is a select in progress, call EVE to toggle it off. if eve$x_select_position <> 0 then lse_delete_selection_mark := eve_select; else lse_delete_selection_mark := true; endif; lse$post_command_proc; endprocedure; procedure lse_new_selection_mark ! !doc_begin ! ! ONE LINE DEFINITION: ! Marks a position as one end of a selected range. ! ! DESCRIPTION: ! (NEW SELECTION MARK) ! This command marks a position as one end of the selected range between ! the select marker and the current cursor position. The range is ! denoted by reverse video display. This command is not valid if ! the select marker has already been set. ! ! RELATED COMMANDS: ! SELECT ! DELETE SELECTION MARK ! ! CATEGORY: ! Text ! !doc_end ! ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_new_selection_mark"); ENDON_ERROR; ! If there is a select in progress, report an error. if eve$x_select_position <> 0 then lse$$$set_repeat_count (1); EVE$MESSAGE(lse$_selectactive); lse_new_selection_mark := FALSE; else lse_new_selection_mark := eve_select; endif; lse$post_command_proc; endprocedure; procedure lse_select_all ! !doc_begin ! ! ONE LINE DEFINITION: ! Selects the entire contents of the current buffer. ! ! DESCRIPTION: !(SELECT ALL) ! This command places the entire contents of the current buffer ! in the selected range. Any operations that LSE performs on a selected range ! then apply to all the contents of the buffer. The SELECT ALL ! command automatically disables pending delete. ! ! RELATED COMMANDS: ! NEW SELECTION MARK ! SET PENDING DELETE ! ! CATEGORY: ! Text ! !doc_end ! ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_select_all"); ENDON_ERROR; lse_select_all := eve_select_all; lse$post_command_proc; endprocedure; procedure lse_set_balance_windows( ;boolean ) ! !doc_begin ! ! ONE LINE DEFINITION: ! Automatically balances window length whenever you change ! the number of windows. ! ! DESCRIPTION: ! (SET BALANCE WINDOWS) ! The parameter value (off) disables window balancing and ! allows windows to have unequal lengths. ! ! RELATED COMMANDS: ! BALANCE WINDOWS ! SET MAXIMUM WINDOWS ! SET MINIMUM WINDOW LENGTH ! SHOW WINDOW ATTRIBUTES ! ! CATEGORY: ! Screen ! !doc_end ! local the_response; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_balance_windows"); ENDON_ERROR; if lse$prompt_boolean( boolean, the_response, lse$_balwindprompt, '', lse$_balwinddef ) then set (lse$balance_windows, lse$window, the_response ); if the_response = true then lse$$balance_wind_always; endif; lse_set_balance_windows := true; else lse_set_balance_windows := false; endif; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_set_bell_all (;boolean) ! !doc_begin ! ! ONE LINE DEFINITION: ! Sets the state that determines whether or not the terminal bell sounds ! when messages are written to the message window. ! ! DESCRIPTION: !(SET BELL ALL) ! LSE prompts you for a value. Specify the parameter value ! (on) to set the bell on for all messages. By default, ! the bell is set off. ! ! RELATED COMMANDS: ! SET BELL BROADCAST ! SHOW ATTRIBUTES ! ! CATEGORY: ! Tailor ! !doc_end ! LOCAL the_response; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_bell_all "); ENDON_ERROR; if lse$prompt_boolean( boolean, the_response, lse$_bellprompt, '', lse$_belldef ) then if the_response then set (bell, all, on); else set (bell, all, off); endif; lse_set_bell_all := true; else lse_set_bell_all := false; endif; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_set_bell_broadcast (;boolean) ! !doc_begin ! ! ONE LINE DEFINITION: ! Sets the state that determines whether or not terminal bell sounds ! when broadcast messages are written to the message window. ! ! DESCRIPTION: ! (SET BELL BROADCAST) ! LSE prompts you for a value. Specify the parameter value ! (off) to disable the bell for broadcast messages. ! By default, the bell is set on. ! ! RELATED COMMANDS: ! SET BELL ALL ! SHOW ATTRIBUTES ! ! CATEGORY: ! Tailor ! !doc_end ! LOCAL the_response; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_bell_broadcast "); ENDON_ERROR; if lse$prompt_boolean( boolean, the_response, lse$_bellbrdprompt, '', lse$_bellbrddef ) then set( bell, broadcast, the_response ); lse_set_bell_broadcast := true; else lse_set_bell_broadcast := false; endif; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_set_buffer_auto_erase( ;boolean ) ! !doc_begin ! ! ONE LINE DEFINITION: ! Enables or disables automatic erasing of placeholders for the ! current buffer. ! ! DESCRIPTION: ! (SET BUFFER AUTO ERASE) ! LSE erases the placeholder that the cursor is ! on when you type a character over that placeholder. ! By default, this feature is active. ! ! RELATED COMMANDS: ! SHOW BUFFER ! SET PLACEHOLDER commands ! ! CATEGORY: ! File ! !doc_end ! local the_response; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_buffer_auto_erase"); ENDON_ERROR; if lse$prompt_boolean( boolean, the_response, lse$_setbufatoprompt, '', lse$_setbufatodef ) then set (lse$auto_erase, current_buffer, the_response); lse_set_buffer_auto_erase := true; else lse_set_buffer_auto_erase := false; endif; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_set_buffer_direction( ;direction ) ! ! Better name for this command would be SET BUFFER DIRECTION with ! the parameter values forward and reverse. If unable to get the ! software to distinguish direction other than reversing the direction ! "state", we are stuck with a vague description as shown below. ! !doc_begin ! ! ONE LINE DEFINITION: ! Sets the direction of a buffer to forward or reverse. ! ! DESCRIPTION: ! (SET BUFFER DIRECTION) ! ! RELATED COMMANDS: ! ERASE CHARACTER ! ERASE LINE ! ERASE PLACEHOLDER ! ERASE WORD ! SEARCH commands ! SHOW BUFFER ! SUBSTITUTE ! PATTERN EXACT SUBSTITUTE ! PATTERN SEARCH ! PATTERN SUBSTITUTE ! ! CATEGORY: ! File ! !doc_end ! local default_direction, the_direction, response; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_buffer_direction"); ENDON_ERROR; ! Decide on the default ! IF CURRENT_DIRECTION = FORWARD THEN default_direction := lse$list_extract( lse$_directdelimit, lse$_directlist, lse$$k_direct_reverse ); ELSE default_direction := lse$list_extract( lse$_directdelimit, lse$_directlist, lse$$k_direct_forward ); ENDIF; ! Deal with the possible keywords ! IF direction = tpu$k_unspecified THEN the_direction := direction; ELSE the_direction := STR( direction ); ENDIF; ! Prompt ! IF lse$prompt_list( the_direction, response, '', lse$_directdelimit, lse$_directlist, false, '', default_direction ) THEN CASE response [lse$$k_direct_forward]: set( FORWARD, current_buffer ); [lse$$k_direct_reverse]: set( REVERSE, current_buffer ); [OTHERWISE]: EVE$MESSAGE( lse$_internerr, 0, 'lse_set_buffer_direction' ); eve$learn_abort; lse$post_command_proc; RETURN false; ENDCASE; eve$x_old_find_direction := CURRENT_DIRECTION; ! Uncomment to restore search and substitute dialog box live direction ! if eve$x_decwindows_active ! then ! lse$$widget_set_search_direction; ! endif; lse_set_buffer_direction := true; ELSE lse_set_buffer_direction := false; ENDIF; lse$$update_status_lines(); lse$post_command_proc; endprocedure; procedure lse_set_buffer_indentation( ;level ) ! !doc_begin ! ! ONE LINE DEFINITION: ! Sets the indentation level for the current buffer, ! without changing the current line. ! DESCRIPTION: ! (SET BUFFER INDENTATION) ! ! RELATED COMMANDS: ! INDENT LEFT ! INDENT RIGHT ! ENTER TAB ! EXPAND ! DELETE TAB ! ! CATEGORY: ! File ! !doc_end ! local the_response; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_buffer_indentation"); ENDON_ERROR; IF lse$prompt_list( level, the_response, lse$_setbufindprompt, lse$_setbufinddel, lse$_setbufindlist, false, '', lse$_setbufinddef ) then case the_response from 1 to 4 [lse$$k_setbufind_left]: the_response := lse$left; [lse$$k_setbufind_current]: the_response := lse$current; [lse$$k_setbufind_right]: the_response := lse$right; [lse$$k_setbufind_cursor]: the_response := lse$cursor; endcase; set (lse$indentation, current_buffer, the_response); lse_set_buffer_indentation := true; else lse_set_buffer_indentation := false; endif; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse$disable_undo (the_message, the_reason) ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error(ERROR,ERROR_TEXT,ERROR_LINE,"lse$disable_undo"); ENDON_ERROR; if get_info (current_buffer, 'lse$max_undo') > 0 then ! Set max undo to -setting-1, this inhibits undo ! and can be used to reset max undo when undo is reenabled eve$message(the_message); if the_reason = 'overview' then if get_info (lse$command_buffer, "lse$language") = 'LSE' then eve$message("Use DELETE OVERVIEW command to reallow undo"); else eve$message("Use DELETE BUFFER OVERVIEW command to reallow undo"); endif; endif; SET(lse$max_undo,current_buffer, - get_info (current_buffer, 'lse$max_undo') - 1); endif; endprocedure; procedure lse$enable_undo (the_reason) ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error(ERROR,ERROR_TEXT,ERROR_LINE,"lse$enable_undo"); ENDON_ERROR; if (get_info (current_buffer, "mode") = INSERT) and (get_info(current_buffer,'lse$overview_info') = FALSE) and (get_info (current_buffer, 'lse$max_undo') < -1) then ! Reset value saved when undo disabled, saved as -setting-1. eve$message ("Undo/Redo reenabled"); SET(lse$max_undo,current_buffer, - get_info (current_buffer, 'lse$max_undo') - 1); endif; endprocedure; procedure lse_set_buffer_text( ;text_option ) ! !doc_begin ! ! ONE LINE DEFINITION: ! Sets the text-entry mode of the current buffer to insert or overstrike. ! DESCRIPTION: ! (SET BUFFER TEXT) ! ! RELATED COMMANDS: ! TOGGLE INSERT OVERSTRIKE ! SHOW BUFFER ! ! CATEGORY: ! File ! !doc_end ! ! Intentionally left out: ! ! DESCRIPTION: ! In insert mode, LSE inserts typed characters before the current cursor ! position. In overstrike mode, characters under the cursor are replaced ! by the typed characters. ! local default_text, the_text_type, response; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_buffer_text"); ENDON_ERROR; ! Decide on the default ! IF GET_INFO( CURRENT_BUFFER, 'mode' ) = INSERT THEN default_text := lse$list_extract( lse$_textdelimit, lse$_textlist, lse$$k_text_overstrike ); ELSE default_text := lse$list_extract( lse$_textdelimit, lse$_textlist, lse$$k_text_insert ); ENDIF; ! Deal with possible keywords ! IF text_option = TPU$K_UNSPECIFIED THEN the_text_type := text_option; ELSE the_text_type := str( text_option ); ENDIF; ! Prompt ! IF lse$prompt_list( the_text_type, response, '', lse$_textdelimit, lse$_textlist, false, '', default_text ) THEN CASE response [lse$$k_text_insert]: if get_info (current_buffer, "mode") = OVERSTRIKE then SET( INSERT, CURRENT_BUFFER ); lse$enable_undo ('overstrike'); ! ! Save current position for UNDO ! lse$$save_current_position; endif; [lse$$k_text_overstrike]: if get_info (current_buffer, "mode") = INSERT then ! ! Reset the UNDO buffers since no UNDO ! support is provided in OVERSTRIKE mode ! lse$$reset_undo_buf (CURRENT_BUFFER); SET( OVERSTRIKE, CURRENT_BUFFER ); lse$disable_undo (lse$_undooverstrike, 'overstrike'); endif; [OTHERWISE]: EVE$MESSAGE( lse$_internerr, 0, 'lse_set_buffer_text' ); eve$learn_abort; lse$post_command_proc; RETURN false; ENDCASE; lse_set_buffer_text := true; ELSE lse_set_buffer_text := false; ENDIF; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_set_buffer_journaling( ;boolean ) ! !doc_begin ! ! ONE LINE DEFINITION: ! Enables or disables buffer-change journaling for the current buffer. ! ! DESCRIPTION: ! (SET BUFFER JOURNALING) ! This command does not enable buffer-change journaling for system buffers. ! By default, buffer-change journaling is active. ! ! RELATED COMMANDS: ! RECOVER BUFFER ! SHOW BUFFER ! ! CATEGORY: ! Editing ! !doc_end ! local the_response; on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_buffer_journaling"); endon_error; if lse$prompt_boolean( boolean, the_response, lse$_setbufjnlprompt, '', lse$_setbufjnldef ) then if the_response then eve_set_journaling( get_info( current_buffer, 'name' ) ); else eve_set_nojournaling( get_info( current_buffer, 'name' ) ); endif; lse_set_buffer_journaling := true; else lse_set_buffer_journaling := false; endif; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_set_buffer_language( ;language_name ) ! ! Add DEFINE LANGUAGE commands to Related Commands. ! !doc_begin ! ! ONE LINE DEFINITION: ! Associates a language with the current buffer. ! ! DESCRIPTION: ! (SET BUFFER LANGUAGE) ! By default, LSE uses a file-type specification to determine the language ! to associate with a buffer. To disassociate ! a buffer with any language, use this command with a blank ! language name. ! ! RELATED COMMANDS: ! SHOW BUFFER ! ! CATEGORY: ! File ! !doc_end ! local the_response; on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_buffer_language"); endon_error; ! If we are really passed a '' then we set it ! if language_name = '' then set (lse$language, current_buffer, language_name ); lse_set_buffer_language := true; else if lse$prompt_string( language_name, the_response, lse$_setbuflngprompt, '', lse$get_message_text( lse$_setbuflngdef ) ) then set (lse$language, current_buffer, the_response); lse_set_buffer_language := true; else lse_set_buffer_language := false; endif; endif; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_set_buffer_left_margin( ;column ) ! ! Add SET LANGUAGE WRAP to Related Commands. ! !doc_begin ! ! ONE LINE DEFINITION: ! Sets the left margin for the current buffer to the column number ! you specify. ! ! DESCRIPTION: ! (SET BUFFER LEFT MARGIN) ! By default, LSE sets the indicated buffer's left margin at column 1. ! The column number you specify must ! be an integer less than the value set for the right margin. !

! If you specify column number 0, LSE uses ! the indentation of the current line to determine the left margin ! when you use the SET LANGUAGE WRAP command. Having set the left ! margin to 0, when you enter the FILL ! command LSE uses the indentation of the first line of each selected ! paragraph to determine the left margin. ! ! RELATED COMMANDS: ! SET BUFFER RIGHT MARGIN ! SHOW BUFFER ! SET LANGUAGE WRAP ! FILL ! ! CATEGORY: ! File ! !doc_end ! local the_response; on_error [LSE$_ILLEGMARGINS]: eve$message (ERROR_TEXT); lse$post_command_proc; eve$learn_abort; return false; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_buffer_left_margin"); endon_error; if lse$prompt_number( column, the_response, lse$_setbuflmgprompt, '', lse$_setbuflmgdef ) then set (lse$left_margin, current_buffer, the_response); lse_set_buffer_left_margin := true; else lse_set_buffer_left_margin := false; endif; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_set_buffer_modifiable( ;boolean ) ! ! Change name to SET BUFFER STATUS? ! !doc_begin ! ! ONE LINE DEFINITION: ! Changes the buffer modifiable state of the current buffer. ! ! DESCRIPTION: ! (SET BUFFER MODIFIABLE) ! The parameter value (on) sets the buffer state to ! modifiable. The parameter value (off) sets the ! the buffer state to unmodifiable. See the documentation for the ! SET DIRECTORY READONLY command for information about how this state ! is set by default. ! ! RELATED COMMANDS: ! SET BUFFER CLOSE ! SET DIRECTORY READONLY ! SET BUFFER ! ! CATEGORY: ! File ! !doc_end ! local the_response; on_error [TPU$_MSGBUFSET]: eve$message (ERROR_TEXT); lse$post_command_proc; eve$learn_abort; return false; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_buffer_modifiable"); endon_error; if lse$prompt_boolean( boolean, the_response, lse$_setbufmodprompt, '', lse$_setbufmoddef ) then if the_response then if NOT get_info( current_buffer, 'modifiable' ) then set (modifiable, current_buffer, on); lse$$journal_this_buffer( current_buffer ); endif; else set (modifiable, current_buffer, off); endif; lse_set_buffer_modifiable := true; else lse_set_buffer_modifiable := false; endif; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_set_buffer_output_file( ;file_spec ) ! ! Add COMPILE to Related Commands. ! !doc_begin ! ! ONE LINE DEFINITION: ! Associates an output file with the current buffer. ! ! DESCRIPTION: ! (SET BUFFER OUTPUT FILE) ! This command associates an output file to a ! buffer for writing the buffer out to a file. ! This command does not cause the buffer to be ! written to a file. You can disassociate the current buffer from an ! output file by specifying this command with a blank output file name. ! In this case, LSE asks you to supply a file name when you request ! that the buffer be written out. ! ! RELATED COMMANDS: ! EXIT ! SET BUFFER CLOSE ! SHOW BUFFER commands ! SAVE FILE ! SAVE AS ! CLOSE BUFFER ! CLOSE FILE ! DELETE BUFFER ! ! CATEGORY: ! File ! !doc_end ! local the_response; on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_buffer_output_file"); endon_error; ! Null name means clear it. ! if file_spec = '' then set (output_file, current_buffer, file_spec); lse_set_buffer_output_file := true; else if lse$prompt_string( file_spec, the_response, lse$_setbufofnprompt, '', lse$get_message_text( lse$_setbufofndef ) ) then set (output_file, current_buffer, the_response); lse_set_buffer_output_file := true; else lse_set_buffer_output_file := false; endif; endif; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_set_buffer_overview( ;boolean ) ! !doc_begin ! ! ONE LINE DEFINITION: ! Enables or disables overview operations in the current buffer. ! ! DESCRIPTION: ! (SET BUFFER OVERVIEW) ! This command enables or disables the source elision commands ! and the EXPAND command on an overview line. By ! default, overview operations are allowed in a buffer when it is ! created. The parameter value (off) disables overview ! operations. ! ! RELATED COMMANDS: ! COLLAPSE ! EXPAND ! FOCUS ! VIEW SOURCE ! SHOW BUFFER ! ! CATEGORY: ! Program ! !doc_end ! local the_response; on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_buffer_overview"); endon_error; if lse$prompt_boolean( boolean, the_response, lse$_setbufovrprompt, '', lse$_setbufovrdef ) then set (lse$overviews, current_buffer, the_response); lse_set_buffer_overview := true; else lse_set_buffer_overview := false; endif; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_delete_buffer_overview (;unused) ! ! N.B. This routine is currently called with a parameter even though ! it doesn't need or use the parameter. ! !doc_begin ! ! ONE LINE DEFINITION: ! This command deletes the overview information for the current buffer. ! ! DESCRIPTION: ! (DELETE BUFFER OVERVIEW) ! This command gets rid of all the overview lines in a buffer, and makes all ! the real lines in the buffer visible. ! ! RELATED COMMANDS: ! COLLAPSE ! EXPAND ! FOCUS ! VIEW SOURCE ! ! CATEGORY: ! Program ! !doc_end ! on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_delete_buffer_overview"); endon_error; lse$overview_reset; lse$enable_undo ('overview'); lse_delete_buffer_overview := true; lse$post_command_proc; endprocedure; procedure lse_set_buffer_close( ;close_option ) ! ! NOTE: Need another name for this command, e.g., SET BUFFER READ WRITE, ! SET BUFFER EDIT STATUS. Doesn't make sense as is. ! !doc_begin ! ! ONE LINE DEFINITION: ! Sets the buffer's read/write state. ! ! DESCRIPTION: ! (SET BUFFER CLOSE) ! The parameter value (read_only) prevents ! LSE from writing the contents of the current ! buffer to a file upon exiting LSE or compiling the contents of the buffer. ! ! ! RELATED COMMANDS: ! NEW BUFFER ! SET BUFFER MODIFIABLE ! SHOW BUFFER ! ! CATEGORY: ! File ! !doc_end ! local default_close, response, out_name; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_buffer_close"); ENDON_ERROR; ! Decide on the default ! IF GET_INFO( CURRENT_BUFFER, 'lse$read_only' ) THEN default_close := lse$list_extract( lse$_closedelimit, lse$_closelist, lse$$k_close_save ); ELSE default_close := lse$list_extract( lse$_closedelimit, lse$_closelist, lse$$k_close_read_only ); ENDIF; ! Prompt ! IF lse$prompt_list( close_option, response, '', lse$_closedelimit, lse$_closelist, false, '', default_close ) THEN CASE response [lse$$k_close_read_only]: set (lse$read_only, current_buffer, 1) [lse$$k_close_save]: set (lse$read_only, current_buffer, 0) [OTHERWISE]: EVE$MESSAGE( lse$_internerr, 0, 'lse_set_buffer_close' ); eve$learn_abort; lse$post_command_proc; RETURN false; ENDCASE; if response = lse$$k_close_save then ! See if the file will be written to a read only directory ! out_name := get_info( current_buffer, 'output_file' ); if (out_name = '') OR (out_name = 0) then out_name := get_info( current_buffer, 'file_name' ); endif; if lse$is_read_only_directory( out_name ) then eve$message( lse$_readonlydir ); endif; ENDIF; lse_set_buffer_close := true; ELSE lse_set_buffer_close := false; ENDIF; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_set_buffer_right_margin( ;column ) ! !doc_begin ! ! ONE LINE DEFINITION: ! Sets the right margin for the current buffer. ! ! DESCRIPTION: !(SET BUFFER RIGHT MARGIN) ! LSE sets the buffer's right margin to column 80, by default, or ! to the column number you specify. If the SET BUFFER WRAP command is ! on, this command affects the FILL and ENTER SPACE commands. ! ! RELATED COMMANDS: ! SET BUFFER LEFT MARGIN ! SHOW BUFFER ! FILL ! ENTER SPACE ! SET BUFFER WRAP ! ! CATEGORY: ! File ! !doc_end ! local the_response; on_error [TPU$_BADMARGINS]: eve$message (ERROR_TEXT); lse$post_command_proc; eve$learn_abort; return false; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_buffer_right_margin"); endon_error; if lse$prompt_number( column, the_response, lse$_setbufrmgprompt, '', lse$_setbufrmgdef ) then if the_response <= get_info( current_buffer, 'lse$left_margin' ) then eve$message( message_text( lse$_illegmargins ), 0, get_info( current_buffer, 'lse$left_margin' ), the_response ); lse_set_buffer_right_margin := false; else set (right_margin, current_buffer, the_response); lse_set_buffer_right_margin := true; endif; else lse_set_buffer_right_margin := false; endif; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_set_buffer_tab_increment( ;number ) ! !doc_begin ! ! ONE LINE DEFINITION: ! Specifies the logical tab stop length in the current buffer. ! ! DESCRIPTION: ! (SET BUFFER TAB INCREMENT) ! This command specifies the number of columns between the tab stops ! for the current buffer. Tab stops are set beginning with column 1. ! All previous tab stops are cleared. ! ! RELATED COMMANDS: ! ENTER TAB ! SET BUFFER INDENTATION ! SHOW BUFFER ! ! CATEGORY: ! File ! !doc_end ! local the_response; on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_buffer_tab_increment"); endon_error; if lse$prompt_number( number, the_response, lse$_setbuftabprompt, '', lse$_setbuftabdef ) then set (lse$tab_increment, current_buffer, the_response); lse_set_buffer_tab_increment := true; else lse_set_buffer_tab_increment := false; endif; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_set_buffer_wrap( ;boolean ) ! !doc_begin ! ! ONE LINE DEFINITION: ! Enables or disables line wrapping in the current buffer. ! ! DESCRIPTION: ! (SET BUFFER WRAP) ! This command enables the ENTER SPACE and ENTER LINE commands to ! perform a wrap operation in the current buffer. Initially, wrapping ! is disabled unless the language associated with the buffer has ! wrap set (on). ! ! RELATED COMMANDS: ! ENTER LINE ! ENTER SPACE ! SHOW BUFFER ! ! CATEGORY: ! File ! !doc_end ! local the_response; on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_buffer_wrap"); endon_error; if lse$prompt_boolean( boolean, the_response, lse$_setbufwrpprompt, '', lse$_setbufwrpdef ) then set (lse$wrap, current_buffer, the_response); lse_set_buffer_wrap := true; else lse_set_buffer_wrap := false; endif; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_set_cursor( ;cursor_option ) ! ! !doc_begin ! ! ONE LINE DEFINITION: ! Sets free or bound cursor motion in a buffer. ! ! DESCRIPTION: ! (SET CURSOR) ! When the cursor motion is bound, LSE restricts the cursor to ! that part of the buffer occupied by text. ! When the cursor motion is free, the cursor can be positioned anywhere ! in the buffer window. ! ! RELATED COMMANDS: ! SHOW ATTRIBUTES ! ! CATEGORY: ! Cursor ! !doc_end ! LOCAL the_cursor_option, response; on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_cursor"); endon_error; ! Deal with the possible keyword ! IF cursor_option = tpu$k_unspecified THEN the_cursor_option := cursor_option; ELSE the_cursor_option := str( cursor_option ); ENDIF; IF lse$prompt_list( the_cursor_option, response, '', lse$_cursordelimit, lse$_cursorlist, false ) THEN CASE response [lse$$k_cursor_bound]: set( lse$cursor_bound, lse$system, 1 ); [lse$$k_cursor_free]: set( lse$cursor_bound, lse$system, 0 ); [OTHERWISE]: EVE$MESSAGE( lse$_internerr, 0, 'lse_set_cursor' ); eve$learn_abort; lse$post_command_proc; RETURN false; ENDCASE; lse_set_cursor := true; ELSE lse_set_cursor := false; ENDIF; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_set_directory_default (;directory_spec) ! !doc_begin ! ! ONE LINE DEFINITION: ! Changes your default device and directory specifications. ! ! DESCRIPTION: ! (SET DIRECTORY DEFAULT) ! This command applies the new default device ! and directory names to all subesequent file specifications that do ! not explicitly include a device or directory name. The default ! set in an LSE editing session remains in effect after you terminate ! the LSE session. ! ! RELATED COMMANDS: ! SHOW ATTRIBUTES ! ! CATEGORY: ! Help ! !doc_end ! local the_response; on_error [TPU$_PARSEFAIL, TPU$_SYSERROR]: eve$message (ERROR_TEXT); lse$post_command_proc; eve$learn_abort; return false; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_directory_default "); endon_error; if lse$prompt_string( directory_spec, the_response, lse$_setdefdirprompt, '', lse$get_message_text( lse$_setdirdefdef ) ) then ! On Ultrix, use file_parse to process ~'s ! if eve$x_ultrix_active then the_response := FILE_PARSE (the_response); endif; set (default_directory, the_response); lse_set_directory_default := true; ! Crude fix for bug 2216 (new default directory not propogated ! for compilations). Not a fix if there is a compilation ! currently executing. ! if get_info (lse$$x_compile_process, "type") = PROCESS ! then ! delete (lse$$x_compile_process); ! endif; else lse_set_directory_default := false; endif; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_set_directory_readonly (;directory_spec, add_remove) ! !doc_begin ! ! ONE LINE DEFINITION: ! Sets the indicated directory's read/write state. ! ! DESCRIPTION: ! (SET DIRECTORY READONLY) ! This command adds the directory ! or removes it from the list of read only directories. !

! LSE does not look at a directory's file-system protection to ! determine whether or not it should be set to read-only. As such, ! if a file is read from a directory that is write-protected by ! the file system, it is not set to read-only. If you modify the ! buffer, LSE will attempt to write the file out and you will get an ! error message from the operating system. ! ! RELATED COMMANDS: ! SET DIRECTORY DEFAULT ! SET BUFFER MODIFIABLE ! SET BUFFER CLOSE ! SHOW ATTRIBUTES ! ! CATEGORY: ! File ! !doc_end ! local the_boolean, the_response, the_yes_no; on_error [TPU$_PARSEFAIL]: eve$message(ERROR_TEXT); lse$post_command_proc; return(false); [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_directory_close "); endon_error; ! Default boolean to read_only ! IF NOT lse$prompt_add_remove( add_remove, the_boolean, '', '', lse$_readonlydef ) THEN ! User entered a bogus value. Prompt for a correct one. ! if not lse$prompt_add_remove( tpu$k_unspecified, the_boolean, lse$_setdirredprompt, '', lse$_readonlydef ) then lse$post_command_proc; eve$learn_abort; RETURN false; endif; ENDIF; if lse$prompt_string( directory_spec, the_response, lse$_setdirredprompt, '', lse$get_message_text( lse$_setdirreddef ) ) then ! Keep non-existent directories out of the list. They translate ! to the default directory. Probably not what the user wants. ! if the_boolean then ! They want to make it read only ! if file_parse( the_response, '', '', node, device, directory ) = file_parse( get_info( system, 'default_directory' ), '', '', node, device, directory ) then ! It translates to the default directory, ask them really? ! if lse$prompt_boolean( , the_yes_no, lse$_rodisdefprompt, '', lse$_rodisdefdef ) then ! They gave us something ! if not the_yes_no then ! They changed their minds ! lse$post_command_proc; return true; endif; else ! The prompt failed ! lse$post_command_proc; return false; endif; endif; endif; lse_set_directory_readonly := lse$set_directory_read_only( the_response, the_boolean ); else lse_set_directory_readonly := false; endif; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_set_directory_source (;directory_spec) ! !doc_begin ! ! ONE LINE DEFINITION: ! Specifies a directory to be used to find source files. ! ! DESCRIPTION: ! (SET DIRECTORY SOURCE) ! This command specifies the directories LSE uses to find source files ! when you issue commands that read files. ! You can specify one or more directory specifications. To ! remove a list of directories, enter this command with a blank ! directory specification. ! ! RELATED COMMANDS: ! OPEN FILE ! GOTO SOURCE ! INCLUDE FILE ! OPEN FILE ! SHOW ATTRIBUTES ! ! CATEGORY: ! File ! !doc_end ! local the_response; on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_directory_source "); endon_error; ! If we are really passed a '' then we set it ! if directory_spec = '' then set (lse$directory_source, lse$system, directory_spec ); lse_set_directory_source := true; else if lse$prompt_string( directory_spec, the_response, lse$_setdirsrcprompt, lse$_setdirsrcnov, lse$get_message_text( lse$_setdirsrcdef ) ) then if the_response = lse$get_message_text( lse$_setdirsrcdef ) then set (lse$directory_source, lse$system, get_info( system, "default_directory" ) ); else set (lse$directory_source, lse$system, the_response ); endif; lse_set_directory_source := true; else lse_set_directory_source := false; endif; endif; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_set_font( ;font_attribute ) ! ! Changed to take a "font" name: ! Condensed, Normal, Big, Little ! !doc_begin ! ! ONE LINE DEFINITION: ! Sets the screen font size to big or little and the font spacing to ! normal or condensed. ! ! DESCRIPTION: ! (SET FONT) ! This command allows you to set the font size in the DECwindows ! environment only. ! ! RELATED COMMANDS: ! SHOW WINDOW ATTRIBUTES ! ! CATEGORY: ! Editing ! !doc_end ! LOCAL response; on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_font"); endon_error; IF lse$prompt_list( font_attribute, response, '', lse$_fontdelimit, lse$_fontlist, false, '', lse$_fontdef ) THEN CASE response FROM 1 TO 4 [lse$$k_font_condensed]:set( lse$font_condensed, lse$window, on ); [lse$$k_font_normal]: set( lse$font_condensed, lse$window, off ); [lse$$k_font_big]: set( lse$font_little, lse$window, off ); [lse$$k_font_little]: set( lse$font_little, lse$window, on ); [OTHERWISE]: EVE$MESSAGE( lse$_internerr, 0, 'lse_set_font' ); eve$learn_abort; lse$post_command_proc; RETURN false; ENDCASE; lse_set_font := true; ELSE lse_set_font := false; ENDIF; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_set_keypad(;keypad_name) ! !doc_begin ! ! ONE LINE DEFINITION: ! Sets the keypad definitions to EDT or EVE. ! ! DESCRIPTION: ! (SET KEYPAD) ! LSE defaults to the EDT keypad definitions. ! ! RELATED COMMANDS: ! SHOW KEY ! SHOW ATTRIBUTES ! ! CATEGORY: ! Tailor ! !doc_end ! LOCAL the_keypad_name, response, temp_key_map, unsafe_key_map; on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_keypad"); endon_error; ! Deal with the possible keyword ! the_keypad_name := keypad_name; IF GET_INFO( keypad_name, 'type' ) = KEYWORD THEN CASE keypad_name [lse$edt]: the_keypad_name := 'EDT'; [lse$eve]: the_keypad_name := 'EVE'; ENDCASE; ENDIF; IF lse$prompt_list( the_keypad_name, response, '', lse$_keypaddelimit, lse$_keypadlist, false, '', lse$_keypaddef ) THEN ! Actually set it ! CASE response [lse$$k_keypad_edt]: set (lse$keypad, lse$system, lse$edt); unsafe_key_map := 'LSE$PROMPT_UNSAFE_EDT_KEY_MAP'; [lse$$k_keypad_eve]: set (lse$keypad, lse$system, lse$eve); unsafe_key_map := 'LSE$PROMPT_UNSAFE_EVE_KEY_MAP'; [OTHERWISE]: EVE$MESSAGE( lse$_internerr, 0, 'lse_set_keypad' ); eve$learn_abort; lse$post_command_proc; RETURN false; ENDCASE; ! Command keymaps ! ! First remove everything ! LOOP temp_key_map := GET_INFO (KEY_MAP, "first", "LSE$COMMAND_KEY_MAP_LIST"); EXITIF temp_key_map = 0; REMOVE_KEY_MAP( 'LSE$COMMAND_KEY_MAP_LIST', temp_key_map, ALL ); ENDLOOP; ! Add in TPU$KEY_MAP_LIST ! temp_key_map := GET_INFO (KEY_MAP, "first", "TPU$KEY_MAP_LIST"); LOOP EXITIF temp_key_map = 0; ADD_KEY_MAP( 'LSE$COMMAND_KEY_MAP_LIST', "last", temp_key_map ); temp_key_map := GET_INFO (KEY_MAP, "next", "TPU$KEY_MAP_LIST"); ENDLOOP; ! Add the terminators and unsafe ! ADD_KEY_MAP( 'LSE$COMMAND_KEY_MAP_LIST', "first", unsafe_key_map ); ! Prompt keymaps ! ! First remove everything ! LOOP temp_key_map := GET_INFO (KEY_MAP, "first", "LSE$PROMPT_KEY_MAP_LIST"); EXITIF temp_key_map = 0; REMOVE_KEY_MAP( 'LSE$PROMPT_KEY_MAP_LIST', temp_key_map, ALL ); ENDLOOP; ! Add in TPU$KEY_MAP_LIST ! temp_key_map := GET_INFO( KEY_MAP, "first", "TPU$KEY_MAP_LIST" ); LOOP EXITIF temp_key_map = 0; ADD_KEY_MAP( 'LSE$PROMPT_KEY_MAP_LIST', "last", temp_key_map ); temp_key_map := GET_INFO( KEY_MAP, "next", "TPU$KEY_MAP_LIST" ); ENDLOOP; ! Add the unsafe ! ADD_KEY_MAP( 'LSE$PROMPT_KEY_MAP_LIST', "first", unsafe_key_map ); lse_set_keypad := true; ELSE lse_set_keypad := false; ENDIF; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_set_height( ;number ); ! ! LSE Command: SET HEIGHT ! -need range for this command. ! !doc_begin ! ! ONE LINE DEFINITION: ! Sets the number of lines on the screen. ! DESCRIPTION: ! (SET HEIGHT) ! ! RELATED COMMANDS: ! SET WIDTH ! SHOW ATTRIBUTES ! ! CATEGORY: ! Screen ! !doc_end ! local the_height, old_height, the_width; on_error [TPU$_BADVALUE]: eve$message (ERROR_TEXT); eve$learn_abort; lse$post_command_proc; return false; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_height"); endon_error; if lse$prompt_number( number, the_height, lse$_heightprompt, '', lse$$x_default_screen_length, INT (lse$get_message_text (lse$_minheight))) = true then old_height := get_info (screen, "visible_length"); the_width := get_info (screen, "width"); if not eve$x_decwindows_active and the_height < old_height then ! Part of fix for bug 2206. eve$$x_resize_new_length := the_height; eve$$x_resize_old_length := old_height; eve$$x_resize_new_width := the_width; eve$$x_resize_old_width := the_width; eve$$resize_handler (); endif; set (height, screen, the_height); ! ! In DecWindows mode, the SET (HEIGHT) builtin results in X activity ! that in turn results in a callback to tpu$resize, which sets ! the ttlines value in TPU. If we make the call the lse$$resize_windows ! explicit, the code will execute in the context of the old ttlines value, ! since the tpu$resize callback won't have executed yet. ! ! In CCT mode, there are no X callbacks, so explicitly do the resize ! work. ! if not eve$x_decwindows_active then lse$$resize_windows (old_height, the_height, the_width, the_width); endif; lse_set_height := true; else lse_set_height := false; endif; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_set_maximum_windows( ;number ) ! ! LSE Command: SET MAXIMUM WINDOWS ! !doc_begin ! ! ONE LINE DEFINITION: ! Specifies the maximum number of windows that LSE automatically creates. ! ! DESCRIPTION: ! (SET MAXIMUM WINDOWS) ! This command specifies the maximum number of windows that LSE automatically ! creates when it displays information. ! !

! LSE uses this command and the SET MINIMUM WINDOW LENGTH ! command to determine whether to add a window to the screen or to reuse ! an existing window. LSE checks both settings and creates a new ! window only if both conditions are met. ! ! RELATED COMMANDS: ! SET MINIMUM WINDOW LENGTH ! SET BALANCE WINDOWS ! BALANCE WINDOWS ! REVIEW ! SHOW commands ! HELP commands ! SHOW WINDOW ATTRIBUTES ! ! CATEGORY: ! Screen ! !doc_end ! local the_number; on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_maximum_windows"); endon_error; if lse$prompt_number( number, the_number, lse$_numwindprompt, '', lse$_numwinddef ) then set ( lse$max_windows, lse$window, the_number); lse_set_maximum_windows := true; else lse_set_maximum_windows := false; endif; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_set_minimum_window_length( ;number ) ! ! LSE Command: SET MINIMUM WINDOW LENGTH ! !doc_begin ! ! ONE LINE DEFINITION: ! Specifies the minimum length of the windows that LSE automatically creates. ! ! DESCRIPTION: ! (SET MINIMUM WINDOW LENGTH) ! This command specifies a lower bound on the size of the windows that LSE ! automatically creates. ! When you map a window to a buffer, LSE creates a new window if ! the window is not shorter than the parameter value (n). ! LSE uses the this command and the SET MAXIMUM WINDOWS ! setting to determine whether to add a window to the screen or to reuse ! an existing window. LSE checks both settings and creates a new ! window only if both conditions are met. ! ! RELATED COMMANDS: ! SET MAXIMUM WINDOWS ! SET BALANCE WINDOWS ! BALANCE WINDOWS ! SHOW commands ! HELP commands ! SHOW WINDOW ATTRIBUTES ! ! CATEGORY: ! Screen ! !doc_end ! local the_length; on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_minimum_window_length"); endon_error; if lse$prompt_number( number, the_length, lse$_minlenprompt, '', lse$$x_default_minimum_window_size ) = true then set (lse$min_window_len, lse$window, the_length); lse_set_minimum_window_length := true; else lse_set_minimum_window_length := false; endif; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_set_number_of_windows( ;number ) ! ! LSE Command: SET NUMBER OF WINDOWS ! !doc_begin ! ! ONE LINE DEFINITION: ! Sets a specific number of windows on the screen. ! ! DESCRIPTION: ! (SET NUMBER OF WINDOWS) ! This command immediately sets the number of windows on the screen to the ! number that you specify. ! ! RELATED COMMANDS: ! NEW WINDOW ! ONE WINDOW ! TWO WINDOWS ! DELETE WINDOW ! SHOW WINDOW ATTRIBUTES ! ! CATEGORY: ! Screen ! !doc_end ! local the_number; on_error [TPU$_MINVALUE]: eve$message(error_text); lse$post_command_proc; return(false); [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_number_of_windows"); endon_error; if lse$prompt_number( number, the_number, lse$_numwinprompt, '', 1 ) = true then set (lse$num_of_windows, lse$window, the_number); lse_set_number_of_windows := true; else lse_set_number_of_windows := false; endif; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_set_pending_delete (;boolean) ! !doc_begin ! ! ONE LINE DEFINITION: ! Specifies whether or not a selection in a user buffer is deleted ! when a user inserts text. ! ! DESCRIPTION: ! (SET PENDING DELETE) ! By default, this command is disabled (the parameter value is ! (off)). ! To delete selected text when you insert text, specify this ! command with the parameter value (on). This command ! is automatically disabled for a selection made with the SELECT ALL ! command. ! ! RELATED COMMANDS: ! RESTORE ! SELECT ALL ! ! CATEGORY: ! Tailor ! !doc_end ! LOCAL the_response; on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_pending_delete "); endon_error; if lse$prompt_boolean( boolean, the_response, lse$_penddelprompt, '', lse$_penddeldef ) then set (lse$pending_delete, lse$system, the_response); lse_set_pending_delete := true; else lse_set_pending_delete := false; endif; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_set_primary_selection_model (;selection_model) ! !doc_begin ! ! ONE LINE DEFINITION: ! Lets you choose between a focus-based primary selection model and a ! selection-based primary selection model. ! ! DESCRIPTION: ! (SET PRIMARY SELECTION MODEL) ! See the (DECwindows Companion to the OSF/Motif Style Guide) ! for more information. ! ! RELATED COMMANDS: ! SHOW ATTRIBUTES ! ! CATEGORY: ! Tailor ! !doc_end ! LOCAL the_selection_model, response; on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_primary_selection_model"); endon_error; ! Deal with the possible keyword ! IF selection_model <> tpu$k_unspecified THEN the_selection_model := str (selection_model); ELSE the_selection_model := tpu$k_unspecified; ENDIF; IF lse$prompt_list (the_selection_model, response, lse$_primselprompt, lse$_selmodeldelimit, lse$_selmodellist, false, '', lse$_selmodeldef ) THEN CASE response [lse$$k_sel_model_focus]: SET (lse$focus_based_select, lse$system, ON); [lse$$k_sel_model_selection]: SET (lse$focus_based_select, lse$system, OFF); [OTHERWISE]: EVE$MESSAGE( lse$_internerr, 0, 'lse_set_primary_selection_model' ); eve$learn_abort; lse$post_command_proc; RETURN false; ENDCASE; lse_set_primary_selection_model := true; ELSE lse_set_primary_selection_model := false; ENDIF; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_set_search_auto_reverse( ;boolean ) ! !doc_begin ! ! ONE LINE DEFINITION: ! Specifies that LSE search in the opposite direction if the string ! is not found in the current direction. ! DESCRIPTION: ! (SET SEARCH AUTO REVERSE) ! ! RELATED COMMANDS: ! SEARCH ! SHOW SEARCH ATTRIBUTES ! SUBSTITUTE commands ! ! CATEGORY: ! Cursor ! !doc_end ! local the_response; on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_search_auto_reverse"); endon_error; if lse$prompt_boolean( boolean, the_response, lse$_setseaatoprompt, '', lse$_setseaatodef ) then set (lse$auto_reverse, lse$search, the_response); ! lse$$x_search_attribute_changed := 1; lse_set_search_auto_reverse := true; else lse_set_search_auto_reverse := false; endif; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_set_search_case_sensitive( ;boolean ) ! !doc_begin ! ! ONE LINE DEFINITION: ! Specifies whether or not LSE matches case exactly when searching for text. ! DESCRIPTION: ! (SET SEARCH CASE SENSITIVE) ! ! RELATED COMMANDS: ! SEARCH ! SHOW SEARCH ATTRIBUTES ! SUBSTITUTE commands ! ! CATEGORY: ! Cursor ! !doc_end ! local the_response; on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_search_case_sensitive"); endon_error; if lse$prompt_boolean( boolean, the_response, lse$_setseacasprompt, '', lse$_setseacasdef ) then set (lse$case_sensitive, lse$search, the_response); lse$$x_search_attribute_changed := 1; lse_set_search_case_sensitive := true; else lse_set_search_case_sensitive := false; endif; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_set_search_diacritical( ;boolean ) ! !doc_begin ! ! ONE LINE DEFINITION: ! Specifies whether or not LSE exactly matches characters with ! diacritical markings when performing a search. ! ! DESCRIPTION: ! (SET SEARCH DIACRITICAL) ! The diacritical marks include the acute accent, grave accent, circumflex, ! tilde, macron, breve, hacek, umlaut, and cedilla. ! ! RELATED COMMANDS: ! SEARCH ! SHOW SEARCH ATTRIBUTES ! ! CATEGORY: ! Cursor ! !doc_end ! local the_response; on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_search_diacritical"); endon_error; if lse$prompt_boolean( boolean, the_response, lse$_setseadiaprompt, '', lse$_setseadiadef ) then set (lse$diacritical, lse$search, the_response); lse$$x_search_attribute_changed := 1; lse_set_search_diacritical := true; else lse_set_search_diacritical := false; endif; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_set_search_pattern( ;search_pattern_name ) ! ! Added pattern name none ! !doc_begin ! ! ONE LINE DEFINITION: ! Sets whether LSE uses ULTRIX, VMS or TPU style pattern matching for ! search strings. ! ! DESCRIPTION: ! (SET SEARCH PATTERN) ! For details of the pattern styles use the command HELP PATTERNS. ! ! RELATED COMMANDS: ! SHOW SEARCH ATTRIBUTES ! SUBSTITUTE commands ! PATTERN SEARCH ! ! CATEGORY: ! Cursor ! !doc_end ! local the_response; on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_search_pattern"); endon_error; IF lse$prompt_list( search_pattern_name, the_response, lse$_setseapatprompt, lse$_setseapatdel, lse$_setseapatlist, false, '', lse$_setseapatdef ) then case the_response from 1 to 3 [lse$$k_setseapat_vms]: the_response := lse$os_vms; [lse$$k_setseapat_ultrix]: the_response := lse$os_ultrix; [lse$$k_setseapat_tpu]: the_response := lse$os_tpu; [otherwise]: eve$message( lse$_internerr, 0, 'lse_set_search_pattern' ); eve$learn_abort; return false; endcase; set (lse$pattern, lse$search, the_response); lse$$x_search_attribute_changed := 1; lse_set_search_pattern := true; else lse_set_search_pattern := false; endif; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_set_search_span_space( ;boolean ) ! !doc_begin ! ! ONE LINE DEFINITION: ! Determines how LSE matches blank space in the search string. ! ! DESCRIPTION: ! (SET SEARCH SPAN SPACE) ! This command instructs LSE to allow each blank space in the search ! string to match sequences of one or more characters containing blanks, ! tabs, and, at most, a single line break. By default, spaces are not ! spanned. Not applicable to PATTERN SEARCH or PATTERN SUBSTITUTE commands. ! ! RELATED COMMANDS: ! SEARCH ! SHOW SEARCH ATTRIBUTES ! PATTERN SEARCH ! SUBSTITUTE ! ! CATEGORY: ! Cursor ! !doc_end ! local the_response; on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_search_span_space"); endon_error; if lse$prompt_boolean( boolean, the_response, lse$_setseaspsprompt, '', lse$_setseaspsdef ) then set (lse$span_space, lse$search, the_response); lse$$x_search_attribute_changed := 1; lse_set_search_span_space := true; else lse_set_search_span_space := false; endif; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_set_tabs_visible (;boolean) ! !doc_begin ! ! ONE LINE DEFINITION: ! Specifies whether or not visible tab symbols appear. ! ! DESCRIPTION: ! (SET TABS VISIBLE) ! By default, this command hides tab symbols ! (the parameter value is (off)). To make tabs visible, ! specify this command with the parameter value ! (on). The tabs appear as a combination of the HT ! (horizontal tab) symbol and dots (for example, HT.....). ! ! RELATED COMMANDS: ! SHOW WINDOW ATTRIBUTES ! ! CATEGORY: ! Tailor ! !doc_end ! LOCAL the_response; on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_tabs_visible "); endon_error; if lse$prompt_boolean( boolean, the_response, lse$_tabvisprompt, '', lse$_tabvisdef ) then set (lse$tabs_visible, lse$window, the_response ); lse_set_tabs_visible := true; else lse_set_tabs_visible := false; endif; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_set_tabs_hard (;boolean) ! !doc_begin ! ! ONE LINE DEFINITION: ! Specifies whether tab or blank characters are used for tabulation ! ! DESCRIPTION: ! (SET TABS HARD) ! By default, tab characters are used for indentation and tabulation ! (the parameter value is (on)). To stop using tab characters, ! specify this command with the parameter value ! (off). ! ! RELATED COMMANDS: ! SHOW WINDOW ATTRIBUTES ! ! CATEGORY: ! Tailor ! !doc_end ! LOCAL the_response; on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_tabs_hard "); endon_error; if lse$prompt_boolean( boolean, the_response, lse$_tabhrdprompt, '', lse$_tabhrddef ) then set (lse$tabs_hard, lse$window, the_response ); lse_set_tabs_hard := true; else lse_set_tabs_hard := false; endif; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_set_undo (;boolean) ! !doc_begin ! ! ONE LINE DEFINITION: ! Specifies whether or not UNDO processing is enabled. ! ! DESCRIPTION: ! (SET UNDO) ! By default, UNDO processing is enabled (the parameter value is ! (on)). To disable UNDO processing, specify this command with ! the parameter value (off). ! ! RELATED COMMANDS: ! SHOW WINDOW ATTRIBUTES ! ! CATEGORY: ! Tailor ! !doc_end ! LOCAL the_response; on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_undo "); endon_error; if lse$prompt_boolean( boolean, the_response, lse$_undoenprompt, '', lse$_undoendef ) then set (lse$undo, lse$window, the_response ); lse_set_undo := true; else lse_set_undo := false; endif; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_set_scroll_margins (;top_margin, bottom_margin) ! !doc_begin ! ! ONE LINE DEFINITION: ! Specifies the lines at the top and bottom of the buffer at which the ! cursor triggers scrolling. ! ! DESCRIPTION: ! (SET SCROLL MARGINS) ! This command sets the scroll lines at which scrolling is triggered ! by moving the cursor to these lines. The scroll margins you set apply ! to all windows in the current editing session. You specify the number ! of lines up from the top of the window or down from the bottom of the ! window at which you want scrolling to begin. You can optionally ! specify scroll margins as percentages of the window height. ! ! RELATED COMMANDS: ! SHOW WINDOW ATTRIBUTES ! ! EXAMPLE: ! The following example sets the scroll margins at two lines from the top and ! three lines from the bottom of all windows in the current editing session: ! ! ! LSE> SET SCROLL MARGINS 2 3 ! ! !

! This example sets the scroll margins at 10% from the top and 15% from the ! bottom of all windows in the current editing session: ! ! ! LSE> SET SCROLL MARGINS 10% 15% ! ! ! CATEGORY: ! Screen ! !doc_end ! LOCAL bottom, percent_entered, status, top, window_length; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_scroll_margins "); ENDON_ERROR; ! Calculate the window length ! window_length := get_info (current_window, "visible_length") - (get_info (current_window, "status_line") <> ""); if eve$x_decwindows_active then if get_info( current_window, 'scroll_bar', HORIZONTAL ) <> 0 then window_length := window_length - 1; endif; endif; ! Top margin parameter ! status := lse$prompt_percent( top_margin, top, lse$_topscrollprompt, percent_entered, '', STR( lse$$x_default_top_scroll_margin ) + '%' ); if status <> true then lse$$update_status_lines; lse$post_command_proc; return false; endif; if percent_entered = false then top := (top * 100) / window_length; endif; ! Bottom margin parameter ! status := lse$prompt_percent( bottom_margin, bottom, lse$_botscrollprompt, percent_entered, '', STR( lse$$x_default_bottom_scroll_margin ) + '%' ); if status <> true then lse$$update_status_lines; lse$post_command_proc; return false; endif; if percent_entered = false then bottom := (bottom * 100) / window_length; endif; ! Do the set ! SET( lse$top_scroll_margin, lse$window, top ); SET( lse$bottom_scroll_margin, lse$window, bottom ); lse$$update_status_lines; lse$post_command_proc; return true endprocedure; procedure lse_select ! !doc_begin ! ! ONE LINE DEFINITION: ! Toggles the select mark. ! ! DESCRIPTION: ! (SELECT) ! This command acts as a toggle to set the select mark if it is not set ! and deletes the select mark if it is set. ! ! RELATED COMMANDS: ! NEW SELECTION MARK ! DELETE SELECTION MARK ! ! CATEGORY: ! Text ! !doc_end ! on_error [otherwise]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_select"); endon_error; lse_select := eve_select; lse$post_command_proc; endprocedure; procedure lse_shift_left (;number) ! ! LSE Command: SHIFT LEFT ! ! !doc_begin ! ! ONE LINE DEFINITION: ! Shifts the window to the left or text to the right by the specified ! number of columns. ! ! DESCRIPTION: ! (SHIFT LEFT) ! By default, LSE shifts the window by one column. ! ! RELATED COMMANDS: ! SHIFT RIGHT ! ! CATEGORY: ! Screen ! !doc_end ! local column_number; on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_shift_left "); endon_error; if lse$prompt_number (number, column_number,'','',1) then shift (current_window, -column_number); lse_shift_left := TRUE; else lse_shift_left := FALSE; endif; lse$post_command_proc; endprocedure; procedure lse_shift_right (;number) ! ! LSE Command: SHIFT RIGHT ! ! !doc_begin ! ! ONE LINE DEFINITION: ! Shifts the window to the right or text to the left by the specified ! number of columns. ! ! DESCRIPTION: ! (SHIFT RIGHT) ! By default, LSE shifts the window by one column. ! ! RELATED COMMANDS: ! SHIFT LEFT ! ! CATEGORY: ! Screen ! !doc_end ! local column_number; on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_shift_right "); endon_error; if lse$prompt_number (number, column_number,'','',1) then shift (current_window, column_number); lse_shift_right := TRUE; else lse_shift_right := FALSE; endif; lse$post_command_proc; endprocedure; procedure lse_set_width( ;number ); ! ! LSE Command: SET WIDTH ! !doc_begin ! ! ONE LINE DEFINITION: ! Specifies the screen width. ! ! DESCRIPTION: ! (SET WIDTH) ! This command specifies the number of characters on each input or ! output line. The screen width parameter must be an integer in the ! range 1 through 252. ! ! RELATED COMMANDS: ! SET HEIGHT ! SHOW WINDOW ATTRIBUTES ! ! CATEGORY: ! Screen ! !doc_end ! local the_width; on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_width"); endon_error; if lse$prompt_number( number, the_width, lse$_widthprompt, '', lse$$x_default_screen_width) = true then set (lse$width, lse$window, the_width); lse_set_width := true; else lse_set_width := false; endif; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_show_attributes ! !doc_begin ! ! ONE LINE DEFINITION: ! Displays the current system attributes. ! ! DESCRIPTION: ! (SHOW ATTRIBUTES) ! These attributes include the status of warning bells, keypad ! emulation, cursor ! binding, clipboard use, tab appearance, and deletion. ! It also displays the name of the default directory, the source ! directory(s), and read-only directory(s). ! ! RELATED COMMANDS: ! SHOW SEARCH ATTRIBUTES ! SHOW WINDOW ATTRIBUTES ! ! CATEGORY: ! Help ! !doc_end ! on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_show_attributes"); endon_error; lse$show( lse$system ); lse_show_attributes := true; lse$post_command_proc; endprocedure; procedure lse_show_search_attributes ! !doc_begin ! ! ONE LINE DEFINITION: ! Displays the status of text-search options. ! DESCRIPTION: ! (SHOW SEARCH ATTRIBUTES) ! ! RELATED COMMANDS: ! SHOW ATTRIBUTES ! SHOW WINDOW ATTRIBUTES ! SET SEARCH commands ! ! CATEGORY: ! Help ! !doc_end ! on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_show_search_attributes"); endon_error; lse$show( lse$search ); lse_show_search_attributes := true; lse$post_command_proc; endprocedure; procedure lse_show_window_attributes ! ! LSE Command: SHOW WINDOW ATTRIBUTES ! !doc_begin ! ! ONE LINE DEFINITION: ! Displays the current window attributes. ! DESCRIPTION: ! (SHOW WINDOW ATTRIBUTES) ! ! RELATED COMMANDS: ! BALANCE WINDOWS ! SET WIDTH ! SET HEIGHT ! SET MAXIMUM WINDOWS ! SET MINIMUM WINDOW LENGTH ! SET FONT ! SHOW SEARCH ATTRIBUTES ! SHOW ATTRIBUTES ! ! CATEGORY: ! Help ! !doc_end ! ! Removed from one-liner: ! ! ! The window attributes include the width and height of the window, ! the maximum number of windows allowed, the minimum window length, ! whether windows will be balanced, and information about the font ! settings. ! ! on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_show_window_attributes"); endon_error; lse_show_window_attributes := lse$show( lse$window ); lse$post_command_proc; endprocedure; procedure lse_show_version ! ! LSE Command: SHOW VERSION ! !doc_begin ! ! ONE LINE DEFINITION: ! Displays the current version of LSE. ! DESCRIPTION: ! (SHOW VERSION) ! ! RELATED COMMANDS: ! SHOW SUMMARY ! ! CATEGORY: ! Help ! !doc_end ! on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_show_version"); endon_error; lse$show( lse$editor_version ); lse_show_version := true; lse$post_command_proc; endprocedure; procedure lse_show_summary ! !doc_begin ! ! ONE LINE DEFINITION: ! Shows statistics and other information about LSE. ! ! DESCRIPTION: ! (SHOW SUMMARY) ! ! This command shows the following information: ! ! (UNNUMBERED) ! Version number of the software ! Current journal file specification (if any) ! Current section file specification ! Total number of buffers (system- and user-created) ! Modules used in the section file ! Other information about LSE configuration ! ! ! This information is useful for TPU programming or in case you ! need to submit a software performance report (SPR). ! ! RELATED COMMANDS: ! SHOW VERSION ! ! CATEGORY: ! Help ! !doc_end ! LOCAL saved_modifiable; ON_ERROR [OTHERWISE]: IF saved_modifiable <> 0 THEN SET( MODIFIABLE, CURRENT_BUFFER, saved_modifiable ); ENDIF; lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_show_summary"); ENDON_ERROR; LSE$SHOW( SUMMARY ); POSITION( BUFFER_END ); saved_modifiable := SET( MODIFIABLE, CURRENT_BUFFER, ON ); SPLIT_LINE; eve$insert_module_summary; SET( MODIFIABLE, CURRENT_BUFFER, saved_modifiable ); POSITION( BUFFER_BEGIN ); lse$post_command_proc; endprocedure; procedure lse_spawn (;cli_command) ! !doc_begin ! ! ONE LINE DEFINITION: ! Creates a subprocess running a command interpreter and suspends ! the editing session. ! ! DESCRIPTION: ! (SPAWN) ! This command suspends the current LSE session and connects your ! terminal to a new process at the command level. !

! If you specified a command to execute, the command will be executed ! at the command line interpretter and you will immediately return to ! LSE. If you don't specify a command, LSE will remain at the command ! level until you terminate the process. This command is useful for running screen-oriented ! programs and utilities without ending the current editing session. ! ! RELATED COMMANDS: ! ATTACH ! CLI ! ! CATEGORY: ! Editing ! !doc_end ! local the_response; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_spawn "); ENDON_ERROR; if lse$prompt_string( cli_command, the_response, lse$_commandprompt, '', lse$get_message_text( lse$_spawndef ) ) then lse_spawn := eve_spawn (the_response); else lse_spawn := false; endif; lse$post_command_proc; endprocedure; procedure lse_spell ! !doc_begin ! ! ONE LINE DEFINITION: ! Runs DECspell on OpenVMS systems to check the currently selected text ! or the entire buffer for spelling errors. ! ! DESCRIPTION: ! (SPELL) ! To run DECspell: ! ! (NUMBERED) ! Select the text you want to check. If you do not select any text, ! SPELL checks the entire buffer. ! Enter the SPELL command. If you have less than a full line, LSE extends ! the selected range to include the beginning and end of the line ! containing the range. ! !

! If the selected range (or the entire buffer) contains any overview ! records, a message informs you that the operation cannot be performed. !

! LSE spawns a subprocess to run DECspell and writes out the current ! buffer or selected range to a temporary file in SYS$SCRATCH. (The ! name of the temporary file uses the subprocess PID.) When SPELL finishes, ! LSE replaces the buffer or selected range with the new version ! of the temporary file (with corrections) and deletes any old versions ! of the temporary file. You then resume editing. !

! Do not use Ctrl/Y with SPELL. Ctrl/Y deletes lines in the temporary ! output file, which destroys the selected range or current buffer. ! ! CATEGORY: ! Text ! !doc_end ! local text_ptr, start_mark, end_mark, range_ptr; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_spell"); ENDON_ERROR; lse_spell := eve_spell; lse$post_command_proc; endprocedure; procedure lse_enlarge_window (;number) ! !doc_begin ! ! ONE LINE DEFINITION: ! Enlarges the current window by the specified number of lines. ! ! DESCRIPTION: ! (ENLARGE WINDOW) ! LSE shrinks the other window (or windows) accordingly. ! ! RELATED COMMANDS: ! SHRINK WINDOW ! NEW WINDOW ! ! CATEGORY: ! Screen ! !doc_end ! local the_response; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_enlarge_window "); ENDON_ERROR; if lse$prompt_number (number, the_response, '', '', 1) then lse_enlarge_window := eve_enlarge_window (the_response); else lse_enlarge_window := false; endif; lse$post_command_proc; endprocedure; procedure lse_shrink_window (;number) ! !doc_begin ! ! ONE LINE DEFINITION: ! Shrinks the current window. ! ! DESCRIPTION: ! (SHRINK WINDOW) ! LSE enlarges the other window (or windows) accordingly. ! ! RELATED COMMANDS: ! ENLARGE WINDOW ! NEW WINDOW ! ! CATEGORY: ! Screen ! !doc_end ! local the_response; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_shrink_window "); ENDON_ERROR; if lse$prompt_number (number, the_response, '', '', 1) then lse_shrink_window := eve_shrink_window (the_response); else lse_shrink_window := false; endif; lse$post_command_proc; endprocedure; procedure lse_new_window (;number) ! !doc_begin ! ! ONE LINE DEFINITION: ! Divides the current window into two or more windows. ! ! DESCRIPTION: ! (NEW WINDOW) ! This command divides the current window into two or more windows ! depending on the number of windows you specify. LSE displays the ! current buffer in each of the new windows. ! ! RELATED COMMANDS: ! DELETE WINDOW ! TWO WINDOWS ! ! CATEGORY: ! Screen ! !doc_end ! local window_number; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_new_window "); ENDON_ERROR; if lse$prompt_number (number, window_number,'','',2) = TRUE then if window_number < 2 then eve$message(TPU$_MINVALUE, 0, 2); lse_new_window := FALSE; else lse_new_window := lse$$split_window_always (window_number); endif; else lse_new_window := FALSE; endif; lse$post_command_proc; endprocedure; procedure lse_top ! !doc_begin ! ! ONE LINE DEFINITION: ! Moves the cursor to the beginning of the current buffer. ! DESCRIPTION: ! (TOP) ! ! RELATED COMMANDS: ! BOTTOM ! ! CATEGORY: ! Cursor ! !doc_end ! ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_top"); ENDON_ERROR; ! ! Save OLD BPM for UNDO ! lse$$save_old_bpm; lse_top := lse$top; ! ! Save NEW BPM for UNDO ! lse$$save_new_bpm; lse$post_command_proc; endprocedure; procedure lse_two_windows ! !doc_begin ! ! ONE LINE DEFINITION: ! Splits the current window into two windows. ! DESCRIPTION: ! (TWO WINDOWS) ! ! RELATED COMMANDS: ! DELETE WINDOW ! ENLARGE WINDOW ! ONE WINDOW ! NEXT WINDOW ! PREVIOUS WINDOW ! SHRINK WINDOW ! NEW WINDOW ! ! CATEGORY: ! Screen ! !doc_end ! ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_two_windows"); ENDON_ERROR; lse_two_windows := lse$$split_window_always( 2 ); lse$post_command_proc; endprocedure; procedure lse_restore( ;restore_option ) ! !doc_begin ! ! ONE LINE DEFINITION: ! Restores the text deleted by the most recent ERASE command ! ! DESCRIPTION: ! (RESTORE) ! LSE inserts the restored text before the current cursor position, except ! for RESTORE (placeholder), which restores the text to its ! original position. ! If you do not specify a restore option, LSE restores the text erased by ! the most recent ERASE command, ! ! RELATED COMMANDS: ! ERASE commands ! ! CATEGORY: ! Text ! !doc_end ! LOCAL response, local_option; ON_ERROR [LSE$_NOERAPLCH, LSE$_UNERASEBUF]: EVE$MESSAGE (error_text); lse$post_command_proc; return false; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_restore"); ENDON_ERROR; IF (restore_option = tpu$k_unspecified) OR (restore_option = '' ) THEN ! Default to last erase ! local_option := lse$$x_erase_object; ELSE ! Pick the right one ! IF lse$prompt_list( restore_option, response, '', lse$_restoredelimit, lse$_restorelist, false ) THEN CASE response FROM 1 TO 5 [lse$$k_restore_character]: local_option := erase_k_character; [lse$$k_restore_line]: local_option := erase_k_line; [lse$$k_restore_placeholder]:local_option := erase_k_placeholder; [lse$$k_restore_selection]: local_option := erase_k_selection; [lse$$k_restore_word]: local_option := erase_k_word; [otherwise]: eve$message( lse$_internerr, 0, 'lse_restore' ); eve$learn_abort; return false; ENDCASE; ELSE eve$learn_abort; return false; ENDIF; ENDIF; CASE local_option FROM erase_k_nothing TO erase_k_word [erase_k_character] : lse_restore := lse$$unerase_character; [erase_k_line] : lse_restore := lse$$unerase_line; [erase_k_placeholder] : lse_restore := lse$$unerase_placeholder(); [erase_k_selection] : lse_restore := lse$$unerase_selection; [erase_k_word] : lse_restore := lse$$unerase_word; [otherwise] : lse_restore := FALSE; ENDCASE; lse$post_command_proc; endprocedure; procedure lse_compile(;compile_command) ! ! Compile the file in the current buffer. ! ! Syntax: COMPILE [compile_command] ! ! Description: ! LSE compiles the file in the current buffer, using the command string ! supplied. If no command is given, the default compile command is retrieved ! from the language definition template. LSE then examines the command for the ! following special symbols: ! 1) If the command string begins with "$", the default compile command ! is substituted. ! 2) If the string "'lse$file'" (including the apostrophes) is found ! anywhere in the command string, the file name of the current buffer ! is substituted. This string may be part of the default compile command ! if desired. ! ! EXAMPLES: ! default compile command = "cc -g" ! current buffer's file name = "program.c" ! ! command string = "$ -Dx -O" ! result = "cc -g -Dx -O program.c" ! ! command string = "$ -Dx -O 'lse$file' -l libX" ! result = "cc -g -Dx -O program.c -l libX" ! ! Notice that in the first example, the buffer's file name was appended ! to the end of the compile command string; the special symbol 'lse$file' ! is only needed if a different position is desired. ! ! The buffer is then checkpointed (written out if it has been modified since ! it was last written out) and if any $REVIEW buffers are open, ! they are closed. ! ! All terminal output during the compile is displayed in the $MESSAGE ! buffer. If there were any errors in the compilation, the user is ! asked to REVIEW them (see REVIEW). ! ! Related commands: REVIEW, GOTO REVIEW ! !doc_begin ! ! ONE LINE DEFINITION: ! Lets you compile the contents of a buffer without leaving LSE. ! ! DESCRIPTION: ! (COMPILE) ! When you enter this command, LSE writes the current buffer. It then ! forms a command line ! by appending the file specification of the current buffer to the ! command string given on the COMPILE command. ! The default compile command is determined by the language ! definitions. If no compile command is specified, then the compile ! command associated with the current buffer's language is used. !

! If you want to generate a diagnostics file for use with the REVIEW ! command and the current language has diagnostics capability, specify ! the appropriate diagnostics switch in either the language's default ! compile command or in your (user-supplied) command. ! (For example, on OpenVMS systems, COMPILE "CC/DIA".) ! ! RELATED COMMANDS: ! REVIEW ! GOTO REVIEW ! COMPILE REVIEW ! SET LANGUAGE COMPILE ! REVIEW FILE ! REVIEW BUFFER ! SET SAVE RELATED BUFFERS ! ! CATEGORY: ! Compile ! !doc_end ! local compile_buffer, compile_output_buffer; compile_buffer := current_buffer; compile_output_buffer := lse$$setup_show_window ("$compile"); lse$$compile_buffer (compile_buffer, compile_command, compile_output_buffer); lse$$finish_show_window(); lse$post_command_proc; return TRUE; endprocedure; procedure lse_compile_review(;compile_command) ! !doc_begin ! ! ONE LINE DEFINITION: ! Compile the contents of the current buffer, and then review any errors. ! ! DESCRIPTION: ! (COMPILE REVIEW) ! When you enter this command, LSE writes the current buffer. It then ! forms a command line by appending the file specification of the current buffer ! to the specified compile command. If no command is specified, the ! one associated with the current language is used. !

! The language of the current buffer must have diagnostics capability ! and you must specify the diagnostics switch for the compiler you are ! using. ! (For example on OpenVMS, COMPILE REVIEW "CC/DIA".) ! ! RELATED COMMANDS: ! COMPILE ! REVIEW ! SET LANGUAGE COMPILE ! GOTO REVIEW ! SET SAVE RELATED BUFFERS ! ! CATEGORY: ! Compile ! !doc_end ! local compile_buffer; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error(ERROR, ERROR_TEXT, ERROR_LINE, "lse_compile_review"); RETURN FALSE; ENDON_ERROR; ! Make sure the buffer that we are trying to compile is not the $REVIEW ! buffer (Wishlist item # 295) ! if (get_info (current_buffer, 'name') = '$REVIEW') then lse_close_buffer (current_buffer); endif; ! Guarantee that we're still in current_buffer when we're through ! with the compile ! lse$$push_position; lse$$compile_buffer (current_buffer, compile_command); lse$$pop_position; lse_review; endprocedure; procedure lse_review ! ! Add COMPILE to Related Commands. ! !doc_begin ! ! ONE LINE DEFINITION: ! Displays a set of diagnostic messages resulting from a ! compilation of the current buffer. ! DESCRIPTION: ! (REVIEW) ! ! RELATED COMMANDS: ! CLOSE BUFFER ! GOTO REVIEW ! GOTO SOURCE ! NEXT ERROR ! PREVIOUS ERROR ! REVIEW BUFFER ! REVIEW FILE ! ! CATEGORY: ! Compile ! !doc_end ! ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_review"); ENDON_ERROR; lse_review := lse_review_buffer (current_buffer); lse$post_command_proc; endprocedure; procedure lse_review_buffer (;buffer_name) ! !doc_begin ! ! ONE LINE DEFINITION: ! Displays a set of diagnostic messages resulting from a ! compilation of the specified buffer. ! ! DESCRIPTION: ! (REVIEW BUFFER) ! LSE tries to read a set of diagnostics from a file. ! It uses the name of the file associated with the buffer, but with ! a unique file type (for example, .DIA). ! !

! You can use this command at any time to change the set of ! diagnostics to be reviewed. If you use this command to return to a ! set of diagnostics, the last diagnostic and region selected in that set ! become the current diagnostic and region. ! ! ! RELATED COMMANDS: ! CLOSE BUFFER ! GOTO REVIEW ! GOTO SOURCE ! NEXT ERROR ! PREVIOUS ERROR ! REVIEW ! REVIEW FILE ! ! CATEGORY: ! Compile ! !doc_end ! local buffer_ptr; LOCAL status; ON_ERROR [LSE$_CANTREV, LSE$_CANTREVSYS]: eve$message (ERROR_TEXT); lse$post_command_proc; eve$learn_abort; return false; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_review_buffer "); ENDON_ERROR; ! The error reporting depends on multiple messages being output from one ! signal vector. TPU's error handling doesn't allow for outputing ! multiple messages from one signal. Thus, this procedure has not error trap. ! if lse$prompt_existing_buffer ( buffer_name, buffer_ptr, "", "", current_buffer) then status := lse$review (buffer_ptr); if status then ! The review was successful ! if NOT get_info( buffer_ptr, 'modified' ) then ! If the buffer has not been modified was assume that the contents ! match the information in the .DIA, So it needs to be renumbered. ! This may seem redundant because COMPILE renumbers the buffer as ! well. However, in an integrated environment, LSE's compile ! command may not be used to compile the file. LSE will be used ! to write the file, leaving it "unmodified". The user can still ! shoot himself in the foot, but only be ding things manually. ! lse$renumber_buffer(buffer_ptr); endif; endif; else status := FALSE; endif; lse$post_command_proc; return status; endprocedure; procedure lse_review_file (;file_spec) ! ! Add COMPILE REVIEW to Related Commands. ! !doc_begin ! ! ONE LINE DEFINITION: ! Displays a set of diagnostic messages, from the specified diagnostics file, ! resulting from a compilation. ! DESCRIPTION: ! (REVIEW FILE) ! ! RELATED COMMANDS: ! COMPILE ! CLOSE BUFFER ! GOTO REVIEW ! REVIEW ! REVIEW BUFFER ! ! CATEGORY: ! Compile ! !doc_end ! LOCAL the_file_spec; ! ! Many errors are signaled during the parsing of the diagnostics file and when ! locating and reading that file. ! ON_ERROR [OTHERWISE]: lse$post_command_proc; eve$learn_abort; return false; ENDON_ERROR; IF NOT lse$prompt_existing_file (file_spec, the_file_spec, lse$_diafilprompt, eve$_nofilespec, tpu$k_unspecified, ! Default value 'REVIEW FILE', ! DECwindows title '*.dia', ! Files to display 'REVIEW FILE !AS') ! Asynchronous command THEN lse$post_command_proc; RETURN false; ENDIF; lse_review_file := lse$review (the_file_spec); lse$post_command_proc; ENDPROCEDURE; procedure lse_toggle_insert_overstrike ! ! LSE Command: TOGGLE INSERT OVERSTRIKE ! ! Changes the text entry mode from OVERSTRIKE to INSERT, or vice versa. ! !doc_begin ! ! ONE LINE DEFINITION: ! Switches the text-entry mode in the current buffer between insert ! and overstrike. ! ! DESCRIPTION: ! (TOGGLE INSERT OVERSTRIKE) ! The status line displays the current text-entry mode. ! ! RELATED COMMANDS: ! SET BUFFER TEXT ! ! CATEGORY: ! Tailor ! !doc_end ! ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_toggle_insert_overstrike"); ENDON_ERROR; if get_info (current_buffer, "mode") = OVERSTRIKE then lse_set_buffer_text(insert); else lse_set_buffer_text(overstrike); endif; lse_toggle_insert_overstrike := (true); lse$$update_status_lines; lse$post_command_proc; endprocedure; PROCEDURE lse_uppercase ! !doc_begin ! ! ONE LINE DEFINITION: ! Changes the current word or the selected range to uppercase. ! ! DESCRIPTION: ! (UPPERCASE) ! If the word contains both uppercase and lowercase characters, LSE changes ! all letters to uppercase. If the cursor is between words, LSE changes the ! following word to uppercase. If a selected range is active, all the ! characters within that range are changed to uppercase. The cursor then ! moves to the start of the next word. ! ! RELATED COMMANDS: ! CAPITALIZE ! CHANGE CASE ! LOWERCASE ! ! CATEGORY: ! Text ! !doc_end ! ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_uppercase"); ENDON_ERROR; lse_uppercase := eve_uppercase_word; lse$post_command_proc; endprocedure; procedure lse_what_line ! !doc_begin ! ! ONE LINE DEFINITION: ! Shows the current line number and total number of lines in the buffer. ! ! DESCRIPTION: ! (WHAT LINE) ! This command also shows what percentage of the lines in the ! buffer are located above the current line. ! ! RELATED COMMANDS: ! LINE ! ! CATEGORY: ! Help ! !doc_end ! ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_what_line"); ENDON_ERROR; lse_what_line := eve_what_line; lse$post_command_proc; endprocedure; procedure LSE_QUOTE ! !doc_begin ! ! ONE LINE DEFINITION: ! Enters a control code or other character as text. ! ! DESCRIPTION: ! (QUOTE) ! If you use the NEW KEY command to define a printing key ! (letter, number, or punctuation mark) or a control key, you can use the ! QUOTE command to enter the ! character or control code normally bound to that key. ! ! RELATED COMMANDS: ! QUOTE KEYNAME ! ! EXAMPLE: ! The following example shows how you can use the QUOTE command to enter ! strings for SEARCH or SUBSTITUTE commands: ! ! (NUMBERED) ! Enter the SEARCH or SUBSTITUTE command. ! Press the key defined for the QUOTE command (Ctrl/V by default). ! Press Ctrl/J for the line-feed character. ! ! !

! You can define a typing key or a control key and then use the QUOTE command ! to enter the character or control code normally bound to that key. For ! example, if you defined the tilde to execute a procedure, you insert a ! tilde character by doing the following: ! ! (numbered) ! Press CTRL/V. ! Type the tilde (~). ! ! ! ! CATEGORY: ! Text ! !doc_end ! LOCAL the_key; ON_ERROR [TPU$_NOTMODIFIABLE]: eve$message (ERROR_TEXT); lse$post_command_proc; eve$learn_abort; return false; [TPU$_NOCHARREAD]: eve$message ('Invalid key for QUOTE command (' + str(eve$key_name (last_key)) + ')' ); lse$post_command_proc; eve$learn_abort; return false; [TPU$_READABORTED]: eve$message (ERROR_TEXT); eve$message (lse$_operationabort); lse$post_command_proc; eve$learn_abort; return false; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_quote"); ENDON_ERROR; ! if pending delete is active, put select range into $RESTORE$SELECTION$ buffer if (eve$x_select_position <> 0) AND eve$$x_state_array {eve$$k_pending_delete_active} then lse$$erase_selection(); endif; the_key := read_char; copy_text (the_key); lse$post_command_proc; endprocedure; procedure LSE_INDENT_LEFT ! !doc_begin ! ! ONE LINE DEFINITION: ! Removes leading blanks and tabs from lines to move one tab stop. ! ! DESCRIPTION: ! (INDENT LEFT) ! If a selected range is active, this command removes blanks and ! tabs from each line of text in the selected range. If you do ! not select a range, this command operates on the current line. ! ! RELATED COMMANDS: ! INDENT RIGHT ! SHIFT LEFT ! SHIFT RIGHT ! ! CATEGORY: ! Text ! !doc_end ! ON_ERROR [TPU$_NOTMODIFIABLE, LSE$_UNMODIFIABLE]: EVE$MESSAGE (LSE$_UNMODIFIABLE, 0, lse$get_message_text (lse$_indentleft)); eve$learn_abort; lse$post_command_proc; return false; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_indent_left"); ENDON_ERROR; LSE_INDENT_LEFT := lse$indent(left); lse$post_command_proc; endprocedure; procedure LSE_INDENT_RIGHT ! !doc_begin ! ! ONE LINE DEFINITION: ! Adds leading blanks and tabs to lines to move one tab stop. ! ! DESCRIPTION: ! (INDENT RIGHT) ! If a selected range is active, this command adds blanks and ! tabs to each line of text in the selected range. If you do ! not select a range, this command operates on the current line. ! ! ! RELATED COMMANDS: ! INDENT LEFT ! SHIFT LEFT ! SHIFT RIGHT ! ! CATEGORY: ! Text ! !doc_end ! ON_ERROR [TPU$_NOTMODIFIABLE, LSE$_UNMODIFIABLE]: EVE$MESSAGE (LSE$_UNMODIFIABLE, 0, lse$get_message_text (lse$_indentright)); eve$learn_abort; lse$post_command_proc; return false; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_indent_right"); ENDON_ERROR; LSE_INDENT_RIGHT := lse$indent(right); lse$post_command_proc; endprocedure; ! ! LSE Command: NEXT ERROR ! ! This command has no arguments. ! !doc_begin ! ! ONE LINE DEFINITION: ! Selects the next diagnostic in the current set of diagnostics. ! ! DESCRIPTION: ! (NEXT ERROR) ! This command positions the cursor at the next diagnostic in the ! review buffer, which contains the current set of diagnostics. ! If necessary, LSE remaps the review buffer. ! ! RELATED COMMANDS: ! GOTO REVIEW ! PREVIOUS ERROR ! REVIEW ! ! CATEGORY: ! Compile ! !doc_end ! procedure LSE_NEXT_ERROR ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "LSE_NEXT_ERROR" ); ENDON_ERROR; LSE_NEXT_ERROR := lse$move_by_error(forward); lse$post_command_proc; endprocedure; procedure LSE_PREVIOUS_ERROR ! ! LSE Command: PREVIOUS ERROR ! !doc_begin ! ! ONE LINE DEFINITION: ! Selects the previous diagnostic in the current set of diagnostics. ! ! DESCRIPTION: ! (PREVIOUS ERROR) ! This command positions the cursor at the previous diagnostic ! in the review buffer, which contains the current set of diagnostics. ! If necessary, LSE remaps the review buffer. ! ! RELATED COMMANDS: ! GOTO REVIEW ! NEXT ERROR ! REVIEW ! ! CATEGORY: ! Compile ! !doc_end ! ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_previous_error"); ENDON_ERROR; LSE_PREVIOUS_ERROR := lse$move_by_error(reverse); lse$post_command_proc; endprocedure; procedure lse_collapse (; depth) ! !Insert commands for DEFINE ADJUSTMENT, DEFINE LANGUAGE, and MODIFY !LANGUAGE under Related Commands. ! !doc_begin ! ! ONE LINE DEFINITION: ! Compresses text and displays an overview at the current cursor position. ! ! DESCRIPTION: ! (COLLAPSE) ! Low-level detail lines are replaced by a single ! overview line. The cursor position is recorded before the text is ! collapsed for use with future EXPAND commands. ! The editor determines the relative level of detail of a line by ! comparing the indentation of the line with the indentation of other ! lines. The editor's treatment of the indentation of a line is ! influenced by indentation adjustment definitions. ! For more information, see the ADJUSTMENT command. ! ! RELATED COMMANDS: ! NEW ADJUSTMENT ! SET ADJUSTMENT commands ! EXPAND ! FOCUS ! SET BUFFER OVERVIEW ! VIEW SOURCE ! ! CATEGORY: ! Program ! !doc_end ! LOCAL local_depth, depth_type, dummy; ON_ERROR [LSE$_CANTCOMPRESS, LSE$_CANTOVERVIEW, LSE$_NOPSEDELIM, LSE$_NOLANG]: eve$message( ERROR_TEXT ); lse$post_command_proc; eve$learn_abort; RETURN FALSE; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_collapse "); ENDON_ERROR; if lse$is_show_list( current_buffer ) then lse$prompt_depth(depth, local_depth, '', '', 1); lse_collapse := lse$shlst_collapse( MARK( NONE ) ); lse$disable_undo (lse$_undooverview, 'overview'); else if lse$prompt_depth(depth, local_depth, '', '', 1) then lse_collapse := lse$collapse(local_depth); lse$disable_undo (lse$_undooverview, 'overview'); else lse_collapse := false; endif; endif; lse$post_command_proc; endprocedure; procedure lse_expand (;depth) ! ! Add DEFINE ADJUSTMENT, DEFINE LANGUAGE, MODIFY LANGUAGE to related ! commands. ! !doc_begin ! ! ONE LINE DEFINITION: ! Replaces tokens, placeholders, overview lines, or show lists with ! appropriate text. ! ! DESCRIPTION: ! (EXPAND) ! Replaces placeholders, token names, alias names, routine names, ! overview lines, or show list lines at the current cursor position with ! the appropriate body of text or code associated with the overview ! line down to the specified depth. ! ! The EXPAND CASE setting (defined with the DEFINE LANGUAGE command or MODIFY ! LANGUAGE command) determines the case of the inserted ! text. If the EXPAND CASE is UPPER or LOWER, LSE inserts ! the text in that case. If the EXPAND CASE is AS_IS, LSE ! inserts the text as it appears in the token definition. ! !

! The editor determines the relative level of detail of a line by ! comparing the indentation of the line with the indentation of other ! lines. The editor's treatment of the indentation of a line is ! influenced by indentation adjustment definitions. ! ! ! RELATED COMMANDS: ! COLLAPSE ! DELETE EXPAND ! FOCUS ! SET BUFFER OVERVIEW ! VIEW SOURCE ! NEW ADJUSTMENT ! SET ADJUSTMENT commands ! ! CATEGORY: ! Program ! !doc_end ! local local_depth; ON_ERROR [LSE$_NOLANG, LSE$_CANTEXPAND, LSE$_NOTNEARBY, LSE$_PLACUNDPLAC, LSE$_PLCHNOTDEF, LSE$_NULLPLACDEF, LSE$_NULLTOKDEF, LSE$_TEMPUNDPLAC]: eve$message( error_text ); eve$learn_abort; lse$post_command_proc; return false; [LSE$_UNMODIFIABLE]: eve$message( error, 0, 'EXPAND' ); eve$learn_abort; lse$post_command_proc; return false; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_expand "); ENDON_ERROR; if lse$is_show_list( current_buffer ) then IF NOT lse$shlst_expand( current_buffer ) THEN eve$message( lse$_cantexpand ); lse_expand := false; ENDIF; else if lse$is_overview() ! use cursor as default marker then if lse$prompt_depth(depth, local_depth, '', '', 1) then lse_expand := lse$expand_overview(local_depth); else lse_expand := false; endif; else lse_expand := lse$expand_template(); ! The old LSE support for EXPAND doesn't do the automatic position ! on the placeholder stuff if the text is not visible to the ! user. I've chosen not to that the V3.1 code. ! if current_buffer <> get_info( current_window, 'buffer' ) then lse$move_by_placeholder(FORWARD, TRUE, FALSE); endif; endif; endif; lse$post_command_proc; endprocedure; procedure lse_enter_comment( ;comment_type ) ! ! Now takes a comment type, i.e. not always block comment I ! captured the old descriptions for ENTER COMMENT LINE and ! ENTER COMMENT_BLOCK. ! !doc_begin ! ! ONE LINE DEFINITION: ! Converts pseudocode into comments using block or line format. ! ! DESCRIPTION: ! (ENTER COMMENT) ! If the cursor is on a pseudocode placeholder, the command ! moves the placeholder's text into a comment ! and replaces the placeholder with the LSE$GENERIC placeholder. ! The cursor is then positioned on the generic placeholder. !

! If the cursor is in a comment, the LSE editor finds ! a nearby pseudocode placeholder and converts its ! content into a comment. The LSE$GENERIC placeholder is inserted ! in its place and the cursor remains on the generic placeholder. !

! If the cursor is not on a placeholder or a comment, ! the command inserts a new comment and puts the LSE$GENERIC ! placeholder inside the comment. ! The cursor is then positioned on the generic placeholder. !

! If there is a sequence of pseudocode placeholders and a selected ! range is active, all text in the ! selected range is converted into a comment and the placeholders ! are replaced with LSE$GENERIC placeholders accordingly. ! The cursor is positioned on the first placeholder after ! the comment. ! ! EXAMPLE: ! The following example converts pseudocode to comments in line format: ! ! ! «This is something interesting.» ! ! !

! Entering the ENTER COMMENT LINE command ! causes LSE to convert the pseudocode placeholder to a comment as follows: ! ! ! {tbs} ! This is something interesting. ! ! !

! The following example converts pseudocode to comments in block format: ! ! ! «We will move the third item from the left to be the» ! «next to the last item from the right in this case.» ! ! !

! If there is a selected range active for both lines, entering ! the ENTER COMMENT BLOCK command ! causes LSE to convert the pseudocode placeholder to comments, as follows: ! ! ! --We will move the third item from the left to be the ! --next to the last item from the right in this case. ! {tbs} ! ! ! ! RELATED COMMANDS: ! ENTER commands ! ERASE commands ! ! CATEGORY: ! Program ! !doc_end ! ! Add Entering to CATEGORY ! LOCAL response; ON_ERROR [LSE$_NOLANG, LSE$_PLCHNOTDEF]: EVE$MESSAGE (ERROR_TEXT); eve$learn_abort; lse$post_command_proc; return false; [TPU$_NOTMODIFIABLE, LSE$_UNMODIFIABLE]: EVE$MESSAGE (LSE$_UNMODIFIABLE, 0, "ENTER COMMENT"); eve$learn_abort; lse$post_command_proc; return false; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_enter_comment"); ENDON_ERROR; IF lse$prompt_list( comment_type, response, '', lse$_cmnttypedelimit, lse$_cmnttypelist, false, '', lse$_cmnttypedef ) THEN CASE response [lse$$k_cmnttype_block]: lse$$save_inserted_text(); lse$$save_undo_reverse_cmd(4, -1); lse_enter_comment := lse$enter_comment( lse$block_comment ); lse$$save_redo_reverse_cmd(3,comment_type); ! lse$$reset_undo_buf (CURRENT_BUFFER); ! EVE$MESSAGE (lse$_resetundobuf); [lse$$k_cmnttype_line]: lse$$save_inserted_text(); lse$$save_undo_reverse_cmd(4, -1); lse_enter_comment := lse$enter_comment( lse$line_comment ); lse$$save_redo_reverse_cmd(3,comment_type); ! lse$$reset_undo_buf (CURRENT_BUFFER); ! EVE$MESSAGE (lse$_resetundobuf); [OTHERWISE]: eve$message( lse$_internerr, 0, 'lse_enter_comment' ); ENDCASE; ELSE lse_enter_comment := FALSE; ENDIF; lse$post_command_proc; endprocedure; procedure lse_new_key( ;user_key_name, lse_command, help_topic, remark, legend, tpu_command); ! !doc_begin ! ! ONE LINE DEFINITION: ! Binds an LSE command to a key. ! ! DESCRIPTION: ! (NEW KEY) ! In most cases, you can bind commands to control keys, to numeric ! keypad keys, and to the arrow keys on all keyboards. You may also bind a ! command to the sequence of a meta key followed by any keyboard ! key. !

! The effect of a key can vary with the editing context. The NEW KEY ! command provides definitions for keys that are used in the ! user buffers. !

! The name of the special keys to be defined may be entered in keyword format ! or may be entered literally ! with the use of the GOLD-CTRL/V key. (see the Parameter Glossary for ! details). !

! If you change the definition of a key that was previously defined, ! LSE does not save the previous definition. ! ! RELATED COMMANDS: ! SHOW KEY ! DELETE KEY ! ! EXAMPLE: ! In this example, the key sequence ctrl/B issues a TOP command: ! ! ! LSE> NEW KEY CTRL/B TOP ! ! !

! In this example, the key sequence ctrl/B issues a BOTTOM command. ! The help topic (Bottom), remark, and ! legend that appear in SHOW KEY MAP is "BOT": ! ! ! LSE> NEW KEY GOLD-CTRL/B BOTTOM Bottom "My position in the bottom" BOT ! ! ! (gold ctrl key, multiple fields) ! !

! In this example, F7 is bound to the LSE command GOTO SOURCE through its ! TPU procedure name: ! ! ! LSE> NEW KEY F7 "" "" "" "" LSE_GOTO_SOURCE ! ! ! (Function key, lse command as tpu proc) ! !

! In this example, NEXT_SCREEN or E6 is bound to the user procedure, ! WC_NEXT_SCREEN (WC_ is an enabled grammar prefix): ! ! ! LSE> NEW KEY NEXT_SCREEN "" "" "" "" WC_NEXT_SCREEN ! ! ! (E key and user tpu proc) ! !

! In this example, EXPLANATION NEEDED ! ! ! LSE> NEW_KEY ALT/SHIFT/CTRL/SELECT "SELECT ALL" "" "" "Sel A" ! ! ! ! DECwindows only cord of shift,ctrl,select bound to SELECT ALL, ! ! DECwindows only corded, multi word LSE command, quotes req. on legend ! NEW KEY KP8 "" "" "" "" LSE_NEXT_ERROR;LSE_GOTO_SOURCE ! KP8 bound NEXT ERROR followed by GOTO SOURCE ! ! keypad key with multiple LSE commands ! ! !

! In this example, ENTER is bound to the LSE standard key binding for RETURN: ! ! ! LSE> NEW KEY ENTER "" "" "" "" lse$key_return ! ! ! (Not all keypad keys are formed KP..., intro to KEY$KEY ! prefix) ! ! CATEGORY: ! Tailor ! !doc_end ! LOCAL comment_str, legend_str, remark_str, the_command, topic_str, tpu_keyname, the_parsed_command; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_new_key"); ENDON_ERROR; if lse$prompt_key( user_key_name, tpu_keyname, lse$_keyprompt) then if lse$prompt_string( lse_command, the_command, lse$_lsecmdprompt, "", "") then if lse$prompt_string(help_topic, topic_str, "", "", "") then if lse$prompt_string(remark, remark_str, "", "", "") then if lse$prompt_string( legend, legend_str, "", "", "") then ! ! To determine the TPU code to bind the key to, we will ! either accept the preparsed command, parse the string ! given, or bind it to a command that does nothing. ! if tpu_command <> tpu$k_unspecified then the_parsed_command := tpu_command else if the_command <> '' then the_parsed_command := eve$$parse(the_command); endif; endif; case get_info(the_parsed_command, 'type' ) [STRING]: if length(the_parsed_command) <= 0 then eve$message( lse$_invcmd ); lse$post_command_proc; return false; endif; [BUFFER, LEARN, PROGRAM, RANGE]: [OTHERWISE]: eve$message( lse$_invcmd ); lse$post_command_proc; return false; endcase; ! Do the actual definition ! lse$$encode_key_comment(comment_str, "LSEKEYPAD ", topic_str, legend_str, remark_str, the_command); define_key(the_parsed_command, tpu_keyname, comment_str); lse$post_command_proc; return true; endif endif endif endif endif; ! ! Something did not return successful from prompting ! lse$post_command_proc; return false ENDPROCEDURE; procedure lse_enter_pseudocode ! ! Add DEFINE LANGUAGE, DEFINE PLACEHOLDER, and MODIFY LANGUAGE to related commands. ! !doc_begin ! ! ONE LINE DEFINITION: ! Inserts pseudocode placeholder delimiters. ! ! DESCRIPTION: ! (ENTER PSEUDOCODE) ! This command positions the cursor on the first ! character of the right delimiter. You must define the ! placeholder delimiters before using this command. ! !

! If the cursor is on a placeholder defined with ! the command DEFINE PLACEHOLDER PSEUDOCODE, then the command ! has the usual effects of text insertion on the defined ! placeholders. The defined placeholder is autoerased and, if ! it is a list placeholder, it is duplicated. !

! If the cursor is on a placeholder defined with the command ! DEFINE PLACEHOLDER NOPSEUDOCODE, or is on a pseudocode ! placeholder, then the command is not allowed and a ! warning message is displayed. !

! If the cursor is not on a ! placeholder, the command inserts the pseudocode placeholder ! delimiter. ! ! ! EXAMPLE: ! The following are examples of entering pseudocode: ! ! ! IF {expression} ! !

! Entering the ENTER PSEUDOCODE command causes LSE to insert ! pseudocode placeholder delimiters as follows: ! ! IF «» ! ! ! {statement} ! !

! Entering the ENTER PSEUDOCODE command causes LSE to insert ! pseudocode placeholder delimiters as follows: ! ! «» ! [statement] ! ! ! RELATED COMMANDS: ! SET LANGUAGE PSEUDOCODE DELIMIT ! ENTER commands ! ERASE commands ! ! CATEGORY: ! Program ! !doc_end ! ! Add Entering to CATGEGORY ! ON_ERROR [TPU$_NOTMODIFIABLE, LSE$_UNMODIFIABLE]: eve$message (ERROR_TEXT); eve$learn_abort; lse$post_command_proc; return false; [LSE$_NOLANG]: eve$message( ERROR_TEXT ); lse$post_command_proc; eve$learn_abort; RETURN FALSE; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_enter_pseudocode"); ENDON_ERROR; lse_enter_pseudocode := lse$enter_pseudocode; lse$post_command_proc; endprocedure; procedure lse_set_clipboard( ;boolean ) ! !doc_begin ! ! ONE LINE DEFINITION: ! Changes the default behavior for the DECwindows clipboard. ! ! DESCRIPTION: ! (SET CLIPBOARD) ! This command determines whether the default ! setting for the DECwindows clipboard is on or off for the COPY, CUT, and ! PASTE commands. The parameter value (on) sets the DECwindows ! clipboard. The parameter value (off) sets the PASTE buffer ! for character-cell terminals. ! ! RELATED COMMANDS: ! COPY ! COPY APPEND ! CUT ! CUT APPEND ! PASTE ! SHOW ATTRIBUTES ! ! CATEGORY: ! Tailor ! !doc_end ! local the_response; on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_clipboard"); endon_error; if lse$prompt_boolean( boolean, the_response, lse$_clpbrdprompt, '', lse$_clpbrddef) then set (lse$clipboard, lse$system, the_response ); else return false; endif; lse$$update_status_lines; lse$post_command_proc; return true; endprocedure; procedure lse_paste (;user_paste_buffer) ! !doc_begin ! ! ONE LINE DEFINITION: ! Copies the contents of the specified buffer or clipboard to the ! current location. ! ! DESCRIPTION: ! (PASTE) ! This command copies text from a specified buffer or a default ! location (the DECwindows clipboard or paste buffer) to the current cursor ! location. ! ! RELATED COMMANDS: ! COPY ! COPY APPEND ! CUT ! CUT APPEND ! SET CLIPBOARD ! ! CATEGORY: ! Text ! !doc_end ! LOCAL the_buffer_name; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_paste "); ENDON_ERROR; ! ! Get the paste buffer name from the user ! IF NOT LSE$PROMPT_STRING (user_paste_buffer, the_buffer_name, '', '', lse$$get_paste_buffer_name) THEN lse$post_command_proc; RETURN false; ENDIF; ! ! Setup the paste buffer ! lse$$set_paste_buffer (the_buffer_name); ! ! Paste the text and set the return status of the procedure ! lse_paste := lse$$paste; lse$post_command_proc; endprocedure; procedure lse_copy (;user_paste_buffer) ! !doc_begin ! ! ONE LINE DEFINITION: ! Copies the selected text to the indicated buffer or to the clipboard. ! ! DESCRIPTION: ! (COPY) ! This command copies the currently selected text to either a designated ! buffer or to a default location (the DECwindows clipboard or paste ! buffer). The old contents of the paste buffer or the clipboard are lost. ! ! RELATED COMMANDS: ! COPY APPEND ! CUT ! CUT APPEND ! PASTE ! SET CLIPBOARD ! ! CATEGORY: ! Text ! !doc_end ! LOCAL the_buffer_name; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_copy "); ENDON_ERROR; ! ! Get the paste buffer name from the user ! IF NOT LSE$PROMPT_STRING (user_paste_buffer, the_buffer_name, '', '', lse$$get_paste_buffer_name) THEN lse$post_command_proc; RETURN false; ENDIF; ! ! Setup the paste buffer ! lse$$set_paste_buffer (the_buffer_name); ! ! Copy the text and set the return status of the procedure ! lse_copy := lse$$cut (false); lse$post_command_proc; endprocedure; procedure lse_copy_append (;user_paste_buffer) ! !doc_begin ! ! ONE LINE DEFINITION: ! Copies the selected text to the end of the buffer or clipboard. ! ! DESCRIPTION: ! (COPY APPEND) ! This command appends the currently selected text to either the designated ! buffer or to a default location (the DECwindows clipboard or paste ! buffer). ! ! RELATED COMMANDS: ! COPY ! CUT ! CUT APPEND ! PASTE ! SET CLIPBOARD ! ! CATEGORY: ! Text ! !doc_end ! LOCAL the_buffer_name; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_copy_append "); ENDON_ERROR; ! ! Get the paste buffer name from the user ! IF NOT LSE$PROMPT_STRING (user_paste_buffer, the_buffer_name, '', '', lse$$get_paste_buffer_name) THEN lse$post_command_proc; RETURN false; ENDIF; ! ! Setup the paste buffer ! lse$$set_paste_buffer (the_buffer_name); ! ! Append the text and set the return status of the procedure ! lse_copy_append := lse$$append (false); lse$post_command_proc; endprocedure; procedure lse_cut (;user_paste_buffer) ! !doc_begin ! ! ONE LINE DEFINITION: ! Moves the selected text to the indicated buffer or clipboard. ! ! DESCRIPTION: ! (CUT) ! This command moves the currently selected text to either a designated ! buffer or to a default location (the DECwindows clipboard or paste buffer). ! ! RELATED COMMANDS: ! CUT APPEND ! COPY ! COPY APPEND ! PASTE ! SET CLIPBOARD ! ! CATEGORY: ! Text ! !doc_end ! LOCAL the_buffer_name; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_cut "); ENDON_ERROR; ! ! Get the paste buffer name from the user ! IF NOT LSE$PROMPT_STRING (user_paste_buffer, the_buffer_name, '', '', lse$$get_paste_buffer_name) THEN lse$post_command_proc; RETURN false; ENDIF; ! ! Setup the paste buffer ! lse$$set_paste_buffer (the_buffer_name); ! ! Cut the text and set the return status of the procedure ! lse_cut := lse$$cut (true); lse$post_command_proc; endprocedure; procedure lse_cut_append (;user_paste_buffer) ! !doc_begin ! ! ONE LINE DEFINITION: ! Moves the selected text to the end of the designated buffer or clipboard. ! ! DESCRIPTION: ! (CUP APPEND) ! This command appends the currently selected text to either the indicated ! buffer or to a default location (the DECwindows clipboard or paste buffer). ! ! RELATED COMMANDS: ! CUT ! COPY ! COPY APPEND ! PASTE ! SET CLIPBOARD ! ! CATEGORY: ! Text ! !doc_end ! LOCAL the_buffer_name; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_cut_append "); ENDON_ERROR; ! ! Get the paste buffer name from the user ! IF NOT LSE$PROMPT_STRING (user_paste_buffer, the_buffer_name, '', '', lse$$get_paste_buffer_name) THEN lse$post_command_proc; RETURN false; ENDIF; ! ! Setup the paste buffer ! lse$$set_paste_buffer (the_buffer_name); ! ! Append the text and set the return status of the procedure ! lse_cut_append := lse$$append (true); lse$post_command_proc; endprocedure; procedure lse_erase_word ! !doc_begin ! ! ONE LINE DEFINITION: ! Erases a word at the current cursor position. ! ! DESCRIPTION: ! (ERASE WORD) ! This command erases the entire word the cursor is on, ! regardless of the cursor's position within that word. You can terminate ! a word with tabs or characters not specified for language ! identifier characters. A word can consist of identifier ! characters and trailing blanks, or it can consist of a single nonblank, ! nonidentifier character. ! ! RELATED COMMANDS: ! ERASE END OF WORD ! ERASE NEXT WORD ! ERASE PREVIOUS WORD ! ERASE START OF WORD ! RESTORE ! ! CATEGORY: ! Text ! !doc_end ! on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_erase_word"); endon_error; lse_erase_word := lse$$erase_word (false); lse$post_command_proc; endprocedure; procedure lse_erase_previous_word ! !doc_begin ! ! ONE LINE DEFINITION: ! Erases the word before the cursor. ! ! DESCRIPTION: ! (ERASE PREVIOUS WORD) ! When the cursor is in the middle of a word, the entire word ! is erased and the cursor moves to the first letter of the next ! word. For more information about the definition of a word, see ! the ERASE WORD command. ! ! RELATED COMMANDS: ! ERASE END OF WORD ! ERASE NEXT WORD ! ERASE START OF WORD ! ERASE WORD ! RESTORE ! ! CATEGORY: ! Text ! !doc_end ! on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_erase_previous_word"); endon_error; ! ! Save OLD BPM for insert string ! lse$$save_old_bpm(); if eve_erase_previous_word then lse$$erased_word_offset := 0; lse$$erased_word_direction := reverse; lse$$set_erase_object (erase_k_word); lse_erase_previous_word := true; else lse_erase_previous_word := false; endif; lse$post_command_proc; endprocedure; procedure lse_erase_next_word ! !doc_begin ! ! ONE LINE DEFINITION: ! Erases the word following the cursor. ! ! DESCRIPTION: ! (ERASE NEXT WORD) ! When the cursor is positioned on a space, this command erases all ! the spaces before and after the deleted word except one space. If ! the cursor is at the end of a line, the next line is appended to ! the current line. If the cursor is on a word, that word is erased. ! For more information about the definition of a ! word, see the ERASE WORD command. ! ! RELATED COMMANDS: ! ERASE END OF WORD ! ERASE PREVIOUS WORD ! ERASE START OF WORD ! ERASE WORD ! ! CATEGORY: ! Text ! !doc_end ! on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_erase_next_word"); endon_error; if eve_erase_word then lse$$erased_word_offset := 0; lse$$erased_word_direction := forward; lse$$set_erase_object (erase_k_word); lse_erase_next_word := true; else lse_erase_next_word := false; endif; lse$post_command_proc; endprocedure; procedure lse_erase_start_of_word ! !doc_begin ! ! ONE LINE DEFINITION: ! Erases text from the current cursor position to the beginning of the ! previous word. ! ! DESCRIPTION: ! (ERASE START OF WORD) ! For more information about the definition of a word, see ! the ERASE WORD command. ! ! RELATED COMMANDS: ! ERASE END OF WORD ! ERASE NEXT WORD ! ERASE PREVIOUS WORD ! ERASE WORD ! RESTORE ! ! CATEGORY: ! Text ! !doc_end ! on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_erase_start_of_word"); endon_error; ! ! Save OLD BPM for insert string ! lse$$save_old_bpm(); lse_erase_start_of_word := lse$$erase_word (true, reverse); lse$post_command_proc; endprocedure; procedure lse_erase_end_of_word ! !doc_begin ! ! ONE LINE DEFINITION: ! Erases text from the current cursor position to the beginning of the ! next word. ! ! DESCRIPTION: ! (ERASE END OF WORD) ! For more information about the definition of a word, see ! the ERASE WORD command. ! ! RELATED COMMANDS: ! ENTER TEXT ! RESTORE ! ERASE NEXT WORD ! ERASE WORD ! ERASE PREVIOUS WORD ! ERASE START OF WORD ! ! ! CATEGORY: ! Text ! !doc_end ! on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_erase_end_of_word"); endon_error; lse_erase_end_of_word := lse$$erase_word (true, forward); lse$post_command_proc; endprocedure; procedure lse_erase_selection ! !doc_begin ! ! ONE LINE DEFINITION: ! Erases the text within the selected range. ! DESCRIPTION: ! (ERASE SELECTION) ! ! RELATED COMMANDS: ! NEW SELECTION MARK ! RESTORE ! ! CATEGORY: ! Text ! !doc_end ! on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_erase_selection"); endon_error; lse_erase_selection := lse$$erase_selection; lse$post_command_proc; endprocedure; procedure lse_next_placeholder ! !doc_begin ! ! ONE LINE DEFINITION: ! Moves the cursor to the next placeholder. ! DESCRIPTION: ! (NEXT PLACEHOLDER) ! ! RELATED COMMANDS: ! PREVIOUS PLACEHOLDER ! ! CATEGORY: ! Cursor ! !doc_end ! on_error [LSE$_NOLANG]: eve$message( ERROR_TEXT ); lse$post_command_proc; eve$learn_abort; RETURN false; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_next_placeholder"); endon_error; ! ! Save the OLD_BPM for UNDO ! lse$$save_old_bpm; lse_next_placeholder := lse$move_by_placeholder(FORWARD, TRUE, TRUE); ! ! Save the NEW_BPM for UNDO ! lse$$save_new_bpm; lse$post_command_proc; endprocedure; procedure lse_previous_placeholder ! LSE_PREVIOUS_PLACEHOLDER ! !doc_begin ! ! ONE LINE DEFINITION: ! Moves the cursor to the previous placeholder. ! DESCRIPTION: ! (PREVIOUS PLACEHOLDER) ! ! RELATED COMMANDS: ! NEXT PLACEHOLDER ! ! CATEGORY: ! Cursor ! !doc_end ! on_error [LSE$_NOLANG]: eve$message( ERROR_TEXT ); lse$post_command_proc; eve$learn_abort; RETURN false; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_previous_placeholder"); endon_error; ! ! Save the OLD_BPM for UNDO ! lse$$save_old_bpm; lse_previous_placeholder := lse$move_by_placeholder(REVERSE, TRUE, TRUE); ! ! Save the NEW_BPM for UNDO ! lse$$save_new_bpm; lse$post_command_proc; endprocedure; procedure lse_erase_line ! ! LSE_ERASE_LINE ! !doc_begin ! ! ONE LINE DEFINITION: ! Erases a line of text at the current cursor position. ! ! DESCRIPTION: ! (ERASE LINE) ! This command erases the entire line at the current cursor position ! including the carriage control. ! ! RELATED COMMANDS: ! ENTER LINE ! RESTORE ! ERASE NEXT LINE ! ERASE END OF LINE ! ERASE PREVIOUS LINE ! ERASE START OF LINE ! ! CATEGORY: ! Text ! !doc_end ! on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_erase_line"); endon_error; return lse$$erase_line (false); endprocedure; procedure lse_erase_next_line ! ! LSE_ERASE_NEXT_LINE ! !doc_begin ! ! ONE LINE DEFINITION: ! Erases text from the current cursor position to the beginning of the ! next line. ! ! DESCRIPTION: ! (ERASE NEXT LINE) ! This command erases the carriage control at the end of the line. ! ! RELATED COMMANDS: ! ENTER LINE ! RESTORE ! ERASE END OF LINE ! ERASE LINE ! ERASE PREVIOUS LINE ! ERASE START OF LINE ! ! CATEGORY: ! Text ! !doc_end ! on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_erase_next_line"); endon_error; return lse$$erase_line (true, forward, true); endprocedure; procedure lse_erase_previous_line ! ! LSE_ERASE_PREVIOUS_LINE ! !doc_begin ! ! ONE LINE DEFINITION: ! Erases text from the cursor back to the previous end of line. ! ! DESCRIPTION: ! (ERASE PREVIOUS LINE) ! This command erases the carriage control at the end of the previous ! line. ! ! RELATED COMMANDS: ! ERASE END OF LINE ! ERASE LINE ! ERASE NEXT LINE ! ERASE START OF LINE ! RESTORE ! ! CATEGORY: ! Text ! !doc_end ! on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_erase_previous_line"); endon_error; ! ! Save OLD BPM for insert string ! lse$$save_old_bpm(); return lse$$erase_line (true, reverse, true); endprocedure; procedure lse_erase_end_of_line ! ! LSE_ERASE_END_OF_LINE ! !doc_begin ! ! ONE LINE DEFINITION: ! Erases text from the current cursor position to the end of the line. ! ! DESCRIPTION: ! (ERASE END OF LINE) ! This command does not erase the carriage control at the ! end of the line. ! ! RELATED COMMANDS: ! ENTER LINE ! RESTORE ! ERASE NEXT LINE ! ERASE LINE ! ERASE PREVIOUS LINE ! ERASE START OF LINE ! ! ! CATEGORY: ! Text ! !doc_end ! on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_erase_end_of_line"); endon_error; return lse$$erase_line (true, forward, false); endprocedure; procedure lse_erase_start_of_line ! ! LSE_ERASE_START_OF_LINE ! !doc_begin ! ! ONE LINE DEFINITION: ! Erases the text from the current cursor position back to the beginning of ! the line. ! DESCRIPTION: ! (ERASE START OF LINE) ! ! RELATED COMMANDS: ! ERASE END OF LINE ! ERASE LINE ! ERASE PREVIOUS LINE ! RESTORE ! ! CATEGORY: ! Text ! !doc_end ! on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_erase_start_of_line"); endon_error; ! ! Save OLD BPM for insert string ! lse$$save_old_bpm(); return lse$$erase_line (true, reverse, false); endprocedure; procedure lse_next_word ! !doc_begin ! ! ONE LINE DEFINITION: ! Moves the cursor to the first character of the next word. ! ! DESCRIPTION: ! (NEXT WORD) ! A word is a string of letters and numbers with tabs, spaces, or ! punctuation separating the string from the surrounding words. ! ! RELATED COMMANDS: ! PREVIOUS WORD ! ! CATEGORY: ! Cursor ! !doc_end ! on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_next_word"); endon_error; ! ! Save the OLD_BPM for UNDO ! lse$$save_old_bpm; lse_next_word := lse$$goto_word(FORWARD); ! ! Save the NEW_BPM for UNDO ! lse$$save_new_bpm; lse$post_command_proc; endprocedure; procedure lse_previous_word ! ! LSE_PREVIOUS_WORD ! !doc_begin ! ! ONE LINE DEFINITION: ! Moves the cursor to the first character of the word to the left. ! ! DESCRIPTION: ! (PREVIOUS WORD) ! Moves the cursor to the previous word if the cursor is on the ! first character, or to the first character of the current word. ! ! A word consists only of identifier characters and trailing blanks and ! can be delimited only by tabs or characters not specified in the ! SET LANGUAGE IDENTIFIER_CHARACTERS command. LSE also considers all ! nonblank, nonidentifier characters to be words. ! ! ! RELATED COMMANDS: ! NEXT WORD ! ! CATEGORY: ! Cursor ! !doc_end ! on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_previous_word"); endon_error; ! ! Save the OLD_BPM for UNDO ! lse$$save_old_bpm; lse_previous_word := lse$$goto_word(REVERSE); ! ! Save the NEW_BPM for UNDO ! lse$$save_new_bpm; lse$post_command_proc; endprocedure; procedure lse_save_as (;file_spec) ! !doc_begin ! ! ONE LINE DEFINITION: ! Writes the current buffer to the specified file. ! ! DESCRIPTION: ! (SAVE AS) ! LSE prompts for a file name if you do not specify one. This command ! works like the SAVE FILE command when you use the default file ! specification. ! ! RELATED COMMANDS: ! SAVE FILE ! QUIT ! EXIT ! SAVE SELECTION ! SAVE VISIBLE ! SET BUFFER OUTPUT FILE ! SET DIRECTORY READONLY ! ! CATEGORY: ! File ! !doc_end ! local entered_file_spec, real_file_spec, def_file_spec; on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_save_as"); endon_error; real_file_spec := get_info (current_buffer, 'output_file'); if (real_file_spec = '') OR (real_file_spec = 0) then real_file_spec := get_info (current_buffer, 'file_name'); endif; def_file_spec := real_file_spec - file_parse (real_file_spec, '', '', VERSION); if not lse$prompt_string ( file_spec, entered_file_spec, lse$_setbufofnprompt, '', def_file_spec ) then lse$post_command_proc; return false; endif; if entered_file_spec = '' then eve$message ( lse$get_message_text (lse$_filenamneeded)); lse$post_command_proc; return false; endif; lse_save_file (entered_file_spec); endprocedure; procedure lse_save_file (;file_spec) ! !doc_begin ! ! ONE LINE DEFINITION: ! Writes the current buffer to the specified file. ! ! DESCRIPTION: ! (SAVE FILE) ! LSE defaults to the current buffer's output file if you specified ! one with the SET BUFFER OUTPUT FILE command. ! If an output file is not present, LSE defaults to the current buffer's ! input file (specified when you enter an OPEN FILE command). If ! LSE cannot find an input or output file, it prompts you for a file ! name. !

! LSE displays an informational message or prompts for information before ! writing the buffer under any of the following conditions: ! ! (UNNUMBERED) ! If you have not specified an input or output file name ! If you have not modified the buffer (not made any changes during your ! editing session) ! If the buffer's close status is read-only ! If the output directory is read-only ! !

! You may use this command and supply a file name at any time ! while you are in an editing session, thereby creating a new file that ! contains the output up to that point in your editing session. ! However, using this command to ! write the data to a different file does not change the file ! association of the buffer; that is, LSE still creates a new version of ! the file with the same name as that associated with the buffer when ! you exit from that editing session or ! subsequently use this command without specifying a file name. ! To change the output file association, use the SET BUFFER OUTPUT FILE ! command. ! ! ! SET BUFFER OUTPUT (specifies output file) ! OPEN FILE (specifies input file) ! Changes: ! -Defaults to the current buffers output file if present ! Defaults to the current buffers input file if output file not present ! Prompts if no input input or output file is present ! If the user has not input any file name ! If buffer's close state is read_only, prompt ! If buffer is not modified prompt ! If output directory is read only prompt ! Write it ! ! ! (Include following information in LSE tutorial) ! !

! When you issue a SAVE FILE command without specifying a file name, LSE also ! displays an informational message and prompts you for confirmation before ! writing the buffer under either of the following conditions: ! (UNNUMBERED) ! If you have not modified the buffer (not made any changes during your ! editing session) ! If the buffer's status is read-only ! !

! If you issue the SAVE FILE command and the current buffer is ! associated with a file of the same name, then LSE creates a new ! version of the file. If the buffer is unnamed, LSE prompts you for a name. !

! You may use the SAVE FILE command and supply a file name at any time ! while you are in an editing session, thereby creating a new file that ! contains the output up to that point in your editing session. ! However, using the SAVE FILE command to ! write the data to a different file does not change the file ! association of the buffer; that is, LSE still creates a new version of ! the file with the same name as that associated with the buffer when ! you exit from that editing session or ! subsequently use the SAVE FILE command without specifying a file name. ! To change the file association, you use the SET BUFFER OUTPUT FILE command. !

! If you use the SAVE FILE command to write to a directory that you have set ! read-only (using the SET DIRECTORY READONLY command), then LSE prompts ! you for confirmation before writing out the buffer. ! ! ! RELATED COMMANDS: ! SAVE SELECTION ! SAVE VISIBLE ! QUIT ! EXIT ! SET DIRECTORY READONLY ! SET BUFFER OUTPUT FILE ! OPEN FILE ! SAVE AS ! ! CATEGORY: ! File ! !doc_end ! LOCAL real_file_spec, entered_file_spec, the_response; on_error ! ! TPU$_OPENOUT was put here to fix LSE_XBUGS 1182 where no error ! message was being displayed. In the event that your looking at this ! because 2 error messages are being displayed, take the extra message ! out of the Bliss code and leave this one here. ! [LSE$_INVFILNAM, TPU$_OPENOUT, TPU$_NOFILEACCESS, TPU$_CLOSEOUT]: eve$message (error_text); lse$post_command_proc; eve$learn_abort; return false; [TPU$_WRITEERR]: eve$message (error_text); eve$message (lse$_badwrite); lse$post_command_proc; eve$learn_abort; return false; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_save_file "); endon_error; ! Prompt if necessary ! entered_file_spec := ''; if (file_spec = tpu$k_unspecified) then IF (get_info( current_buffer, 'output_file' ) = 0) AND (get_info( current_buffer, 'file_name' ) = '' ) then if not lse$prompt_string ( file_spec, entered_file_spec, lse$_setbufofnprompt ) then lse$post_command_proc; eve$message( lse$_commandcancel ); return false; endif; endif; else entered_file_spec := file_spec; endif; ! Writing a buffer marked read_only is confirmed ! if entered_file_spec = '' then if get_info (current_buffer, 'lse$read_only') then if lse$prompt_boolean (tpu$k_unspecified, the_response, lse$_readwrite, '', lse$_wrfilreaddef) then if not the_response then lse$post_command_proc; return false; endif; else lse$post_command_proc; return false; endif; else ! ! Writing an unmodified buffer is confirmed ! if not get_info (current_buffer, 'modified') then if lse$prompt_boolean (tpu$k_unspecified, the_response, lse$_unmodwrite, '', lse$_wrfilunmoddef) then if not the_response then lse$post_command_proc; return false; endif; else lse$post_command_proc; return false; endif; endif; endif; endif; ! Writing to a read only directory is confirmed ! if entered_file_spec = '' then real_file_spec := get_info (current_buffer, 'output_file'); if (real_file_spec = '') OR (real_file_spec = 0) then real_file_spec := get_info (current_buffer, 'file_name'); endif; else real_file_spec := entered_file_spec; endif; if lse$is_read_only_directory (real_file_spec) then if lse$prompt_boolean (tpu$k_unspecified, the_response, lse$_writereaddir, '', lse$_wrfilrddirdef) then if not the_response then lse$post_command_proc; return false; endif; else lse$post_command_proc; return false; endif; endif; ! Write the file ! if entered_file_spec = '' then lse$write_file (current_buffer); else lse$write_file (current_buffer, entered_file_spec); endif; ! Finish the command processing ! lse$post_command_proc; return true; endprocedure; procedure lse_save_selection (;file_spec) ! !doc_begin ! ! ONE LINE DEFINITION: ! Writes the contents of the selected range to a file. ! DESCRIPTION: ! (SAVE SELECTION) ! ! RELATED COMMANDS: ! CLOSE FILE ! SAVE FILE ! SAVE VISIBLE ! ! CATEGORY: ! File ! !doc_end ! LOCAL the_file_spec, the_range; ON_ERROR ! Before changing, see comment in lse_save_file, [TPU$_OPENOUT]. [LSE$_INVFILNAM, TPU$_OPENOUT, TPU$_NOFILEACCESS, TPU$_CLOSEOUT]: eve$message (error_text); lse$post_command_proc; eve$learn_abort; return false; [TPU$_WRITEERR]: eve$message (error_text); eve$message (lse$_badwrite); lse$post_command_proc; eve$learn_abort; return false; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_save_selection "); ENDON_ERROR; ! ! Get the current select range ! the_range := eve$selection (true, ! Report messages false, ! Don't use found range false, ! Don't use global select false, ! Don't extend null range to single character false); ! Don't cancel the selection ! ! Errors have already been reported if there is no range ! if get_info (the_range, 'type') <> range then lse$post_command_proc; return false; endif; ! ! Get the file name to be written to. This is required and cannot default. ! if not lse$prompt_string ( file_spec, the_file_spec, lse$_setbufofnprompt, eve$_nofilespec) then lse$post_command_proc; return false; endif; ! ! Write the file and take the error handler out if problems. Note that the ! following builtin returns the output file specification and not a status. ! lse$write_file (the_range, the_file_spec); ! ! Cancel the selection and do post command processing ! return lse_delete_selection_mark; endprocedure; procedure lse_save_visible (;file_spec) ! !doc_begin ! ! ONE LINE DEFINITION: ! Writes the visible lines in the buffer to a file. ! ! DESCRIPTION: ! (SAVE VISIBLE) ! Visible lines are those source lines and any overview lines that are ! not compressed by the COLLAPSE or FOCUS command. ! ! RELATED COMMANDS: ! CLOSE FILE ! SAVE FILE ! SAVE SELECTION ! ! CATEGORY: ! File ! !doc_end ! LOCAL the_file_spec; ON_ERROR [TPU$_OPENOUT, LSE$_INVFILNAM, TPU$_NOFILEACCESS, TPU$_CLOSEOUT]: ! Before changing, see comment in lse_save_file, [TPU$_OPENOUT]. eve$message (error_text); lse$post_command_proc; eve$learn_abort; return false; [TPU$_WRITEERR]: eve$message (error_text); eve$message (lse$_badwrite); lse$post_command_proc; eve$learn_abort; return false; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_save_visible"); ENDON_ERROR; ! ! Get the file name to be written to. This is required and cannot default. ! if not lse$prompt_string ( file_spec, the_file_spec, lse$_setbufofnprompt, eve$_nofilespec) then lse$post_command_proc; return false; endif; ! ! Write the visible lines in the buffer to the file ! lse$write_visible (current_buffer, the_file_spec); ! ! Finish up the command ! lse$post_command_proc; return true; endprocedure; procedure lse_next_end_of_line ! !doc_begin ! ! ONE LINE DEFINITION: ! Moves the cursor to the end of the line. ! ! DESCRIPTION: ! (NEXT END OF LINE) ! Moves the cursor to the next end of line if the cursor is already at the ! end of the line. ! ! RELATED COMMANDS: ! END OF LINE ! NEXT START OF LINE ! PREVIOUS END OF LINE ! PREVIOUS START OF LINE ! START OF LINE ! ! CATEGORY: ! Cursor ! !doc_end ! LOCAL saved_direction; on_error [OTHERWISE]: if saved_direction <> TPU$K_UNSPECIFIED then set (saved_direction, current_buffer); endif; lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_next_end_of_line"); endon_error; saved_direction := set (forward, current_buffer); ! ! Save OLD BPM for UNDO ! lse$$save_old_bpm; lse_next_end_of_line := eve_move_by_line; ! ! Save NEW BPM for UNDO ! lse$$save_new_bpm; set (saved_direction, current_buffer); endprocedure; procedure lse_previous_end_of_line ! !doc_begin ! ! ONE LINE DEFINITION: ! Moves the cursor to the end of the previous line. ! DESCRIPTION: ! (PREVIOUS END OF LINE) ! ! RELATED COMMANDS: ! END OF LINE ! NEXT END OF LINE ! NEXT START OF LINE ! PREVIOUS START OF LINE ! START OF LINE ! ! CATEGORY: ! Cursor ! !doc_end ! on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_previous_end_of_line"); endon_error; ! ! Save OLD BPM for UNDO ! lse$$save_old_bpm; if eve_move_up then position(LINE_END); ! ! Save NEW BPM for UNDO ! lse$$save_new_bpm; return TRUE; else ! ! Free OLD BPM for UNDO ! lse$$free_old_bpm; return FALSE; endif; endprocedure; procedure lse_next_start_of_line ! !doc_begin ! ! ONE LINE DEFINITION: ! Moves the cursor to the start of the next line. ! DESCRIPTION: ! (NEXT START OF LINE) ! ! RELATED COMMANDS: ! END OF LINE ! NEXT END OF LINE ! PREVIOUS END OF LINE ! PREVIOUS START OF LINE ! START OF LINE ! ! CATEGORY: ! Cursor ! !doc_end ! on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_next_start_of_line"); endon_error; ! ! Save OLD BPM for UNDO ! lse$$save_old_bpm; if eve_move_down then position (LINE_BEGIN); ! ! Save NEW BPM for UNDO ! lse$$save_new_bpm; return TRUE; else ! ! Free OLD BPM for UNDO ! lse$$free_old_bpm; return FALSE; endif; endprocedure; procedure lse_previous_start_of_line ! !doc_begin ! ! ONE LINE DEFINITION: ! Moves the cursor to the start of the line. ! ! DESCRIPTION: ! (PREVIOUS START OF LINE) ! Moves the cursor to the previous line if the cursor is already ! at the start of the line. ! ! RELATED COMMANDS: ! END OF LINE ! NEXT END OF LINE ! NEXT START OF LINE ! PREVIOUS END OF LINE ! START OF LINE ! ! CATEGORY: ! Cursor ! !doc_end ! LOCAL saved_direction; on_error [OTHERWISE]: if saved_direction <> TPU$K_UNSPECIFIED then set (saved_direction, current_buffer); endif; lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_previous_start_of_line"); endon_error; saved_direction := set (reverse, current_buffer); ! ! Save OLD BPM for UNDO ! lse$$save_old_bpm; lse_previous_start_of_line := eve_move_by_line; ! ! Save NEW BPM for UNDO ! lse$$save_new_bpm; set (saved_direction, current_buffer); endprocedure; procedure lse_end_of_line ! !doc_begin ! ! ONE LINE DEFINITION: ! Moves the cursor to the end of the current line. ! DESCRIPTION: ! (END OF LINE) ! ! RELATED COMMANDS: ! NEXT END OF LINE ! NEXT START OF LINE ! PREVIOUS END OF LINE ! PREVIOUS START OF LINE ! START OF LINE ! ! CATEGORY: ! Cursor ! !doc_end ! local status; on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_end_of_line"); endon_error; ! ! Save OLD BPM for UNDO ! lse$$save_old_bpm; status := eve_end_of_line; ! ! Save NEW BPM for UNDO ! lse$$save_new_bpm; return status; endprocedure; procedure lse_start_of_line ! !doc_begin ! ! ONE LINE DEFINITION: ! Moves the cursor to the beginning of the current line. ! DESCRIPTION: ! (START OF LINE) ! ! RELATED COMMANDS: ! END OF LINE ! NEXT END OF LINE ! NEXT START OF LINE ! PREVIOUS END OF LINE ! PREVIOUS START OF LINE ! ! CATEGORY: ! Cursor ! !doc_end ! local status; on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_start_of_line"); endon_error; ! ! Save OLD BPM for UNDO ! lse$$save_old_bpm; status := eve_start_of_line; ! ! Save NEW BPM for UNDO ! lse$$save_new_bpm; return status; endprocedure; procedure lse_erase_next_placeholder (;next_placeholder_boolean) !doc_begin ! ! ONE LINE DEFINITION: ! Erases the text of a placeholder and related punctuation in the ! forward direction. ! ! DESCRIPTION: ! (ERASE NEXT PLACEHOLDER) ! For more information, see the ERASE PLACEHOLDER command. ! ! RELATED COMMANDS: ! EXPAND ! ERASE PREVIOUS PLACEHOLDER ! ERASE PLACEHOLDER ! RESTORE ! ! CATEGORY: ! Text ! !doc_end ! local on_placeholder, local_goto; ON_ERROR [LSE$_NOTNEARBY]: eve$message( ERROR_TEXT ); [TPU$_NOTMODIFIABLE, LSE$_UNMODIFIABLE]: eve$message (ERROR_TEXT); lse$post_command_proc; eve$learn_abort; RETURN FALSE; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_erase_next_placeholder "); ENDON_ERROR; lse$prompt_boolean(next_placeholder_boolean, local_goto, "", "", 1); ! if we aren't on a placeholder, then get on one if lse$is_placeholder (1, 1) then on_placeholder := true; else on_placeholder := lse_next_placeholder; endif; if on_placeholder then lse_erase_next_placeholder := lse$$erase_placeholder (local_goto, forward); ! The old LSE support for EXPAND doesn't do the automatic position ! on the placeholder stuff if the text is not visible to the ! user. I've chosen not to that the V3.1 code. ! if (current_buffer <> get_info( current_window, 'buffer' )) AND (local_goto) then lse$move_by_placeholder(FORWARD, TRUE, FALSE); endif; else lse_erase_next_placeholder := false; endif; lse$$save_current_position; lse$$set_erase_object(erase_k_placeholder); lse$post_command_proc; endprocedure; ! lse_erase_next_placeholder procedure lse_erase_previous_placeholder (;next_placeholder_boolean) !doc_begin ! ! ONE LINE DEFINITION: ! Erases a placeholder in the reverse direction. ! ! DESCRIPTION: ! (ERASE PREVIOUS PLACEHOLDER) ! For more information, see the ERASE PLACEHOLDER command. ! ! RELATED COMMANDS: ! ERASE PLACEHOLDER ! ERASE NEXT PLACEHOLDER ! RESTORE ! ! CATEGORY: ! Text ! !doc_end ! local on_placeholder, local_goto; ON_ERROR [LSE$_NOTNEARBY]: eve$message( ERROR_TEXT ); [TPU$_NOTMODIFIABLE, LSE$_UNMODIFIABLE]: eve$message (ERROR_TEXT); lse$post_command_proc; eve$learn_abort; RETURN FALSE; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_erase_previous_placeholder "); ENDON_ERROR; lse$prompt_boolean(next_placeholder_boolean, local_goto, "", "", 1); ! if we aren't on a placeholder, then get on one if lse$is_placeholder (1, 1) then on_placeholder := true; else on_placeholder := lse_previous_placeholder; endif; if on_placeholder then lse_erase_previous_placeholder := lse$$erase_placeholder (local_goto, reverse); ! The old LSE support for EXPAND doesn't do the automatic position ! on the placeholder stuff if the text is not visible to the ! user. I've chosen not to that the V3.1 code. ! if (current_buffer <> get_info( current_window, 'buffer' )) AND (local_goto) then lse$move_by_placeholder(FORWARD, TRUE, FALSE); endif; else lse_erase_previous_placeholder := false; endif; lse$$save_current_position; lse$$set_erase_object(erase_k_placeholder); lse$post_command_proc; endprocedure; ! lse_erase_previous_placeholder procedure lse_erase_placeholder (;next_placeholder_boolean) !doc_begin ! ! ONE LINE DEFINITION: ! Erases a placeholder in the current direction. ! ! DESCRIPTION: ! (ERASE PLACEHOLDER) ! If the cursor is on a placeholder, the deletion occurs ! in place. If no placeholder is found, LSE returns an error message. ! After erasing the placeholder and any leading tabs or blanks, LSE ! erases any leading separator text or leading and trailing punctuation. ! If the resulting line or line segment is now empty, LSE erases the ! entire line or line segment. ! ! RELATED COMMANDS: ! ERASE NEXT PLACEHOLDER ! ERASE PREVIOUS PLACEHOLDER ! RESTORE ! ! CATEGORY: ! Text ! !doc_end ! LOCAL local_goto; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_erase_placeholder "); ENDON_ERROR; lse$prompt_boolean(next_placeholder_boolean, local_goto, "", "", 1); if current_direction = forward then return lse_erase_next_placeholder(local_goto); else return lse_erase_previous_placeholder(local_goto); endif; endprocedure; ! lse_erase_placeholder procedure lse_next_character ! !doc_begin ! ! ONE LINE DEFINITION: ! Moves the cursor one character to the right. ! ! DESCRIPTION: ! (NEXT CHARACTER) ! If the cursor is at the end of a line, it moves to the first ! character of the next line. ! ! RELATED COMMANDS: ! MOVE DOWN ! MOVE UP ! PREVIOUS CHARACTER ! ! CATEGORY: ! Cursor ! !doc_end ! ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_next_character"); ENDON_ERROR; ! ! The superceded eve procedure is called to accomodate PDF in LSE. ! ! ! Save OLD BPM for UNDO ! lse$$save_old_bpm; lse_next_character := eve_move_right; ! ! Save NEW BPM for UNDO ! lse$$save_new_bpm; lse$post_command_proc; endprocedure; procedure lse_previous_character ! ! LSE_PREVIOUS_CHARACTER ! !doc_begin ! ! ONE LINE DEFINITION: ! Moves the cursor one character to the left. ! ! DESCRIPTION: ! (PREVIOUS CHARACTER) ! If the cursor is at the beginning of a line, it moves to the end of ! the previous line. ! ! RELATED COMMANDS: ! MOVE DOWN ! MOVE UP ! NEXT CHARACTER ! ! CATEGORY: ! Cursor ! !doc_end ! ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_previous_character"); ENDON_ERROR; ! ! The superceded eve procedure is called to accomodate PDF in LSE. ! ! ! Save OLD BPM for UNDO ! lse$$save_old_bpm; lse_previous_character := eve_move_left; ! ! Save NEW BPM for UNDO ! lse$$save_new_bpm; lse$post_command_proc; endprocedure; procedure lse_move_up ! !doc_begin ! ! ONE LINE DEFINITION ! Moves the cursor up one line. ! DESCRIPTION: ! (MOVE UP) ! ! RELATED COMMANDS: ! MOVE DOWN ! NEXT CHARACTER ! PREVIOUS CHARACTER ! ! CATEGORY: ! Cursor ! !doc_end ! ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_move_up"); ENDON_ERROR; ! ! The superceded eve procedure is called to accomodate PDF in LSE. ! ! ! Save OLD BPM for UNDO ! lse$$save_old_bpm; lse_move_up := eve_move_up; ! ! Save NEW BPM for UNDO ! lse$$save_new_bpm; lse$post_command_proc; endprocedure; procedure lse_move_down ! !doc_begin ! ! ONE LINE DEFINITION: ! Moves the cursor down one line. ! DESCRIPTION: ! (MOVE DOWN) ! ! RELATED COMMANDS: ! MOVE UP ! NEXT CHARACTER ! PREVIOUS CHARACTER ! ! CATEGORY: ! Cursor ! !doc_end ! ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_move_down"); ENDON_ERROR; ! ! The superceded eve procedure is called to accomodate PDF in LSE. ! ! ! Save OLD BPM for UNDO ! lse$$save_old_bpm; lse_move_down := eve_move_down; ! ! Save NEW BPM for UNDO ! lse$$save_new_bpm; lse$post_command_proc; endprocedure; procedure lse_view_source (;depth) ! ! Add the following to Related Commands: CREATE ADJUSTMENT, MODIFY ! ADJUSTMENT, SET ADJUSTMENT commands, SET LANGUAGE MINIMUM OVERVIEW LINES, ! SET LANGUAGE OVERVIEW TAB RANGE ! !doc_begin ! ! ONE LINE DEFINITION: ! Displays the top levels of detail in the buffer. ! ! DESCRIPTION: ! (VIEW SOURCE) ! Lower levels of detail are collapsed and represented by overview ! lines. LSE determines the relative level of detail of a line by ! comparing the indentation of the line with the indentation of other ! lines. The treatment of the indentation of a line by LSE is influenced by ! indentation adjustment definitions. ! ! RELATED COMMANDS: ! COLLAPSE ! EXPAND ! FOCUS ! VIEW DEBUGGING SOURCE ! ! CATEGORY: ! Program ! !doc_end local local_depth; ON_ERROR [LSE$_CANTOVERVIEW]: eve$message( error_text ); lse$post_command_proc; eve$learn_abort; return false; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_view_source "); ENDON_ERROR; if lse$prompt_depth(depth, local_depth, '', '', 9999) then lse_view_source := lse$view_source(local_depth); lse$disable_undo (lse$_undooverview, 'overview'); else lse_view_source := false; endif; lse$post_command_proc; endprocedure; !lse_view_source procedure lse_view_debugging_source ! ! Add to Related Commands: CREATE ADJUSTMENT, SET ADJUSTMENT commands ! SET LANGUAGE MINIMUM OVERVIEW LINES, SET LANGUAGE OVERVIEW TAB RANGE, ! MODIFY ADJUSTMENT ! !doc_begin ! ! ONE LINE DEFINITION: ! Displays the source code with adjustments applied. ! ! DESCRIPTION: ! (VIEW DEBUGGING SOURCE) ! This command generates a copy of the source buffer, indented as ! LSE views the indentation (i.e., with adjustments applied to lines ! which should be adjusted). LSE displays the result ! with all source lines visible. At the beginning of each line of the ! display appears, in order, the number of the adjustment applied to the line, ! the running total for SUBSEQUENT indentations, and the effective ! indentation of the line with the adjustment applied. At the ! end of the buffer is a list of all the adjustments defined for the ! current language. !

! This command use useful for debugging adjustment definitions. ! ! RELATED COMMANDS: ! FOCUS ! NEW ADJUSTMENT ! SET ADJUSTMENT commands ! VIEW SOURCE ! ! CATEGORY: ! Program ! !doc_end ON_ERROR [LSE$_CANTOVERVIEW]: eve$message( error_text ); lse$post_command_proc; eve$learn_abort; return false; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_view_debugging_source"); ENDON_ERROR; lse_view_debugging_source := lse$view_source(debug); lse$post_command_proc; endprocedure; !lse_view_debugging_source procedure lse_focus ! ! Add the following to related commands when ported: ! CREATE ADJUSTMENT, MODIFY ADJUSTMENT, SET ADJUSTMENT ! commands, SET LANGUAGE OVERVIEW TAB RANGE ! !doc_begin ! ! ONE LINE DEFINITION: ! Displays an overview of the buffer around the current position. ! ! DESCRIPTION: ! (FOCUS) ! This command displays the current line and its surrounding ! text. The rest of the lines in the buffer are collapsed as much ! as possible and represented by overview lines. !

! The editor determines the relative level of detail of a line by ! comparing the indentation of the line with the indentation of other ! lines. The editor's treatment of the indentation of a line is ! influenced by indentation adjustment definitions. ! For more information, see the SET ADJUSTMENT commands. ! ! RELATED COMMANDS: ! SET ADJUSTMENT commands ! COLLAPSE ! EXPAND ! VIEW DEBUGGING SOURCE ! VIEW SOURCE ! ! CATEGORY: ! Program ! !doc_end ! ON_ERROR [LSE$_CANTOVERVIEW, LSE$_NOPSEDELIM ]: eve$message( error_text ); lse$post_command_proc; eve$learn_abort; return false; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_focus"); ENDON_ERROR; lse$focus(); lse$disable_undo (lse$_undooverview, 'overview'); lse$post_command_proc; endprocedure; !lse_focus procedure lse_include_file (;file_spec) !doc_begin ! ! ONE LINE DEFINITION: ! Includes the specified file at the current editing position. ! ! DESCRIPTION: ! (INCLUDE FILE) ! This command inserts the file's contents into the receiving buffer at the ! current position. ! After inserting the file, the cursor is positioned on the first ! character of the inserted text. ! RELATED COMMANDS: ! OPEN FILE ! ! CATEGORY: ! File ! !doc_end ! LOCAL the_file_spec; ! ! By not putting anything in the error clause, TPU displays the message and ! any additional RMS information available. ! ON_ERROR [TPU$_OPENIN, LSE$_FILEOPENFAIL]: [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_include_file "); ENDON_ERROR; ! ! Get the file name to be included. This is required and cannot default. ! if not lse$prompt_existing_file (file_spec, the_file_spec, lse$_filenameprompt, eve$_nofilespec, tpu$k_unspecified, ! Default value 'INCLUDE FILE', ! DECwindows title tpu$k_unspecified, ! Files to display 'INCLUDE FILE !AS') ! Asynchronous command then lse$post_command_proc; return false; endif; ! ! Call the include file work routine ! lse_include_file := lse$include_file (the_file_spec); lse$post_command_proc; endprocedure; procedure lse_delete_expand !doc_begin ! ! ONE LINE DEFINITION: ! Reverses the effect of the EXPAND command. ! ! DESCRIPTION: ! (DELETE EXPAND) ! This command deletes the text inserted as part of the ! last EXPAND command. The text entered by the last EXPAND command ! must be unchanged. It restores the token or placeholder ! that appeared at that position before the EXPAND command was entered. ! ! RELATED COMMANDS: ! EXPAND ! ! CATEGORY: ! Text ! !doc_end ON_ERROR [LSE$_NOEXPPLCH, LSE$_UNEXPANDBUF, LSE$_UNMODIFIABLE]: eve$message (error_text); lse$post_command_proc; eve$learn_abort; return false; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_delete_expand"); ENDON_ERROR; lse$$save_inserted_text(); lse$$save_undo_reverse_cmd(0, -1); lse_delete_expand := lse$unexpand(); lse$$save_redo_reverse_cmd(1, -1); !lse$$reset_undo_buf (CURRENT_BUFFER); !EVE$MESSAGE (lse$_resetundobuf); lse$post_command_proc; endprocedure; ! lse$unexpand procedure lse_delete_mark (;mark_name) ! !doc_begin ! ! ONE LINE DEFINITION: ! Deletes the indicated marker. ! ! DESCRIPTION: ! (DELETE MARK) ! If you do not specify a name for the marker, LSE deletes ! all markers at the current cursor position. !

The marker name can be abbreviated or wildcarded, but it ! must be unambiguous (that is, you can only match one marker.) ! ! RELATED COMMANDS: ! NEW MARK ! SHOW MARK ! ! EXAMPLE: ! This example deletes the marker named 1 from the ! list of markers in your current buffer: ! ! ! LSE> DELETE MARK 1 ! ! ! CATEGORY: ! Cursor ! !doc_end ! local the_mark_name, multiple_names, delete_flag, mark_list, temp_index, temp_mark, the_lse_mark, the_default_value, the_prompt, mark_name_array, the_error; ON_ERROR [TPU$_NONAMES] : multiple_names := false; [TPU$_MULTIPLENAMES] : multiple_names := true; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_delete_mark"); ENDON_ERROR; ! Ensure we have a marker name -- use '' as a default mark name. if lse$use_dialog_box then mark_name_array := lse$$build_mark_name_array ( lse$$x_last_new_mark, 'Current Cursor Position'); the_default_value := lse$$x_last_new_mark; the_prompt := lse$_markprompt; the_error := LSE$_NOMARKGIVEN; else the_default_value := ''; the_prompt := ''; the_error := ''; endif; if not lse$prompt_string( mark_name, the_mark_name, the_prompt, the_error, the_default_value, "Cancel Mark", mark_name_array ) then lse$post_command_proc; return false; endif; if (the_mark_name = '') or (the_mark_name = 'Current Cursor Position') then ! Check whether any marker/s are defined at the current editing position. ! If defined, then delete them and return true. Else return false. delete_flag := false; mark_list := expand_name (lse$$k_mark_prefix, variables); change_case (mark_list, upper); loop temp_index := index (mark_list, " "); if (temp_index = 0) then temp_mark := mark_list; the_mark_name := substr (temp_mark, length(lse$$k_mark_prefix) + 1, length(temp_mark) ); else temp_mark := substr (mark_list, 1, temp_index - 1 ); the_mark_name := substr (temp_mark, length(lse$$k_mark_prefix) + 1, temp_index - 1); endif; if ( temp_mark <> TPU$K_UNSPECIFIED ) AND ( temp_mark <> '' ) then execute ("lse$$x_user_mark := " + temp_mark); endif; if get_info( lse$$x_user_mark, 'type' ) = MARKER then ! If this marker is defined at the current position, then delete it. if lse$$x_user_mark = mark(none) then delete_flag := true; delete (lse$$x_user_mark); eve$message (LSE$_CANMARK, 0, the_mark_name); endif; endif; mark_list := substr (mark_list, temp_index + 1, length(mark_list)); exitif (temp_index = 0); endloop; ! If any marker is deleted at the current position, then return true & done. if delete_flag then lse$post_command_proc; return true; else eve$message(message_text(LSE$_NOMARK)); eve$learn_abort; lse$post_command_proc; return false; endif; else ! Delete the specific user marker given by the user. the_lse_mark := lse$expand_user_mark ( the_mark_name ); if (lse$$expand_result = 0 ) then eve$message (LSE$_MARKNOTSET, 0, the_mark_name); eve$learn_abort; lse$post_command_proc; return false; endif; if (lse$$expand_result = 2 ) then eve$message ( LSE$_AMBMARKNAME, 0, the_mark_name ); eve$learn_abort; lse$post_command_proc; return false; endif; ! + ! We had not returned by now means we have a valid TPU variable. Execute ! the variable only if it is not UNSPECIFIED. If it is a marker, then ! cancel it and return true. ! - if ( the_lse_mark <> TPU$K_UNSPECIFIED ) AND ( the_lse_mark <> '' ) then execute ("lse$$x_user_mark := " + the_lse_mark ); if get_info( lse$$x_user_mark, 'type' ) = MARKER then delete (lse$$x_user_mark); the_mark_name := substr(the_lse_mark,length(lse$$k_mark_prefix)+1, length(the_lse_mark) ); eve$message (LSE$_CANMARK, 0, the_mark_name); lse$post_command_proc; return true; endif; endif; endif; ! + ! If we had not returned by now means it was not a marker (i.e., variable ! with UNSPCIFIED value). Then mark must have been already cancelled. ! - eve$message (LSE$_MARKCANCELLED, 0, the_mark_name); eve$learn_abort; lse$post_command_proc; return false; endprocedure; procedure lse_show_mark (;mark_name_wild) ! LSE Command: SHOW MARK marker-name ! ! Displays the setting of the specified mark. ! !doc_begin ! ! ONE LINE DEFINITION: ! Displays information for the indicated user marker. ! ! DESCRIPTION: ! (SHOW MARK) ! LSE displays the name, associated buffer, and associated text ! for the specified marker, or a list of markers and their associated ! buffers. To obtain a list of markers, use wildcard characters ! in the (marker_name_wild) parameter. ! ! Refer to Appendix(wildcard_app) for a list of OpenVMS- and ! ULTRIX-style wildcard characters. ! ! !

! Ctrl/F and Ctrl/B let you move through the list of ! markers, and the E3 key (Remove key) deletes a marker. ! The EXPAND command lets you ! display the associated text for the selected marker, while the ! the COLLAPSE command returns you to the marker list. ! From the marker list, ! you can go to a selected marker its associated buffer by using ! the GOTO SOURCE command. ! ! RELATED COMMANDS: ! NEW MARK ! DELETE MARK ! EXPAND ! COLLAPSE ! GOTO SOURCE ! ! CATEGORY: ! Help ! !doc_end ! local count, last_mark_name, mark_list, the_mark_name, response, saved_mark, saved_modifiable, temp_index; ON_ERROR [TPU$_NONAMES]: eve$message (EDIT (lse$get_message_text (lse$_nousermark), TRIM_LEADING)); RETURN FALSE; [TPU$_MULTIPLENAMES]: [OTHERWISE]: ENDON_ERROR; ! Ensure that we have been given a mark name ! if not lse$prompt_string( mark_name_wild, response, lse$_markprompt, '', '*' ) then lse$post_command_proc; return false; endif; ! See how many matches ! count := 0; mark_list := EXPAND_NAME( lse$$k_mark_prefix, variables ); LOOP temp_index := INDEX( mark_list, " " ); IF (temp_index = 0) THEN the_mark_name := mark_list; ELSE the_mark_name := SUBSTR( mark_list, 1, temp_index - 1 ); ENDIF; ! Handle exact matches ! IF the_mark_name = lse$$k_mark_prefix + response THEN last_mark_name := the_mark_name; count := 1; EXITIF true; ENDIF; ! Count them ! IF lse$$strmatch_wild( the_mark_name, lse$$k_mark_prefix + response ) THEN last_mark_name := the_mark_name; count := count + 1; EXITIF count > 1; ENDIF; ! Next ! mark_list := SUBSTR( mark_list, temp_index + 1, LENGTH(mark_list) ); EXITIF temp_index = 0; ENDLOOP; ! List if there are multiple matches ! IF count > 1 THEN ! ! Get a list ! lse$show(lse$show_mark_list); saved_mark := MARK( NONE ); ! Position to the first line ! lse$top; POSITION( lse$shlst_hlt_range( MARK( NONE ) ) ); ! Strip out lines that don't match ! saved_modifiable := SET( MODIFIABLE, CURRENT_BUFFER, ON ); LOOP ! Get the name off the line ! IF lse$$get_mark_list_mark_name( MARK(NONE), the_mark_name ) = LSE$_NORMAL THEN ! Does it match ! IF lse$$strmatch_wild( the_mark_name, response ) THEN ! Match ! MOVE_VERTICAL( 1 ); ELSE ! No match ! ERASE_LINE; ENDIF; ELSE MOVE_VERTICAL( 1 ); ENDIF; ! Done on end of buffer ! EXITIF GET_INFO( CURRENT_BUFFER, 'record_count' ) < GET_INFO( CURRENT_BUFFER, 'record_number' ); ENDLOOP; SET( MODIFIABLE, CURRENT_BUFFER, saved_modifiable ); POSITION( saved_mark ); RETURN TRUE; ELSE ! Expand the marker name and check the results. ! lse$$lse_mark_name := lse$expand_user_mark ( response ); if (lse$$expand_result = 0 ) then eve$message (LSE$_MARKNOTSET, 0, response); eve$learn_abort; lse$post_command_proc; return false; endif; if (lse$$expand_result = 2 ) then eve$message ( LSE$_AMBMARKNAME, 0, response ); eve$learn_abort; lse$post_command_proc; return false; endif; ! + ! We had not returned by now means we have a valid TPU variable. Execute the ! variable only if it is not UNSPECIFIED. If it is a marker, then call ! the procedure lse$show show it. ! - if lse$$lse_mark_name <> TPU$K_UNSPECIFIED then execute ( "lse$$x_user_mark := " + lse$$lse_mark_name ); if get_info( lse$$x_user_mark, 'type' ) = MARKER then lse$$lse_mark_name := substr( last_mark_name, LENGTH( lse$$k_mark_prefix ) + 1, LENGTH( the_mark_name ) ); lse$show (lse$$x_user_mark); lse$post_command_proc; return true; endif; endif; ENDIF; ! + ! If it was not a marker (i.e., variable with UNSPCIFIED value) then mark must ! have been cancelled. ! - eve$message (LSE$_MARKCANCELLED, 0, response); eve$learn_abort; lse$post_command_proc; return false; endprocedure; procedure lse_erase_comment !doc_begin ! ! ONE LINE DEFINITION: ! Reverses the effect of an ENTER COMMENT command. ! ! DESCRIPTION: ! (ERASE COMMENT) ! This command deletes the comments created from pseudocode with an ! ENTER COMMENT command and restores the text to the pseudocode placeholders. ! The buffer cannot have been modified since the ENTER COMMENT command. ! ! RELATED COMMANDS: ! ENTER COMMENT ! ! CATEGORY: ! Program ! !doc_end local ret_status; ON_ERROR [LSE$_NOLANG, LSE$_CANTERASE, LSE$_UNMODIFIABLE]: eve$message (ERROR_TEXT); lse$post_command_proc; eve$learn_abort; return false; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_erase_comment"); ENDON_ERROR; lse$$save_inserted_text(); lse$$save_undo_reverse_cmd(3, -1); ret_status := lse$undo_enter_comment; lse$$save_redo_reverse_cmd(4, -1); !lse$$reset_undo_buf (CURRENT_BUFFER); !EVE$MESSAGE (lse$_resetundobuf); return ret_status; endprocedure; ! lse_erase_comment procedure lse_recover_buffer( ;file_spec ) ! !doc_begin ! ! ONE LINE DEFINITION: ! Reconstructs the contents of a buffer from a buffer-change journal file. ! ! DESCRIPTION: ! (RECOVER BUFFER) ! You can specify either of the following files: the source file that was ! in the buffer or the full name of the buffer-change journal file. !

! The RECOVER BUFFER command tries to rebuild the contents of ! a buffer by using the latest available generation of the file that ! was in the buffer, and a journal file that contains a description ! of the changes to that buffer. !

! Before LSE tries to recover a buffer, information about the journal ! file is displayed. When you specify an asterisk (*), LSE ! displays information about each available journal file in succession. ! You can choose not to recover a buffer if the information describes a ! journal file other than the one you want. ! ! RELATED COMMANDS: ! SET BUFFER JOURNALING ! ! EXAMPLE: ! For example, this command recovers the buffer message.txt: ! ! ! LSE> RECOVER BUFFER message.txt ! ! ! CATEGORY: ! File ! !doc_end ! local the_file_spec; ON_ERROR lse$post_command_proc; lse$$unexpected_error (error, error_text, error_line, "lse_recover_buffer"); ENDON_ERROR; ! ! Only prompt if the file spec. is unspecified (no argument input) ! if file_spec <> tpu$k_unspecified then the_file_spec := file_spec; else if not lse$prompt_string (file_spec, the_file_spec, lse$_filenameprompt, , '*') then eve$learn_abort; lse$post_command_proc; return false; endif; endif; ! ! Recover all journal-change file if no file spec. or '*' is entered. ! Otherwise, recover the specified journal-change file. ! if (the_file_spec = '') or (the_file_spec = '*') then lse_recover_buffer := eve_recover_buffer_all () else lse_recover_buffer := eve_recover_buffer (the_file_spec) endif; lse$post_command_proc; endprocedure; procedure lse_show_key(;user_key_name_wild) !doc_begin ! ! ONE LINE DEFINITION: ! Displays the definitions of the specified key(s). ! ! DESCRIPTION: ! (SHOW KEY) ! This command displays the key definitions bound to the specified set ! of keys, both the default key bindings and key bindings you create ! with the DEFINE KEY command. If you do not ! specify a key name, LSE prompts for one. !

! If you specify a keyname, LSE displays full information about that ! key. If you specify a wildcard keyname, LSE displays a brief list of all ! keys matching that name. Use Ctrl/F (forward) and Ctrl/B (reverse) ! to navigate through the list of keys. Ctrl/E (expand) lets you ! display full information on any one key. The COLLAPSE command ! reverts back to the brief display. ! ! RELATED COMMANDS: ! NEW KEY ! DELETE KEY ! HELP KEY ! EXPAND ! COLLAPSE ! ! CATEGORY: ! Help ! !doc_end ! LOCAL keyname_str, response, local_key, tpu_keyname; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_show_key"); ENDON_ERROR; lse$shlst_register( lse$key_list ); if get_info( user_key_name_wild, 'type' ) = keyword then response := eve$key_name(user_key_name_wild); else if not lse$prompt_string( user_key_name_wild, response, lse$_keyprompt) then lse$post_command_proc; return false endif endif; ! Compatability of old key names requires more work. The under lying ! procedures don't like wild cards. Don't do it if they are there. ! if index( response, '*' ) = 0 then local_key := eve$$parse_keystring (response); if local_key = 0 then eve$learn_abort; lse$post_command_proc; return false endif; response := eve$key_name( local_key ); endif; lse_show_key := lse$shlst_process( response, lse$key_list ); lse$post_command_proc; ENDPROCEDURE; procedure lse_enter_text(;text_string) !doc_begin ! ! ONE LINE DEFINITION: ! Enters text at the current cursor position. ! DESCRIPTION: !(ENTER TEXT) ! ! RELATED COMMANDS: ! ENTER commands ! ERASE commands ! TOGGLE INSERT OVERSTRIKE ! ! CATEGORY: ! Text ! !doc_end LOCAL the_param_string; ON_ERROR [TPU$_NOTMODIFIABLE, LSE$_UNMODIFIABLE]: eve$message (ERROR_TEXT); eve$learn_abort; lse$post_command_proc; return false; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_enter_text"); ENDON_ERROR; if not lse$prompt_string ( text_string, the_param_string, "", "", "") then lse_enter_text := false; else if the_param_string <> "" then lse$$pending_delete (); lse_enter_text := copy_text(the_param_string); else lse_enter_text := true; endif; endif; lse$post_command_proc; endprocedure; procedure lse_delete_key(;user_key_name) !doc_begin ! ! ONE LINE DEFINITION: ! Deletes a user key definition. ! ! DESCRIPTION: ! (DELETE KEY) ! If the key is a printing key, LSE restores the original ! function of inserting a printing character at the current cursor position; ! otherwise, the key is undefined. ! ! RELATED COMMANDS: ! NEW KEY ! SHOW KEY ! ! CATEGORY: ! Tailor ! !doc_end LOCAL tpu_keyname; ON_ERROR [TPU$_NODEFINITION]: eve$message (ERROR_TEXT); eve$learn_abort; lse$post_command_proc; return false; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_delete_key"); ENDON_ERROR; if lse$prompt_key(user_key_name, tpu_keyname, lse$_keyprompt) then undefine_key(tpu_keyname); return (true) else return(false) endif; endprocedure; procedure lse_search (;search_string, noundo) !doc_begin ! ! ONE LINE DEFINITION: ! Searches the current buffer for the specified string ! and positions the cursor at that string. ! ! DESCRIPTION: ! (SEARCH) ! LSE ignores any occurrence of the search string that begins at the ! current cursor position and displays a message if the string ! cannot be found. ! !

! If you do not specify a search string, ! LSE searches for the previous search string. If there was no previous ! search string, LSE prompts you to specify a string. ! ! RELATED COMMANDS: ! PATTERN SEARCH ! SET SEARCH commands ! QUOTE ! SHOW SEARCH ATTRIBUTES ! SUBSTITUTE commands ! ! CATEGORY: ! Cursor ! !doc_end LOCAL how_exact, response, response_pattern, status, temp, search_string2; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_search" ); ENDON_ERROR; ! ! Save OLD BPM for UNDO ! if noundo <> 1 then lse$$save_old_bpm; endif; ! ! "" means SEARCH NEXT ! search_string2 := search_string; if (search_string2 = '') and (lse$$x_search_attribute_changed = 1) then search_string2 := lse$$search_string; endif; IF search_string2 = '' THEN status := lse$search_next; ELSE ! Prompt ! IF lse$prompt_search(search_string2, response, lse$_searchprompt, '', lse$$search_string, FALSE ) THEN IF response = 0 THEN ! User requested SEARCH NEXT ! status := lse$search_next; ELSE ! User requested sinple SEARCH ! lse$$search_get_how_exact( how_exact ); IF lse$$get_sea_span_space THEN IF eve$$build_space_pattern( response, response_pattern, temp ) THEN EXECUTE( 'lse$$$_x_space_pattern := ' + response_pattern ); status := lse$search_util( lse$$$_x_space_pattern, how_exact, CURRENT_DIRECTION ); ELSE status := lse$search_util( response, how_exact, CURRENT_DIRECTION ); ENDIF; ELSE status := lse$search_util( response, how_exact, CURRENT_DIRECTION ); ENDIF; lse$$search_string := response; lse$$x_search_attribute_changed := 0; ENDIF; ELSE if noundo <> 1 then lse$$save_old_bpm; endif; eve$learn_abort; RETURN FALSE; ENDIF; ENDIF; ! Found? ! IF NOT status THEN eve$message( eve$_strnotfound, 0, lse$$search_string ); eve$learn_abort; ! ! Free OLD BPM since no change in cursor position ! if noundo <> 1 then lse$$free_old_bpm; endif; ELSE ! ! Save NEW BPM for UNDO ! if noundo <> 1 then lse$$save_new_bpm; endif; ENDIF; lse$post_command_proc; RETURN status; endprocedure; ! lse_search procedure lse_pattern_search (;pattern_search_string, noundo) !doc_begin ! ! ONE LINE DEFINITION: ! Enables the use of wildcard patterns in a search string and searches ! the current buffer for all occurrences of that string. ! ! DESCRIPTION: ! (PATTERN SEARCH) ! This command enables the special interpretation of wildcard patterns ! in a search string. LSE ignores any occurrence of the search string ! that begins at the current cursor position and displays a message if ! the the string cannot be found. Use the SET SEARCH PATTERN command to ! specify the style of wildcard patterns (VMS, ULTRIX or TPU). ! !

! For the TPU pattern style the pattern_search_string is a TPU expression ! which must evaluate to a TPU pattern (for example: "'abc' | 'def'"). ! !

! For details of the pattern styles use the command HELP PATTERNS. ! ! RELATED COMMANDS: ! SEARCH ! SET SEARCH commands ! QUOTE ! SHOW SEARCH ATTRIBUTES ! SUBSTITUTE ! PATTERN SUBSTITUTE ! ! CATEGORY: ! Cursor ! !doc_end LOCAL how_exact, prefix, postfix, response, response_pattern, status, temp, pattern_search_string2; ON_ERROR [TPU$_EXECUTEFAIL, TPU$_COMPILEFAIL]: if get_info (lse$search, 'lse$pattern') <> lse$os_tpu then lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_pattern_search" ); endif; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_pattern_search" ); ENDON_ERROR; ! ! Save OLD BPM for UNDO ! if noundo <> 1 then lse$$save_old_bpm; endif; ! ! "" means SEARCH NEXT ! pattern_search_string2 := pattern_search_string; if (pattern_search_string2 = '') and (lse$$x_search_attribute_changed = 1) then pattern_search_string2 := lse$$search_string; endif; IF pattern_search_string2 = '' THEN status := lse$search_next; ELSE ! Prompt ! IF lse$prompt_search(pattern_search_string2, response, lse$_searchprompt, '', lse$$search_string, TRUE ) THEN IF response = 0 THEN ! User requested SEARCH NEXT ! status := lse$search_next; ELSE ! User requested sinple SEARCH ! lse$$search_get_how_exact( how_exact ); if get_info (lse$search, 'lse$pattern') = lse$os_tpu then response_pattern := response; status := 1; else status := eve$$build_pattern( response, response_pattern, temp ); endif; IF GET_INFO( status, "type" ) = KEYWORD THEN ! Error occured ! eve$learn_abort; ! ! Free OLD BPM since no change in cursor position ! if noundo <> 1 then lse$$free_old_bpm; endif; lse$post_command_proc; RETURN FALSE; ELSE IF status THEN ! Is a pattern ! prefix := "RETURN("; postfix := ")"; IF LENGTH( response ) > (256 - LENGTH( prefix ) - LENGTH( postfix )) THEN eve$message( eve$_targettoobig ); eve$learn_abort; ! ! Free OLD BPM since no change in cursor position ! if noundo <> 1 then lse$$free_old_bpm; endif; lse$post_command_proc; RETURN FALSE; ENDIF; IF response_pattern = '' THEN response_pattern := '""'; ENDIF; response_pattern := EXECUTE( prefix + response_pattern + postfix ); if (get_info (lse$search, 'lse$pattern') = lse$os_tpu) and (get_info(response_pattern, "type") <> STRING) and (get_info(response_pattern, "type") <> PATTERN) then message('Error in search pattern'); if noundo <> 1 then lse$$free_old_bpm; endif; lse$post_command_proc; RETURN FALSE; endif; status := lse$search_util( response_pattern, how_exact, CURRENT_DIRECTION ); ELSE status := lse$search_util( response, how_exact, CURRENT_DIRECTION ); ENDIF; ENDIF; lse$$search_string := response; lse$$x_search_attribute_changed := 0; ENDIF; ELSE eve$learn_abort; ! ! Free OLD BPM since no change in cursor position ! if noundo <> 1 then lse$$free_old_bpm; endif; lse$post_command_proc; RETURN FALSE; ENDIF; ENDIF; ! Found? ! IF NOT status THEN eve$message( eve$_strnotfound, 0, lse$$search_string ); eve$learn_abort; ! ! Free OLD BPM since no change in cursor position ! if noundo <> 1 then lse$$free_old_bpm; endif; ELSE ! ! Save NEW BPM for UNDO ! if noundo <> 1 then lse$$save_new_bpm; endif; ENDIF; lse$post_command_proc; RETURN status; endprocedure; procedure lse_enter_line !doc_begin ! ! ONE LINE DEFINITION: ! Enters a new comment line or text line. ! ! DESCRIPTION: ! (ENTER LINE) ! If the cursor is positioned within a comment (as defined in the ! current language) and wrapping is set for the buffer, then the ! new line will be a comment line otherwise, it will be a blank line. !

! If the cursor is at the end of a line, the ENTER LINE command adds ! a new blank line following the current line. !

! If the cursor is at the beginning of a line, this ! command adds a new blank line before the current line. !

! If the cursor is positioned within a line, that line ! is split into two lines at the original cursor position. ! ! RELATED COMMANDS: ! ENTER commands ! ERASE commands ! SET BUFFER WRAP ! ! CATEGORY: ! Text ! !doc_end LOCAL the_cont_comment; ON_ERROR [LSE$_OVERVIEW]: eve$message (ERROR_TEXT); eve$learn_abort; lse$post_command_proc; return false; [TPU$_NOTMODIFIABLE, LSE$_UNMODIFIABLE]: eve$message (ERROR_TEXT); eve$learn_abort; lse$post_command_proc; return false; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_enter_line"); ENDON_ERROR; IF lse$enter_line(TRUE, FALSE) = lse$_normal then lse_enter_line := true; else lse_enter_line := false; endif; lse$post_command_proc; endprocedure; ! lse_enter_line procedure lse_enter_space !doc_begin ! ! ONE LINE DEFINITION: ! Inserts or overstrikes a space at the current cursor position. ! ! DESCRIPTION: ! (ENTER SPACE) ! If the cursor is past the right margin and ! wrap mode is set, this command performs an ENTER LINE operation on the ! current line. ! ! RELATED COMMANDS: ! ENTER commands ! ERASE commands ! SET BUFFER RIGHT MARGIN ! SET BUFFER WRAP ! ! CATEGORY: ! Text ! !doc_end on_error [TPU$_NOTMODIFIABLE, LSE$_UNMODIFIABLE]: eve$message (ERROR_TEXT); eve$learn_abort; lse$post_command_proc; return false; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_enter_space"); endon_error; return lse$$enter_space; endprocedure; ! lse_enter_space procedure lse_new_file (;file_spec) ! !doc_begin ! ! ONE LINE DEFINITION: ! Creates a new file and positions to it. ! ! DESCRIPTION: ! (NEW FILE) ! If the file specified already exists, LSE reads in that file to a new ! buffer. If the file is already in a buffer, LSE positions it to that ! buffer. !

! If the file specification contains no directory or device information, the ! source searchlist is used to locate the file and/or create the buffer. ! ! RELATED COMMANDS: ! GOTO BUFFER ! OPEN FILE ! NEW BUFFER ! VIEW FILE ! ! CATEGORY: ! File ! !doc_end ! LOCAL the_file_spec, the_buffer, open_failed; ON_ERROR [TPU$_OPENIN, LSE$_NOCMSCREATE, LSE$_COMMANDCANCEL, LSE$_FILEOPENFAIL]: eve$message (error_text); open_failed := true; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_new_file "); ENDON_ERROR; ! ! Get the file specification. Allow it to choose asynchronous mode and/or the ! DECwindows dialog box interface. ! if not lse$prompt_existing_file (file_spec, the_file_spec, lse$_filenameprompt, eve$_nofilespec, tpu$k_unspecified, ! Default value 'NEW FILE', ! DECwindows title tpu$k_unspecified, ! Files to display 'NEW FILE !AS') ! Asynchronous command then lse$post_command_proc; return false; endif; ! ! Get the buffer that this file is in or read the file. Note that the last ! argument to the builtin is not to create the file automatically. ! the_buffer := lse$create_buffer (tpu$k_unspecified, ! No specific buffer name the_file_spec, ! File name eve$default_buffer, ! Defaults buffer tpu$k_unspecified, ! Journal file name on); ! Create the file ! ! If opening the file failed, then delete the buffer. ! if open_failed then delete (the_buffer); the_buffer := 0; endif; ! ! Position to the buffer if we have one ! if the_buffer <> 0 then return lse_goto_buffer (the_buffer); endif; ! ! We did not get the file, so return false. ! lse$post_command_proc; return false; endprocedure; procedure lse_open_file (;file_spec) ! !doc_begin ! ! ONE LINE DEFINITION: ! Moves the cursor to the buffer containing the specified file. ! ! DESCRIPTION: ! (OPEN FILE) ! This command moves the cursor to its last editing position in the buffer ! containing the specified file. If the file is not already in ! a buffer, LSE reads the file into a new buffer. ! When LSE reads a file, it uses the list of source directories ! if you do not specify a directory in the file specification and if it ! cannot be found in the default directory. ! !

! If the file is found in a read-only directory, ! LSE sets its modifiable state to (off). If the file is found in ! a read/write directory, its modifiable state is set to (on). ! ! RELATED COMMANDS: ! NEW BUFFER ! NEW FILE ! SET DIRECTORY SOURCE ! VIEW FILE ! ! CATEGORY: ! File ! !doc_end ! ! Add Cursor and Screen to CATEGORY ! LOCAL the_file_spec, the_buffer, open_failed; ON_ERROR [LSE$_IMAGEACTERROR]: eve$message (ERROR_TEXT); eve$learn_abort; lse$post_command_proc; return false; [TPU$_OPENIN, LSE$_COMMANDCANCEL, LSE$_FILEOPENFAIL, LSE$_FILEREADFAIL]: eve$message (error_text); open_failed := true; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_open_file "); ENDON_ERROR; ! ! Get the file specification. Allow it to choose asynchronous mode and/or the ! DECwindows dialog box interface. ! if not lse$prompt_existing_file (file_spec, the_file_spec, lse$_filenameprompt, eve$_nofilespec, tpu$k_unspecified, ! Default value 'OPEN FILE', ! DECwindows title tpu$k_unspecified, ! Files to display 'OPEN FILE !AS') ! Asynchronous command then lse$post_command_proc; return false; endif; ! ! Get the buffer that this file is in or read the file. Note that the last ! argument to the builtin is not to create the file automatically. ! the_buffer := lse$create_buffer (tpu$k_unspecified, ! No specific buffer name the_file_spec, ! File name eve$default_buffer, ! Defaults buffer tpu$k_unspecified, ! Journal file name off); ! Do not create the file ! ! If opening the file failed, then delete the buffer. ! if open_failed then delete (the_buffer); the_buffer := 0; endif; ! ! Position to the buffer if we have one ! if the_buffer <> 0 then return lse_goto_buffer (the_buffer); endif; ! ! We did not get the file, so return false. ! lse$post_command_proc; return false; endprocedure; procedure lse_open_selected_file ! ! FUNCTION ! Open a file using the current global selection as a file name. ! Position at the global selection line and column number ! ! INPUTS ! The current global selection via lse$$get_global_select ! ! OUTPUTS ! The file is opened and positioned at the appropriate line and column ! !doc_begin ! ! ONE LINE DEFINITION: ! Uses the current primary selection information to determine the file ! to open. ! ! DESCRIPTION: ! (OPEN SELECTED FILE) ! This command uses the OPEN FILE command when opening the file. ! ! ! If a file is not found, LSE attempts to use additional primary ! selection information to place the editing cursor on at the ! appropriate line and column. If the file is already in the editing ! buffer, then that buffer is mapped to the current window and it ! becomes the current buffer. ! !

! You can specify a list of directories for LSE to search when a file ! cannot be located in the specified directory. This could result in ! LSE accessing a file that is different than the file specification ! by the selection. ! ! ! RELATED COMMANDS: ! OPEN FILE ! NEW FILE ! NEW BUFFER ! VIEW FILE ! ! CATEGORY: ! File ! !doc_end ! ! Add Cursor and Screen to CATEGORY. ! local col_num, global_string, global_file_name, file_opened, rec_num, open_failed; ON_ERROR [LSE$_IMAGEACTERROR, TPU$_BADVALUE]: eve$message (ERROR_TEXT); eve$learn_abort; lse$post_command_proc; return false; [TPU$_OPENIN, LSE$_COMMANDCANCEL, LSE$_FILEOPENFAIL, LSE$_FILEREADFAIL]: eve$message (error_text); open_failed := true; [TPU$_PARSEFAIL]: [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_open_selected_file "); ENDON_ERROR; ! Init ! global_string := ''; global_file_name := ''; file_opened := false; ! ! First try STRING ! lse$$get_global_select( "STRING"); if get_info( lse$$global_select_return, 'type' ) = STRING then global_string := lse$$global_select_return; file_opened := lse_open_file (global_string); ! We're done because it responded with string and we can't expect ! the column and line number to be correct. ! RETURN true; endif; ! ! If we didn't find a file, try FILE_NAME. Try for the filename ONLY if ! we are not the direct owner of the selection. If we were the owner, ! then we want to end up with a File Not Found path... ! if not file_opened then if (get_info (SCREEN,"global_select",PRIMARY) = 0) then lse$$get_global_select( "FILE_NAME" ); if get_info( lse$$global_select_return, 'type' ) = STRING then global_file_name := lse$$global_select_return; file_opened := lse_open_file (global_file_name); endif; endif; endif; ! ! Now let's do error detection. We only have an error if we do not have ! a filename. The are two global data values that either have a value or ! do not have a value. The goal is to opt to report FNF most of the time ! and only No Selection Data when both responses failed. ! if not file_opened then if ((global_string = '') AND (global_file_name = '')) then ! Nothing sigh... ! eve$message( TPU$_NOGBLSELDATA ); eve$learn_abort; return (FALSE); endif; eve$learn_abort; return (FALSE); endif; ! Position to the right place ! return lse$$gs_position; endprocedure; procedure lse_view_file (;file_spec) ! !doc_begin ! ! ONE LINE DEFINITION: ! Moves the cursor to a read-only, unmodifiable buffer containing ! the specified file. ! DESCRIPTION: ! (VIEW FILE) ! ! RELATED COMMANDS: ! GOTO BUFFER ! OPEN FILE ! NEW BUFFER ! NEW FILE ! ! CATEGORY: ! File ! !doc_end ! LOCAL the_file_spec, the_buffer, open_failed; ON_ERROR [LSE$_IMAGEACTERROR]: eve$message (ERROR_TEXT); eve$learn_abort; lse$post_command_proc; return false; [TPU$_OPENIN, LSE$_COMMANDCANCEL, LSE$_FILEOPENFAIL, LSE$_FILEREADFAIL]: eve$message (error_text); open_failed := true; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_view_file"); return false; ENDON_ERROR; ! ! Get the file specification. Allow it to choose asynchronous mode and/or the ! DECwindows dialog box interface. ! if not lse$prompt_existing_file (file_spec, the_file_spec, lse$_filenameprompt, eve$_nofilespec, tpu$k_unspecified, ! Default value 'VIEW FILE', ! DECwindows title tpu$k_unspecified, ! Files to display 'VIEW FILE !AS') ! Asynchronous command then lse$post_command_proc; return false; endif; ! ! Get the buffer that this file is in or read the file. Note that the last ! argument to the builtin is not to create the file automatically. ! the_buffer := lse$create_buffer (tpu$k_unspecified, ! No specific buffer name the_file_spec, ! File name eve$default_buffer, ! Defaults buffer tpu$k_unspecified, ! Journal file name off); ! Do not create the file ! ! If opening the file failed, then delete the buffer. ! if open_failed then delete (the_buffer); the_buffer := 0; endif; ! ! Position to the buffer if we have one ! if the_buffer <> 0 then if lse_goto_buffer (the_buffer) then if lse_set_buffer_close ( lse$list_extract(lse$_closedelimit, lse$_closelist, lse$$k_close_read_only )) then ! ! Reset the modified flag on the buffer ! set (MODIFIED, the_buffer, OFF); return lse_set_buffer_modifiable (OFF) endif; endif; endif; lse$post_command_proc; return false; endprocedure; procedure lse_save_section (;file_spec) !doc_begin ! ! ONE LINE DEFINITION: ! Writes the binary form of all current key definitions, learn sequences, ! and text processing utility (TPU) procedures and variables to a section file. ! ! DESCRIPTION: ! (SAVE SECTION) ! This command writes state information to a section file so that it ! can be restored efficiently at a later time. The default file type of the saved ! section file is operating system-specific. ! !

! TPU saves key definitions, learn sequences, TPU procedures, and ! TPU variable names !

! LSE saves the following global attributes over and above those saved ! by TPU: ! (UNNUMBERED) ! Directory Readonly ! Directory Source ! Bell All ! Bell Broadcast ! Cursor ! Command Language ! Primary Selection Model ! Keypad ! Clipboard ! Pending Delete ! Tabs Visible ! Save Related Buffers ! Grammar prefix, Help Library ! Prompt Terminators ! Prompt Alterminators ! Prompt Abort ! Prompt Dialog ! Prompt Keypad ! Prompt Expandmenu ! Search Auto Reverse ! Search Case Sensitive ! Search Diacritical ! Search Pattern ! Search Span Space ! Balance Windows ! Font Attributes ! Maximum Windows ! Minimum Window Length ! Scroll Margins ! Height ! Width ! ! ! RELATED COMMANDS: ! SAVE ENVIRONMENT ! ! CATEGORY: ! Tailor ! !doc_end ! local the_file_spec; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_save_section"); ENDON_ERROR; if not lse$prompt_string ( file_spec, the_file_spec, lse$_filenameprompt, eve$_nofilespec) then lse$post_command_proc; return false; endif; lse$save_section(the_file_spec); lse$post_command_proc; return true; endprocedure; ! lse_save_section procedure lse_substitute (;search_string, replace_string, substitute_type ) !doc_begin ! ! ONE LINE DEFINITION: ! Replaces occurrences of one text string with another. ! ! DESCRIPTION: ! (SUBSTITUTE) ! This command replaces an occurrence of a search string with the ! specified replace string. It searches for the string in the current ! direction. ! !

! LSE performs case ! matching when replacing text. For example, if a word in a search ! string is all uppercase, all the letters in the corresponding ! replace string become uppercase. LSE prompts you ! for confirmation before the replacement is made. If you specify ! the parameter value (all) in response to the confirmation ! prompt, all occurrences of the search string are replaced ! with the replace string. ! ! ! RELATED COMMANDS: ! EXACT SUBSTITUTE ! PATTERN SUBSTITUTE ! PATTERN EXACT SUBSTITUTE ! SEARCH ! SET SEARCH commands ! ! CATEGORY: ! Text ! !doc_end local response, status, subs_type, init_resp; on_error [TPU$_NOTMODIFIABLE, LSE$_UNMODIFIABLE]: eve$message (ERROR_TEXT); eve$learn_abort; lse$post_command_proc; return false; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_substitute"); endon_error; ! Ensure that we have been given a search string and a replace string. if lse$prompt_string( search_string, response, lse$_searchprompt, lse$_oldseastring, lse$$search_string) then lse$$search_string := response; ! Done this way instead of passing ! lse$$search_string directly so the ! lse$$search_string doesn't become ! unspecified on prompt abort if lse$prompt_string( replace_string, response, lse$_replaceprompt, lse$_nullreplace, '' ) then lse$$replace_string := response; ! Set up CASE_MATCHING, NOPATTERN (NOWILDCARD) substitution and the ! replacement flag TRUE. (for eve) lse$$case_matching_prog := compile("lse$$actual_replacement_string := lse$$match_strings;"); if lse$$x_search_type <> 0 then lse$$x_search_attribute_changed := 1; endif; lse$$x_search_type := 0; lse$$x_replacement := 1; !+ ! Parse substitute_type & set the appropirate variables. !- IF substitute_type = tpu$k_unspecified THEN subs_type := tpu$k_unspecified; ELSE IF lse$prompt_list( substitute_type, subs_type, '', lse$_subtypedelimit, lse$_subtypelist, false, '', lse$_subtypedef) then CASE subs_type [lse$$k_subtype_all]: subs_type := eve$x_all; [lse$$k_subtype_single]: subs_type := eve$x_last; [lse$$k_subtype_confirm]: subs_type := tpu$k_unspecified; [OTHERWISE]: EVE$MESSAGE( lse$_internerr, 0, 'lse_substitute' ); eve$learn_abort; lse$post_command_proc; RETURN false; ENDCASE; else eve$learn_abort; return false; endif; endif; ! Initialize the search direction using the buffer direction. ! eve$x_old_find_direction := current_direction; ! Do the work ! status := eve_replace(lse$$search_string,lse$$replace_string,subs_type); lse$$x_search_attribute_changed := 0; ! Change the last search ! lse$$search_get_how_exact( status ); lse$post_command_proc; return status; endif; endif; eve$learn_abort; return false; endprocedure; ! lse_substitute procedure lse_exact_substitute (;search_string, replace_string, substitute_type) !doc_begin ! ! ONE LINE DEFINITION: ! Replaces occurrences of the search string with the exact form of the ! replace string. ! ! DESCRIPTION: ! (EXACT SUBSTITUTE) ! This command ignores the case of characters in the search string and ! replaces it exactly with the specified replace string. It searches ! for the string in the current direction. ! LSE prompts you for confirmation before the replacement is made. ! ! RELATED COMMANDS: ! SUBSTITUTE ! PATTERN EXACT SUBSTITUTE ! SEARCH ! SET SEARCH commands ! ! CATEGORY: ! Text ! !doc_end local response, status, subs_type, init_resp; on_error [TPU$_NOTMODIFIABLE, LSE$_UNMODIFIABLE]: eve$message (ERROR_TEXT); eve$learn_abort; lse$post_command_proc; return false; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_exact_substitute"); endon_error; ! Ensure that we have been given a search string and a replace string. if lse$prompt_string( search_string, response, lse$_searchprompt, lse$_oldseastring, lse$$search_string) then lse$$search_string := response; if lse$prompt_string( replace_string, response, lse$_replaceprompt, lse$_nullreplace, '' ) then lse$$replace_string := response; ! Set up EXACT MATCHING, NOPATTERN (NOWILDCARD) substitution and the ! replacement flag TRUE. (for eve) lse$$case_matching_prog := compile("lse$$actual_replacement_string := lse$$replace_string;"); if lse$$x_search_type <> 0 then lse$$x_search_attribute_changed := 1; endif; lse$$x_search_type := 0; lse$$x_replacement := 1; !+ ! Parse substitute_type & set the appropirate variables. !- IF substitute_type = tpu$k_unspecified THEN subs_type := tpu$k_unspecified; ELSE IF lse$prompt_list( substitute_type, subs_type, '', lse$_subtypedelimit, lse$_subtypelist, false, '', lse$_subtypedef) then CASE subs_type [lse$$k_subtype_all]: subs_type := eve$x_all; [lse$$k_subtype_single]: subs_type := eve$x_last; [lse$$k_subtype_confirm]: subs_type := tpu$k_unspecified; [OTHERWISE]: EVE$MESSAGE( lse$_internerr, 0, 'lse_exact_substitute' ); eve$learn_abort; lse$post_command_proc; RETURN false; ENDCASE; else eve$learn_abort; lse$post_command_proc; return false; endif; endif; ! Initialize the search direction using the buffer direction. ! eve$x_old_find_direction := current_direction; ! Do the work ! status := eve_replace(lse$$search_string,lse$$replace_string,subs_type); lse$$x_search_attribute_changed := 0; ! Change the last search ! lse$$search_get_how_exact( status ); lse$post_command_proc; return status; endif; endif; eve$learn_abort; return false; endprocedure; procedure lse_pattern_substitute (;pattern_search_string, replace_string, substitute_type) !doc_begin ! ! ONE LINE DEFINITION: ! ! Replaces any string matching the given string, which may contain wildcards. ! ! DESCRIPTION: ! (PATTERN SUBSTITUTE) ! This command enables you to specify wildcard patterns in the search ! string. LSE replaces any string of characters meeting the wildcard ! search criteria with the replace string. Use the SET SEARCH PATTERN ! command to specify the style of wildcard patterns (VMS, ULTRIX or TPU). ! !

! By default, this command performs case matching when replacing text. ! For example, if a word in a search string is all uppercase, all the ! letters in the corresponding replace string become uppercase. ! LSE prompts you for confirmation before the replacement is made. ! If you specify the parameter value (all) at the confirmation ! prompt, all occurrences of the search string are replaced with the replace string. ! !

! For the TPU pattern style the pattern_search_string is a TPU expression ! which must evaluate to a TPU pattern (for example: "'abc' | 'def'") ! and the replace_string is a TPU expression which must evaluate to a ! TPU string (for example: "'xyz'"). ! !

! For details of the pattern styles use the command HELP PATTERNS. ! ! RELATED COMMANDS: ! SUBSTITUTE ! EXACT SUBSTITUTE ! PATTERN EXACT SUBSTITUTE ! PATTERN SEARCH ! SEARCH ! SET SEARCH commands ! ! CATEGORY: ! Text ! !doc_end local response, status, subs_type, init_resp; on_error [TPU$_NOTMODIFIABLE, LSE$_UNMODIFIABLE]: eve$message (ERROR_TEXT); eve$learn_abort; lse$post_command_proc; return false; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_pattern_substitute"); endon_error; ! Ensure that we have been given a search string and a replace string. if lse$prompt_string( pattern_search_string, response, lse$_searchprompt, lse$_oldseastring, lse$$search_string) then lse$$search_string := response; if lse$prompt_string( replace_string, response, lse$_replaceprompt, lse$_nullreplace, '' ) then lse$$replace_string := response; ! Set up CASE_MATCHING, PATTERN (WILDCARD) substitution and the ! replacement flag TRUE. (for eve) lse$$case_matching_prog := compile("lse$$actual_replacement_string := lse$$match_strings;"); if lse$$x_search_type <> 2 then lse$$x_search_attribute_changed := 1; endif; lse$$x_search_type := 2; lse$$x_replacement := 1; !+ ! Parse substitute_type & set the appropirate variables. !- IF substitute_type = tpu$k_unspecified THEN subs_type := tpu$k_unspecified; ELSE IF lse$prompt_list( substitute_type, subs_type, '', lse$_subtypedelimit, lse$_subtypelist, false, '', lse$_subtypedef) then CASE subs_type [lse$$k_subtype_all]: subs_type := eve$x_all; [lse$$k_subtype_single]: subs_type := eve$x_last; [lse$$k_subtype_confirm]: subs_type := tpu$k_unspecified; [OTHERWISE]: EVE$MESSAGE( lse$_internerr, 0, 'lse_pattern_substitute' ); eve$learn_abort; lse$post_command_proc; RETURN false; ENDCASE; else eve$learn_abort; lse$post_command_proc; return false; endif; endif; ! Initialize the search direction using the buffer direction. ! eve$x_old_find_direction := current_direction; ! Do the work ! status := eve_replace(lse$$search_string,lse$$replace_string,subs_type); lse$$x_search_attribute_changed := 0; ! Change the last search ! lse$$search_get_how_exact( status ); lse$post_command_proc; return status; endif; endif; eve$learn_abort; return false; endprocedure; procedure lse_pattern_exact_substitute(;pattern_search_string, replace_string, substitute_type) !doc_begin ! ! ONE LINE DEFINITION: ! Searches for a string that matches the wildcard string and replaces it ! with the text exactly as specified in the replace string. ! ! DESCRIPTION: ! (PATTERN EXACT SUBSTITUTE) ! This command enables you to specify wildcard patterns in the search ! string, then replace the string of characters meeting the search ! criteria with exactly the characters specified in the replace string. ! Use the SET SEARCH PATTERN command to specify the style of wildcard ! patterns (VMS, ULTRIX or TPU). ! !

! LSE prompts you for confirmation before the replacement is made. ! If you specify the parameter value (all) at the confirmation ! prompt, all occurrences of the search string are replaced with the ! replace string. ! !

! For the TPU pattern style the pattern_search_string is a TPU expression ! which must evaluate to a TPU pattern (for example: "'abc' | 'def'") ! and the replace_string is a TPU expression which must evaluate to a ! TPU string (for example: "'xyz'"). ! !

! For details of the pattern styles use the command HELP PATTERNS. ! ! RELATED COMMANDS: ! SUBSTITUTE ! EXACT SUBSTITUTE ! PATTERN SUBSTITUTE ! PATTERN SEARCH ! SEARCH commands ! SET SEARCH commands ! ! CATEGORY: ! Text ! !doc_end ! ! Current not being used in documentation: ! ! EXAMPLE: ! The wildcard character * (defined as "any character ! or characters") is used in the search string. Using this wildcard ! character, LSE will replace such strings as NAME_MAX_LENGTH and ! NAME_a_LENGTH with the string NAME_B_LENGTH. ! ! ! LSE> EXACT WILDCARD SUBSTITUTE NAME_*_LENGTH NAME_B_LENGTH ! ! local response, status, subs_type, init_resp; on_error [TPU$_NOTMODIFIABLE, LSE$_UNMODIFIABLE]: eve$message (ERROR_TEXT); eve$learn_abort; lse$post_command_proc; return false; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_pattern_exact_substitute"); endon_error; ! Ensure that we have been given a search string and a replace string. if lse$prompt_string( pattern_search_string, response, lse$_searchprompt, lse$_oldseastring, lse$$search_string) then lse$$search_string := response; if lse$prompt_string( replace_string, response, lse$_replaceprompt, lse$_nullreplace, '' ) then lse$$replace_string := response; ! Set up EXACT MATCHING, PATTERN (WILDCARD) substitution and the ! replacement flag TRUE. (for eve) lse$$case_matching_prog := compile("lse$$actual_replacement_string := lse$$replace_string;"); if lse$$x_search_type <> 2 then lse$$x_search_attribute_changed := 1; endif; lse$$x_search_type := 2; lse$$x_replacement := 1; !+ ! Parse substitute_type & set the appropirate variables. !- IF substitute_type = tpu$k_unspecified THEN subs_type := tpu$k_unspecified; ELSE IF lse$prompt_list( substitute_type, subs_type, '', lse$_subtypedelimit, lse$_subtypelist, false, '', lse$_subtypedef) then CASE subs_type [lse$$k_subtype_all]: subs_type := eve$x_all; [lse$$k_subtype_single]: subs_type := eve$x_last; [lse$$k_subtype_confirm]: subs_type := tpu$k_unspecified; [OTHERWISE]: EVE$MESSAGE( lse$_internerr, 0, 'lse_pattern_exact_substitute' ); eve$learn_abort; lse$post_command_proc; RETURN false; ENDCASE; else eve$learn_abort; lse$post_command_proc; return false; endif; endif; ! Initialize the search direction using the buffer direction. ! eve$x_old_find_direction := current_direction; ! Do the work ! status := eve_replace(lse$$search_string,lse$$replace_string,subs_type); lse$$x_search_attribute_changed := 0; ! Change the last search ! lse$$search_get_how_exact( status ); lse$post_command_proc; return status; endif; endif; eve$learn_abort; return false; endprocedure; procedure lse_enter_tab ! !doc_begin ! ! ONE LINE DEFINITION: ! Inserts indentation and moves to the current indentation level. ! ! DESCRIPTION: ! (ENTER TAB) ! This command inserts blanks and tabs to move the cursor to the current ! indentation level (if at the beginning of the line), or to move the ! cursor to the next tab stop. !

! If the current indentation level is set to the beginning of the line and ! the cursor is at the beginning of the line, the ENTER TAB command inserts ! enough blank space to move the cursor to the first tab stop. ! ! RELATED COMMANDS: ! SET BUFFER TAB INCREMENT ! DELETE TAB ! ENTER commands ! ERASE commands ! ! CATEGORY: ! Text ! !doc_end ! on_error [TPU$_NOTMODIFIABLE, LSE$_UNMODIFIABLE]: eve$message (ERROR_TEXT); eve$learn_abort; lse$post_command_proc; return false; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_enter_tab"); endon_error; lse_enter_tab := lse$$tab; lse$post_command_proc; endprocedure; procedure lse_delete_tab ! !doc_begin ! ! ONE LINE DEFINITION: ! Erases blanks and tabs to the left of the cursor, which moves the cursor ! to the previous tab stop. ! ! DESCRIPTION: ! (DELETE TAB) ! This command moves the cursor to the previous tab stop set by the ! SET BUFFER TAB INCREMENT command. ! If no tabs or blanks immediately precede the cursor, this command has ! no effect. If nonblank or nontab characters are present in the column ! positions at or after the previous tab stop, LSE removes the blanks and ! tabs between those characters and the cursor, and then repositions the ! cursor after those characters, but not at the tab stop. ! ! RELATED COMMANDS: ! ENTER TAB ! SET BUFFER TAB INCREMENT ! ! CATEGORY: ! Text ! !doc_end ! on_error [TPU$_NOTMODIFIABLE, LSE$_UNMODIFIABLE]: eve$message (ERROR_TEXT); eve$learn_abort; lse$post_command_proc; return false; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_delete_tab"); endon_error; lse_delete_tab := lse$$untab; lse$post_command_proc; endprocedure; procedure lse_enter_special (;ascii_code) ! !doc_begin ! ! ONE LINE DEFINITION: ! Causes LSE to enter the character specified by the ASCII code ! into the current buffer. ! DESCRIPTION: ! (ENTER SPECIAL) ! ! RELATED COMMANDS: ! QUOTE ! SET BUFFER TEXT ! ENTER commands ! ERASE commands ! ! EXAMPLE: ! The following example causes LSE to insert a form-feed character (Ctrl/L): ! ! LSE> ENTER SPECIAL 12 ! ! ! CATEGORY: ! Text ! !doc_end ! local int_for_ascii_char; ON_ERROR [TPU$_NOTMODIFIABLE, LSE$_UNMODIFIABLE]: eve$message (ERROR_TEXT); eve$learn_abort; lse$post_command_proc; return false; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_enter_special "); ENDON_ERROR; if lse$prompt_number (ascii_code, int_for_ascii_char, lse$_asciicodeprompt, lse$_noasciicode) then if ( int_for_ascii_char < 0 ) OR ( int_for_ascii_char > 255 ) then eve$message(message_text(lse$_illparam, 1, '') + str(int_for_ascii_char)); lse_enter_special := FALSE; else copy_text (ascii (int_for_ascii_char) ); endif; else lse_enter_special := FALSE; endif; lse$post_command_proc; endprocedure; procedure lse_save_environment(;file_spec) ! old command: SAVE ENVIRONMENT/ALL (default) !doc_begin ! ! ONE LINE DEFINITION: ! Saves all language definitions, including placeholders, tokens, ! aliases, routines, adjustments, and ! packages in an environment file. ! ! DESCRIPTION: ! (SAVE ENVIRONMENT) ! This command reduces the startup time for LSE over executing the ! language definitions in an initialization file each time LSE is ! invoked. ! ! RELATED COMMANDS: ! SAVE ENVIRONMENT CHANGES ! SAVE SECTION ! ! CATEGORY: ! Language ! !doc_end ! local the_file_spec; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_save_environment"); ENDON_ERROR; if not lse$prompt_string ( file_spec, the_file_spec, lse$_filenameprompt, eve$_nofilespec) then lse$post_command_proc; return false; endif; lse_save_environment := lse$save_environment (the_file_spec, true); lse$post_command_proc; endprocedure; ! lse_save_environment procedure lse_save_environment_changes(;file_spec) ! old command: SAVE ENVIRONMENT/NEW !doc_begin ! ! ONE LINE DEFINITION: ! Saves language definitions (including placeholders, tokens, aliases, ! and packages) ! that were defined in the current editing session in an environment file. ! ! DESCRIPTION: ! (SAVE ENVIRONMENT CHANGES) ! Definitions that were ! read in from an environment file are not written. ! ! RELATED COMMANDS: ! SAVE ENVIRONMENT ! SAVE SECTION ! ! CATEGORY: ! Language ! !doc_end ! local the_file_spec; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_save_environment_changes"); ENDON_ERROR; if not lse$prompt_string ( file_spec, the_file_spec, lse$_filenameprompt, eve$_nofilespec) then lse$post_command_proc; return false; endif; lse_save_environment_changes := lse$save_environment(the_file_spec, false); lse$post_command_proc; endprocedure; !lse_save_environment_changes procedure lse_lse(;lse_command); !doc_begin ! ! ONE LINE DEFINITION: ! Directs LSE to execute a portable language command. ! DESCRIPTION: ! (LSE) ! ! RELATED COMMANDS: ! TPU ! PLSE ! SET COMMAND LANGUAGE ! ! CATEGORY: ! Editing ! !doc_end ! LOCAL command, old_parser, response; ON_ERROR [OTHERWISE]: ! only attempt to restore if the original save has been done if get_info( old_parser, 'type' ) = keyword then set (lse$cli_parser,lse$system, old_parser); endif; lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_lse"); ENDON_ERROR; if not lse$prompt_string (lse_command, response, lse$_lsecmdprompt, lse$_nocommand) then lse$post_command_proc; return false; endif; ! Use the portable grammar now. The parser is set explicitly ! like this so that REPEAT can know which parser to use lse$$x_ugly_set_command_language_executed_flag := false; old_parser := set (lse$cli_parser, lse$system, 0); ! This routine uses the portable grammar no matter what command := eve$$parse( response ); IF command <> '' THEN EXECUTE( command ); ENDIF; ! Remember which parser we were using if not lse$$x_ugly_set_command_language_executed_flag then set (lse$cli_parser,lse$system, old_parser); endif; lse$post_command_proc; return true; endprocedure; procedure lse_plse(;lse_command); !doc_begin ! ! ONE LINE DEFINITION: ! Directs LSE to execute a portable language command. ! DESCRIPTION: ! (PLSE) ! ! RELATED COMMANDS: ! TPU ! SET COMMAND LANGUAGE ! ! CATEGORY: ! Editing ! !doc_end ! ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_plse"); ENDON_ERROR; lse_plse := lse_lse (lse_command); lse$post_command_proc; return true; endprocedure; procedure lse_tpu(;tpu_command); ! !doc_begin ! ! ONE LINE DEFINITION: ! Directs LSE to execute text processing utility (TPU) program statments. ! DESCRIPTION: ! (TPU) ! ! RELATED COMMANDS: ! PLSE ! ! CATEGORY: ! Editing ! !doc_end ! LOCAL response; ON_ERROR [TPU$_EXECUTEFAIL, TPU$_CONTROLC]: lse$$enable_undo_calls (); lse$$reset_all_undo_bufs; lse$post_command_proc; return false; [OTHERWISE]: lse$$enable_undo_calls (); lse$$reset_all_undo_bufs; lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_tpu"); ENDON_ERROR; if not lse$prompt_string ( tpu_command, response, lse$_tpucmdprompt, lse$_nocommand) then lse$post_command_proc; return false; endif; !------------------------------------------------------------------------------ ! Changes for UNDOing TPU stuff commented out for NOW !------------------------------------------------------------------------------ ! ! In order to UNDO TPU buffer change operations, we need to parse the command ! contained in 'response'. If it is a valid buffer change command, then the ! necessary action required to save information for UNDO must be performed. ! In certain cases, this will be done directly within the call to the BUILTIN ! that parses the command. Examples of these are APPEND_LINE, SPLIT_LINE etc. ! All cursor movement operations will be handled in the same way. In some ! cases we may need to determine the types and values of the parameters, so ! that appropriate action can be taken. ! ! i := lse$$is_buffer_change (response, par1, par2, par3, par4, par5); ! IF (i > 0) THEN ! ! IF (i = 1) THEN ! Cursor movement operation, save old_bpm ! lse$$save_old_bpm; ! ENDIF; ! ! IF (i = 2) THEN ! Change case command ! the_par1 := the_parameter(par1); ! type_of_par1 := get_info (the_par1, "type"); ! IF (type_of_par1 = BUFFER) OR (type_of_par1 = RANGE) THEN ! lse$$save_selected_range (BEGINNING_OF(the_par1), ! END_OF(the_par1)); ! ENDIF ! ! IF (i = 3) THEN ! Copy Text command ! ! ! ! Dont do anything now, Save inserted text after the EXECUTE ! ! ! ENDIF ! ! IF (i = 4) THEN ! Edit operation - may change the whole buffer ! the_par1 := the_parameter(par1); ! type_of_par1 := get_info (the_par1, "type"); ! IF (type_of_par1 = BUFFER) OR (type_of_par1 = RANGE) THEN ! lse$$save_selected_range (BEGINNING_OF(the_par1), ! END_OF(the_par1)); ! ENDIF; ! ENDIF; ! ! IF (i = 5) THEN ! Erase buffer or range ! the_par1 := the_parameter(par1); ! type_of_par1 := get_info (the_par1, "type"); ! IF (type_of_par1 = BUFFER) OR (type_of_par1 = RANGE) THEN ! lse$$save_deleted_range (BEGINNING_OF(the_par1), ! END_OF(the_par1)); ! ENDIF; ! ENDIF; ! ! IF (i = 6) THEN ! Erase number of characters ! the_par1 := the_parameter(par1); ! type_of_par1 := get_info (the_par1, "type"); ! IF (type_of_par1 = INTEGER) AND (type_of_par1 <> 0) THEN ! start_mark := mark(none, current_buffer, 0, ! get_info(current_buffer, "record_number")); ! end_mark := mark(none, current_buffer, ! get_info(current_buffer, "offset"), ! get_info(current_buffer, "record_number")); ! lse$$save_selected_range (start_mark, end_mark); ! ENDIF; ! ENDIF; !------------------------------------------------------------------------------ ! Changes for UNDOing TPU stuff commented out for NOW !------------------------------------------------------------------------------ lse$$disable_undo_calls (); execute(response); lse$$enable_undo_calls (); lse$$reset_all_undo_bufs; ! ! Since a TPU command just got executed, the UNDO buffers may be in an ! unknown state, so just let the user know that no UNDOes will be possible ! at this point ! !removed in 4.4-2 EVE$MESSAGE (lse$_resetallundobufs); lse$post_command_proc; return true; endprocedure; procedure lse_set_command_language (;command_language) ! !doc_begin ! ! ONE LINE DEFINITION: ! Sets the command language to Portable or VMSLSE. ! ! DESCRIPTION: ! (SET COMMAND LANGUAGE) ! The parameter keywords (Portable) and (PLSE) enable the ! portable parser. The parameter keywords (VMSLSE) and ! (LSE) enable the OpenVMS Command Language Interpreter (CLI) ! parser. ! ! RELATED COMMANDS: ! SHOW ATTRIBUTES ! ! CATEGORY: ! Tailor ! !doc_end ! local response; on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_command_language"); endon_error; IF lse$prompt_list( command_language, response, '', lse$_cmdlngdelimit, lse$_cmdlnglist, false, '', lse$_cmdlngdef ) THEN CASE response [lse$$k_cmdlng_vmslse, lse$$k_cmdlng_lse]: if eve$x_ultrix_active then eve$message(tpu$_requiresvms) else set (lse$cli_parser, lse$system, 1 ); if get_info ('LSE', 'lse$language_type') <> TPU$K_UNSPECIFIED then set (lse$language, lse$prompt_buffer, 'LSE'); set (lse$language, lse$command_buffer, 'LSE'); endif; endif; [lse$$k_cmdlng_portable, lse$$k_cmdlng_plse]: set (lse$cli_parser, lse$system, 0 ); if get_info ('PLSE', 'lse$language_type') <> TPU$K_UNSPECIFIED then set (lse$language, lse$prompt_buffer, 'PLSE'); set (lse$language, lse$command_buffer, 'PLSE'); endif; [OTHERWISE]: EVE$MESSAGE( lse$_internerr, 0, 'lse_set_command_language' ); eve$learn_abort; lse$post_command_proc; RETURN false; ENDCASE; lse_set_command_language := true; lse$$x_ugly_set_command_language_executed_flag := true; else lse_set_command_language := false; endif; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_execute_buffer_lse(;buffer_name); ! ! Executes editor commands from the indicated buffer. Default is to use ! the current buffer. The commands may be either CLI-grammar or the ! portable LSE grammar; the editor uses whichever parser is currently set. ! The parser may be changed inside the script using any of the following ! techniques: ! ! SET COMMAND LANGAGE VMSLSE ! Use the CLI parser for all further commands. ! This command is valid in both grammars. ! ! SET CLI PARSER PORTABLE ! Use the portable (LSE) grammar for all further commands. ! This command is valid in both grammars. ! ! LSE command ! "command" is taken to be an LSE command, no matter what the current ! parser setting. The "LSE" command is valid in both grammars. ! ! Therefore, OpenVMS users who wish to continue using old CLI command scipts ! should place "SET COMMAND LANGAGE VMSLSE" as the first line of the script. ! This will cause the commands to be executed as CLI, regardless of which ! parser the user happened to have set at the time. ! ! Likewise, scripts written using LSE-grammar commands should either have ! "SET COMMAND LANGAGE PORTABLE" as their first line, or else each line should be ! preceeded with the "LSE" command. ! ! Parser settings changed in a command-script are only in effect in ! in the scope of the command-script. When the script is finished, the ! user's parser setting is restored. ! ! CLI referece: ! This command is equivalent to the following CLI commands: ! DO, DO/LSE, DO/BUFFER=name, DO/LSE/BUFFER, and DO/LSE/BUFFER=name. ! ! Other usage scenarios: ! ! LSE> SET COMMAND LANGAGE VMSLSE ! LSE> DO/BUFFER=foo.bar ! Execute CLI commands from buffer foo.bar (CLI is current parser) ! LSE> LSE EXECUTE BUFFER LSE fee.fie ! Execute LSE commands from buffer fee.fie (the LSE command "distributes") ! LSE> SET COMMAND LANGAGE PORTABLE ! LSE> EXECUTE BUFFER LSE foe.fum ! Execute LSE commands from buffer foe.fum (LSE is now current parser) ! ! Return Status: ! TRUE if buffer executed with no errors. FALSE otherwise. ! !doc_begin ! ! ONE LINE DEFINITION: ! Directs LSE to execute LSE commands from a buffer. ! ! DESCRIPTION: ! (EXECUTE BUFFER LSE) ! LSE interprets the commands based on the command language that is ! currently established in the editing session. If a command is ! executed that changes the current command language, the remaining ! commands are interpreted using the new command language setting. ! The new command language setting will remain in effect when the ! script has finished executing. ! ! RELATED COMMANDS: ! EXECUTE BUFFER TPU ! EXECUTE BUFFER PLSE ! SET COMMAND LANGUAGE ! ! CATEGORY: ! Tailor ! !doc_end ! local cur_mark, saved_mod, buffer_ptr, the_line, the_command, num_of_lines, line_num; on_error [TPU$_EXECUTEFAIL, ! note: these are NOT fatal...continue the loop. TPU$_COMPILEFAIL]: eve$message(lse$_errorline,0, line_num, "buffer", get_info (buffer_ptr,"name")); lse_execute_buffer_lse := FALSE; [OTHERWISE]: if current_buffer = buffer_ptr ! If we are in the cmd-buffer then lse$$pop_position; ! restore position to user's buffer. endif; lse_execute_buffer_lse := FALSE; if get_info( saved_mod, 'type' ) = string then set (modifiable, buffer_ptr, int(saved_mod)); endif; lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_execute_buffer_lse"); endon_error; if not lse$prompt_existing_buffer(buffer_name, buffer_ptr, '', '', current_buffer) then lse$post_command_proc; return FALSE; endif; num_of_lines := get_info (buffer_ptr, "record_count"); saved_mod := str( get_info (buffer_ptr, "modifiable") ); set (modifiable, buffer_ptr, off); line_num := 1; cur_mark := buffer_begin; the_command := ""; lse_execute_buffer_lse := TRUE; ! return TRUE if no error loop exitif (line_num > num_of_lines); lse$$push_position; ! get a line from the cmd-buffer position (buffer_ptr); position (cur_mark); the_line := current_line; move_vertical( 1 ); cur_mark := mark( none ); lse$$pop_position; ! Send the_command to either the CLI or the new parser, ! whichever is currently set. We check each time because ! the parser may be changed during execution. ! ! If parser is CLI, just pass the line because CLI does ! its own continuation-line processing. if get_info (lse$system, "lse$cli_parser") = TRUE then ! Refer to lse$$bif_do_command for these magic status codes ! case lse$do_command(the_line) [0]: ! syntax error - print traceback but do not halt execution eve$message(lse$_errorline,0, line_num, "buffer", get_info (buffer_ptr,"name")); lse_execute_buffer_lse := FALSE; [3]: ! CONTINUE command - halt execution exitif; [8]: ! CONTROL C - halt execution lse_execute_buffer_lse := FALSE; exitif; [OTHERWISE]: ! normal endcase; else if lse$is_continuation_line(the_line) = FALSE then the_command := the_command + the_line; ! complete command execute (eve$$parse(the_command)); ! do it the_command := ""; ! re-init accumulator else ! append line and strip continuation char the_command := the_command + substr (the_line, 1, length (the_line)-1); endif; endif; line_num := line_num + 1; endloop; set (modifiable, buffer_ptr, int(saved_mod)); lse$post_command_proc; endprocedure; procedure lse_execute_buffer_plse(;buffer_name); !doc_begin ! ! ONE LINE DEFINITION: ! Directs LSE to execute LSE commands from a buffer. ! ! DESCRIPTION: ! (EXECUTE BUFFER PLSE) ! LSE interprets the commands based on the command language that is ! currently established in the editing session. If a command is ! executed that changes the current command language, the remaining ! commands are interpreted using the new command language setting. ! The new command language setting will remain in effect when the ! script has finished executing. ! ! RELATED COMMANDS: ! EXECUTE BUFFER TPU ! SET COMMAND LANGUAGE ! ! CATEGORY: ! Tailor ! !doc_end ! on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_execute_buffer_plse"); endon_error; lse_execute_buffer_plse := lse_execute_buffer_lse (buffer_name); lse$post_command_proc; endprocedure; procedure lse_execute_buffer_tpu(;buffer_name) ! ! old grammar = DO/BUFFER/TPU ! !doc_begin ! ONE LINE DEFINITION: ! Directs LSE to execute text processing utility (TPU) program ! statements from a buffer. ! DESCRIPTION: ! (EXECUTE BUFFER TPU) ! ! RELATED COMMANDS: ! EXECUTE BUFFER PLSE ! ! CATEGORY: ! Tailor ! !doc_end ! local buffer_ptr; ! ! Because we are issuing a TPU EXECUTE builtin which does both a compilation ! and an execution, many different errors can occur. ! on_error [TPU$_EXECUTEFAIL, TPU$_CONTROLC]: lse$$enable_undo_calls (); lse$$reset_all_undo_bufs; lse$post_command_proc; eve$learn_abort; return false; [OTHERWISE]: lse$$enable_undo_calls (); lse$$reset_all_undo_bufs; eve$message (ERROR_TEXT); lse$post_command_proc; eve$learn_abort; return false; endon_error; if not lse$prompt_existing_buffer(buffer_name, buffer_ptr, '', '', current_buffer) then lse$post_command_proc; RETURN false endif; lse$$disable_undo_calls (); execute(buffer_ptr); lse$$enable_undo_calls (); lse$$reset_all_undo_bufs; ! ! Since a TPU command just got executed, the UNDO buffers may be in an ! unknown state, so just let the user know that no UNDOes will be possible ! at this point ! !removed in 4.4-2 EVE$MESSAGE (lse$_resetallundobufs); endprocedure; procedure lse_show_buffer (;buffer_name_wild) ! !doc_begin ! ! ONE LINE DEFINITION: ! Displays information about the indicated buffer or user buffers. ! ! DESCRIPTION: ! (SHOW BUFFER) ! LSE displays full information for one buffer and brief information ! for multiple user buffers. If you do not specify a buffer name, LSE ! displays information for the current buffer. ! ! ! Refer to Appendix(wildcard_app) for a list of OpenVMS- and ULTRIX-style ! wildcard characters. ! LSE creates a buffer list that contains brief information, including ! the name of each buffer, ! the number of lines in the buffer, whether the buffer is a user or ! system buffer, and buffer status information. The buffer status ! information tells whether a buffer is modified, compiled, reviewed, ! or modifiable for all buffers. ! ! !

! Ctrl/F key and Ctrl/B let you move through the list of ! buffers, and the E3 key (Remove key) deletes a buffer. The EXPAND command ! displays full information for the indicated buffer and the COLLAPSE ! command displays brief information. From the list of buffers, ! you can go to a particular buffer using the GOTO SOURCE command. ! ! ! RELATED COMMANDS: ! EXPAND ! COLLAPSE ! GOTO SOURCE ! NEW BUFFER ! SET BUFFER commands ! ! CATEGORY: ! File ! !doc_end ! LOCAL buffer_ptr, response, status; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_show_buffer "); ENDON_ERROR; if not lse$prompt_show_buffer( buffer_name_wild, response ) then lse$post_command_proc; RETURN false; endif; lse_show_buffer := lse$shlst_process( response, lse$buffer_list ); ! Check for list of buffers ! lse$$push_position; POSITION( BUFFER_BEGIN ); IF current_line = lse$$get_buffer_list_header THEN ! We have a buffer list. So remove the system buffers ! ! Find the dividing line ! POSITION( BUFFER_END ); POSITION( SEARCH_QUIETLY( LINE_BEGIN + LINE_END, REVERSE ) ); ! Erase the user buffers ! IF GET_INFO( MARK( NONE ), 'record_number' ) > 3 THEN ! There are some system buffers in the list ! SET( MODIFIABLE, CURRENT_BUFFER, ON ); ERASE( CREATE_RANGE( MARK( NONE ), BUFFER_END, NONE ) ); SET( MODIFIABLE, CURRENT_BUFFER, OFF ); ENDIF; ENDIF; lse$$pop_position; lse$post_command_proc; endprocedure; procedure lse_show_system_buffer (;buffer_name_wild) ! !doc_begin ! ! ONE LINE DEFINITION: ! Displays information about the indicated buffer(s). ! ! DESCRIPTION: ! (SHOW SYSTEM BUFFER) ! Behaves just like SHOW BUFFER except system buffers are displayed in ! the multiple buffer case. ! ! RELATED COMMANDS: ! SET BUFFER commands ! GOTO SOURCE ! SHOW BUFFER ! ! CATEGORY: ! File ! !doc_end ! LOCAL response, saved_mark; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_show_system_buffers"); ENDON_ERROR; if not lse$prompt_show_buffer( buffer_name_wild, response ) then lse$post_command_proc; RETURN false; endif; lse_show_system_buffer := lse$shlst_process( response, lse$buffer_list ); ! Check for list of buffers ! lse$$push_position; POSITION( BUFFER_BEGIN ); IF current_line = lse$$get_buffer_list_header THEN ! We have a buffer list. So remove the user buffers ! ! Mark the first user buffer line ! MOVE_VERTICAL( 2 ); saved_mark := MARK( NONE ); ! Find the dividing line ! POSITION( BUFFER_END ); POSITION( SEARCH_QUIETLY( LINE_BEGIN + LINE_END, REVERSE ) ); ! Erase the user buffers ! IF GET_INFO( MARK( NONE ), 'record_number' ) > 2 THEN ! There are some system buffers in the list ! SET( MODIFIABLE, CURRENT_BUFFER, ON ); ERASE( CREATE_RANGE( SAVED_MARK, MARK( NONE ), NONE ) ); SET( MODIFIABLE, CURRENT_BUFFER, OFF ); ELSE EVE$MESSAGE( lse$_nosysbuf, 0 ); ENDIF; ENDIF; lse$$pop_position; lse$post_command_proc; endprocedure; procedure lse_goto_command (;lse_command) ! !doc_begin ! ! ONE LINE DEFINITION: ! Displays the LSE> prompt. ! ! DESCRIPTION: ! (GOTO COMMAND) ! When you specify this command and supply an LSE ! command as its argument, LSE parses and executes that command. If you ! do not specify a command name, LSE displays the LSE> prompt ! in the command region for you to specify a command. ! ! CATEGORY: ! Editing ! !doc_end ! LOCAL response; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_goto_command "); ENDON_ERROR; IF lse$prompt_string(lse_command, response, '', , '') THEN IF response = '' THEN IF (get_info (lse$system, "lse$cli_parser")) AND (lse$$x_use_keypad = lse$$k_pkeypad_vmslse) THEN ! LSE V3.1 compatibility ! eve_do( '' ); ELSE lse$$x_sticky_command_prompt := false; MAP( lse$command_window, lse$command_buffer_display ); lse$$prompt_copy_command_prompt; ENDIF; ELSE response := eve$$parse( response ); IF response <> '' THEN EXECUTE( response ); ENDIF; ENDIF; ENDIF; endprocedure; procedure lse_help(;help_topic_wild) ! ! NOTE: This procedure must only have one paramater, otherwise commands like ! HELP NEXT CHARACTER get spread over all the parameters. i.e. ! LSE_HELP( "NEXT", "CHARACTER" ) ! !doc_begin ! ! ONE LINE DEFINITION: ! Displays information about LSE commands and topics. ! ! DESCRIPTION: ! (HELP) ! The HELP command also displays help from user-defined help libraries ! associated with an enabled grammar prefix. ! ! RELATED COMMANDS: ! SHOW ATTRIBUTES ! HELP INDICATED ! HELP KEYPAD ! ENABLE GRAMMAR PREFIX ! ! EXAMPLE: ! In this example, LSE retrieves all help topics and commands ! that contain the string "token": ! ! ! LSE> HELP *token* ! ! ! CATEGORY: ! Help ! !doc_end ! LOCAL try, nohelp, library, the_topic, tokens, topic_spec, print_prefix, prefix_spec, prefix_index, the_prefix; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error(ERROR, ERROR_TEXT, ERROR_LINE, "lse_help"); ENDON_ERROR; if not lse$prompt_string(help_topic_wild, tokens, lse$_topicprompt, lse$_nohlptopic, lse$get_message_text (lse$_hlptopicdeflt)) then lse$post_command_proc; return false; endif; ! Don't prompt for a prefix. ! If unspecified, just default to "*" ! if lse$$x_help_prefix = tpu$k_unspecified then prefix_spec := "*"; ! match all print_prefix := FALSE; ! but don't show prefixes in output else ! lse$$x_help_prefix is a "hook" that allows a user to search ! more than one HELP library for topics. We initially passed ! this in as a second parameter to LSE_HELP, but discovered that ! this is incompatible with the command parser. If LSE_HELP has ! a second parameter, a request like LSE> HELP NEXT CHARACTER ! is parsed as LSE_HELP("NEXT", "CHARACTER") instead of the ! desired LSE_HELP("NEXT CHARACTER"). ! ! lse$$x_help_prefix indicates the desired prefixes you want help ! on. It may contain wildcards. For example, "*" says to search all ! libraries. A prefix of s* would search for libraries associated ! with prefixes "sys_", "saa_" etc., for example. ! prefix_spec := lse$$x_help_prefix; ! match user's prefix (may have wildcards) print_prefix := TRUE; ! and show ones that matched endif; lse_help := TRUE; ! return TRUE unless something goes wrong ! Get the command topic based on the tokens entered by the user. ! eve$$x_state_array {eve$$k_help_active} := 1; topic_spec := eve$$parse (tokens); eve$$x_state_array {eve$$k_help_active} := 0; ! Abort this help if prompt-list (an ambiguous parse) was aborted by user. ! Do it before SHOW window is set up so we won't display an empty window. ! ! The string "return" is a krock interface that says the user went to the ! bottom of a ambiguous prompt and hit return, and thus no response. ! if (topic_spec = '') OR (topic_spec = 'return') then if eve$$x_state_array {eve$$k_ambiguous_parse} = 1 then return false; endif; endif; ! Set up windows ! lse$$setup_show_window(eve$x_buf_str_help); if topic_spec = '' then ! Tokens didn't parse; use the original string. ! It either: ! a) is a non-command topic ! b) contains wildcards ! c) is bogus ! topic_spec := tokens; ! Search all matching help libraries for desired topics ! try := 0; nohelp := 0; the_prefix := get_info (lse$$x_prefix_name, "last"); loop exitif the_prefix = tpu$k_unspecified; ! Does this grammar prefix match user's spec? ! if lse$$strmatch_wild(the_prefix, prefix_spec) then library := eve$get_help_item (eve$k_help_library, the_prefix); if library <> '' then try := try + 1; if print_prefix = TRUE then lse$$help_message(current_buffer, fao (lse$get_message_text (lse$_grpfix), the_prefix)); position (BUFFER_END); endif; if not lse$help_text(library, topic_spec, off, current_buffer) then ! Print all error messages returned, but trap all ! "no help topic" messages until the very end. ! nohelp := nohelp + 1; if lse$$x_help_message_text <> lse$get_message_text(lse$_nohelpavail) then lse$$help_message(current_buffer, lse$$x_help_message_text); lse_help := FALSE; endif; endif; endif; endif; the_prefix := get_info (lse$$x_prefix_name, "previous"); endloop; ! If all we got was a bunch of "no help" and/or errors, ! print "no help" message once. ! if try = nohelp then lse$$help_message(current_buffer, lse$get_message_text(lse$_nohelpavail)); lse_help := FALSE; endif; else ! Tokens parsed. "topic" is the name of a command ! in one of the enabled grammars. ! prefix_index := lse$$grammar_prefix (topic_spec, lse$$k_prefix_begins); the_prefix := lse$$x_prefix_stack {prefix_index}; the_topic := topic_spec - the_prefix; library := eve$get_help_item (eve$k_help_library, the_prefix); if library = '' then lse$$help_message(current_buffer, lse$get_message_text(lse$_nohelpavail)); lse_help := FALSE; else if print_prefix = TRUE then lse$$help_message(current_buffer, fao (lse$get_message_text (lse$_grpfix), the_prefix)); endif; if not lse$help_text(library, the_topic, off, current_buffer) then lse$$help_message(current_buffer, lse$$x_help_message_text); lse_help := FALSE; endif; endif; endif; position (BUFFER_BEGIN); lse$$finish_show_window(); lse$post_command_proc; endprocedure; procedure lse_help_keypad ! !doc_begin ! ! ONE LINE DEFINITION: ! Displays help on the key binding for the keypad. ! ! DESCRIPTION: ! (HELP KEYPAD) ! This command builds the keypad diagram by using legends ! specified with the (legend) parameter of the ! NEW KEY command. ! ! RELATED COMMANDS: ! HELP ! HELP INDICATED ! ! CATEGORY: ! Help ! !doc_end ! ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_help_keypad "); ENDON_ERROR help_buffer := lse$$setup_show_window("$help_keypad"); eve$draw_keypad (eve$current_key_map_list); position (help_buffer); ! formatting - makes output look better position (BUFFER_END); split_line; ! ! Shift the keypad drawing to the left so it will fit in 80 columns ! lse_select_all; ! select all text lse$indent(left); lse_select; ! cancel selection lse$$finish_show_window; lse$post_command_proc; return (TRUE); endprocedure; procedure lse_find_occurrences ! ! ****NOTE**** When full integration is restored add (;symbol_name) above ! and remove it from the LOCAL list ! !doc_begin ! ! ONE LINE DEFINITION: ! Sends a message to the cross-reference server, asking the server to ! display the occurences of the indicated symbol. ! DESCRIPTION: ! (FIND OCCURRENCES) ! ! RELATED COMMANDS: ! GOTO DECLARATION ! ENABLE VMS INTEGRATION COMMANDS ! DISABLE VMS INTEGRATION COMMANDS ! ! CATEGORY: ! Cross ! !doc_end ! LOCAL default_symbol, junk, orig_file, orig_line, prompt, response, symbol_name, the_column; ON_ERROR [TPU$_NOGBLSELOWNER, TPU$_NOGBLSELDATA]: eve$message( lse$_nosca ); lse$post_command_proc; RETURN false; [LSE$_NOTONID]: ! Special trap for no current ID. Just continues. [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_find_occurrences"); ENDON_ERROR; !If LSE's operating with the integrated environment, use ACAS ! integration; otherwise, use global select integration method. ! IF GET_INFO( lse$system, 'lse$integrated' ) > 0 THEN ! Decide on the default and prompt ! ! If there is no language, there is no default ! If there is a language but no current identifier, there is no default ! Otherwise there is a default. ! ! Where there is a default, there is no prompt ! orig_file := tpu$k_unspecified; orig_line := tpu$k_unspecified; the_column := tpu$k_unspecified; IF GET_INFO( CURRENT_BUFFER, 'lse$language' ) = 0 THEN prompt := lse$get_message_text( lse$_symbolprompt ); default_symbol := ''; ELSE default_symbol := LSE$$RESPOND_GLOBAL_SELECT( '_DEC_WORD' ); IF default_symbol = '' THEN prompt := lse$get_message_text( lse$_symbolprompt ); ELSE prompt := ''; orig_line := GET_INFO( MARK( NONE ), 'lse$original_line_number' ); lse$$push_position; POSITION(BEGINNING_OF(SEARCH_QUIETLY(default_symbol,REVERSE,EXACT))); the_column:= GET_INFO( MARK( NONE ), 'offset' ) + 1; lse$$pop_position; orig_file := GET_INFO( CURRENT_BUFFER, 'lse$original_file_name' ); IF orig_file = TPU$K_UNSPECIFIED THEN orig_file := GET_INFO( CURRENT_BUFFER, 'file_name' ); ENDIF; ENDIF; ENDIF; if lse$prompt_string ( symbol_name, response, prompt, '', default_symbol) then ! Use ACAS messages ! lse_find_occurrences := lse$find_occurrences( response, orig_file, orig_line, the_column ); else lse_find_occurrences := false; endif; ELSE ! Use DECwindows selection ! IF eve$x_decwindows_active THEN IF LSE$$RESPOND_GLOBAL_SELECT( '_DEC_WORD' ) = '' THEN eve$message( lse$_notonid ); lse_find_occurrences := FALSE; ELSE SET( GLOBAL_SELECT, SCREEN, PRIMARY ); junk := GET_GLOBAL_SELECT( "_DEC_SCA_DoSomething", "_DEC_SCA_FindThisCode"); lse_find_occurrences := TRUE; ENDIF; ELSE eve$message( lse$_nocrfmsg ); lse_find_occurrences := FALSE; ENDIF; ENDIF; lse$post_command_proc; endprocedure; procedure lse_goto_declaration ! ! ****NOTE**** When full integration is restored add (;symbol_name) above ! and remove it from the LOCAL list ! !doc_begin ! ! ONE LINE DEFINITION: ! Displays the source for the primary declaration of a symbol. ! ! DESCRIPTION: ! (GOTO DECLARATION) ! This commmand sends a message to the cross-reference server, asking ! the server to display the source for the primary declaration of the ! indicated symbol. ! A primary declaration is the declaration interpreted as the most ! significant for a symbol. For ! example, the primary declaration of a routine describes the body ! of the routine. ! ! RELATED COMMANDS: ! FIND OCCURRENCES ! ENABLE VMS INTEGRATION COMMANDS ! DISABLE VMS INTEGRATION COMMANDS ! ! CATEGORY: ! Cross ! !doc_end LOCAL default_symbol, junk, orig_file, orig_line, prompt, response, symbol_name, the_column; ON_ERROR [TPU$_NOGBLSELOWNER, TPU$_NOGBLSELDATA]: eve$message( lse$_nosca ); lse$post_command_proc; RETURN false; [LSE$_NOTONID]: ! Special trap for no current ID. Just continues. [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_goto_declaration"); ENDON_ERROR; !If LSE's operating with the integrated environment, use ACAS ! integration; otherwise, use global select integration method. ! IF GET_INFO( lse$system, 'lse$integrated' ) > 0 THEN ! Decide on the default and prompt ! ! If there is no language, there is no default ! If there is a language but no current identifier, there is no default ! Otherwise there is a default. ! ! When there is a default, there is no prompt ! orig_file := tpu$k_unspecified; orig_line := tpu$k_unspecified; the_column := tpu$k_unspecified; IF GET_INFO( CURRENT_BUFFER, 'lse$language' ) = 0 THEN prompt := lse$get_message_text( lse$_symbolprompt ); default_symbol := ''; ELSE default_symbol := LSE$$RESPOND_GLOBAL_SELECT( '_DEC_WORD' ); IF default_symbol = '' THEN prompt := lse$get_message_text( lse$_symbolprompt ); ELSE prompt := ''; orig_line := GET_INFO( MARK( NONE ), 'lse$original_line_number' ); lse$$push_position; POSITION(BEGINNING_OF(SEARCH_QUIETLY(default_symbol,REVERSE,EXACT))); the_column:= GET_INFO( MARK( NONE ), 'offset' ) + 1; lse$$pop_position; orig_file := GET_INFO( CURRENT_BUFFER, 'lse$original_file_name' ); IF orig_file = TPU$K_UNSPECIFIED THEN orig_file := GET_INFO( CURRENT_BUFFER, 'file_name' ); ENDIF; ENDIF; ENDIF; if lse$prompt_string ( symbol_name, response, prompt, '', default_symbol ) then lse_goto_declaration := lse$goto_declaration( response, orig_file, orig_line, the_column ); else lse_goto_declaration := false; endif; ELSE ! Use DECwindows selection ! IF eve$x_decwindows_active THEN IF LSE$$RESPOND_GLOBAL_SELECT( '_DEC_WORD' ) = '' THEN eve$message( lse$_notonid ); lse_goto_declaration := FALSE; ELSE SET( GLOBAL_SELECT, SCREEN, PRIMARY ); junk := GET_GLOBAL_SELECT( "_DEC_SCA_DoSomething", "_DEC_SCA_ShowThisDeclaration" ); lse_goto_declaration := TRUE; ENDIF; ELSE eve$message( lse$_nocrfmsg ); lse_goto_declaration := FALSE; ENDIF; ENDIF; lse$post_command_proc; endprocedure; procedure lse_help_indicated ! !doc_begin ! ! ONE LINE DEFINITION: ! Displays the help text associated with the current token, placeholder, ! or routine. ! ! DESCRIPTION: ! (HELP INDICATED) ! The help text comes from the HELP library associated with the specified ! language or package for which the token, placeholder, routine, or ! parameter is defined. ! (Use the following text for defining templates.) ! ! LSE forms a topic string by concatenating the ! topic string parameter associated with the language or package followed ! by the indicated token, placeholder, or entry name. LSE then searches for ! the topic in the HELP library. ! ! ! RELATED COMMANDS: ! HELP ! HELP KEYPAD ! SET LANGUAGE HELP LIBRARY ! SET LANGUAGE HELP TOPIC ! ! CATEGORY: ! Help ! !doc_end ! LOCAL the_lang_name, topic_array, library_array, count, i; ON_ERROR [LSE$_NOHELP, LSE$_NOTIDPLCH, LSE$_NOLANG, TPU$_OPENIN]: lse$delete_created_show_window; eve$message (error_text); lse$post_command_proc; return false; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_help_indicated"); ENDON_ERROR; ! Get the topics and libraries for this position. If there is no help or if ! the buffer is not assocated with a language, the error handler is taken. ! count := lse$get_help_indicated (topic_array, library_array); ! The default help library name is "the_lang_name.hlp" ! the_lang_name := get_info (get_info (current_buffer, "lse$language_type"), "lse$name"); edit (the_lang_name, LOWER); ! Setup the help output window ! lse$$setup_show_window (eve$x_buf_str_help); ! Loop through each array entry, putting the help in the current buffer. ! i := 0; loop exitif i = count; if eve$x_ultrix_active then library_array{i} := file_parse (library_array{i}, the_lang_name, ".hlp"); else if library_array{i} = "" then library_array{i} := lse$k_default_lib; endif; endif; exitif not lse$help_text(library_array{i}, topic_array{i}, off, current_buffer); i := i + 1; if i < count ! separate multiple topics then copy_text (ascii (12)); ! with a form-feed endif; endloop; ! We are done with showing the help ! lse$$finish_show_window(); ! We are done with the routine ! lse$post_command_proc; return true; endprocedure; procedure lse_close_file( ;file_spec ) ! ! Just like LSE_CLOSE_BUFFER except it takes a file name ! Unique wildcard match required ! !doc_begin ! ! ONE LINE DEFINITION: ! Writes a file and deletes the associated buffer. ! ! DESCRIPTION: ! (CLOSE FILE) ! If the buffer associated with the specified file is writable and ! has been modified, LSE writes the file out. It then deletes the ! buffer. ! ! RELATED COMMANDS: ! CLOSE ! SAVE FILE ! SAVE AS ! SET BUFFER CLOSE ! ! CATEGORY: ! File ! !doc_end ! LOCAL count, default_file_name, filename, loop_buffer, out_file, response, chosen_buffer; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_close_file"); ENDON_ERROR; ! Figure out the default ! default_file_name := GET_INFO( current_buffer, 'output_file' ); IF default_file_name = 0 THEN default_file_name := GET_INFO( current_buffer, 'file_name' ); ENDIF; ! Prompt ! IF lse$prompt_string( file_spec, response, "", "", default_file_name ) THEN if response = '' then return LSE_CLOSE_BUFFER; endif; ! Initialize for the buffer walk ! loop_buffer := GET_INFO( BUFFER, 'first' ); filename := FILE_PARSE( response, '', '', NAME, TYPE ); ! Walk all the buffers, looking for a match ! LOOP ! Done ! EXITIF loop_buffer = 0; ! Match ? ! IF lse$$strmatch_wild( FILE_PARSE( GET_INFO( loop_buffer, 'file_name' ), '', '', NAME, TYPE ), filename ) THEN chosen_buffer := loop_buffer; count := count + 1; ELSE out_file := GET_INFO( loop_buffer, 'output_file' ); IF out_file <> 0 THEN IF lse$$strmatch_wild( FILE_PARSE( out_file, '', '', NAME, TYPE ), filename ) THEN chosen_buffer := loop_buffer; count := count + 1; ENDIF; ENDIF; ENDIF; ! Next ! loop_buffer := GET_INFO( BUFFER, 'next' ); ENDLOOP; IF count = 1 THEN ! We found just one buffer so do it ! lse_close_file := lse_close_buffer( chosen_buffer ); ELSE IF count = 0 THEN ! We didn't find it ! eve$message( lse$_cntfndfil, 0, response ); lse_close_file := FALSE; ELSE ! We found multiple ! eve$message( lse$_mulfilfnd, 0, response ); lse_close_file := FALSE; ENDIF; ENDIF; ELSE lse_close_file := FALSE; ENDIF; lse$post_command_proc; endprocedure; procedure lse_fetch (;element_name, element_id, remark) ! !doc_begin ! ! ONE LINE DEFINITION: ! Retrieve the element without causing version changes. ! ! DESCRIPTION: ! (FETCH) ! The element is retrieved from the source repository into the working ! directory and read into a buffer. The element_id parameter allows version ! specification other than the latest. On OpenVMS systems, a remark may be ! recorded. When options or settings are needed beyond those provided, ! use "cli ()". ! ! RELATED COMMANDS: ! UNRESERVE ! REPLACE ! RESERVE ! ENABLE VMS INTEGRATION COMMANDS ! DISABLE VMS INTEGRATION COMMANDS ! ! CATEGORY: ! Repository ! !doc_end ! local remark_response; ON_ERROR [OTHERWISE]: lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, 'lse_fetch'); ENDON_ERROR; IF lse$prompt_string( remark, remark_response, lse$_remarkprompt, '', '' ) THEN lse_fetch := lse$source_control ('fetch', element_name, element_id, remark_response); ELSE lse_fetch := false; ENDIF; lse$post_command_proc; endprocedure; procedure lse_reserve (;element_name, element_id, remark) ! !doc_begin ! ! ONE LINE DEFINITION: ! Retrieve element from the repository for revision. ! ! DESCRIPTION: ! (RESERVE) ! The specified element, (element_id) is retrieved ! from the source control ! area and read into a buffer to edit the next revision. On OpenVMS ! systems, remark ! can be recorded within the element's revision history. When options or ! settings are needed beyond those provided, use "cli ()". ! ! RELATED COMMANDS: ! FETCH ! REPLACE ! UNRESERVE ! ENABLE VMS INTEGRATION COMMANDS ! DISABLE VMS INTEGRATION COMMANDS ! ! CATEGORY: ! Repository ! !doc_end ! local remark_response; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, 'lse_reserve'); ENDON_ERROR; IF lse$prompt_string( remark, remark_response, lse$_remarkprompt, '', '' ) THEN lse_reserve := lse$source_control ('reserve', element_name, element_id, remark_response); ELSE lse_reserve := false; ENDIF; lse$post_command_proc; endprocedure; procedure lse_replace( ;element_name, element_id, remark) ! !doc_begin ! ! ONE LINE DEFINITION: ! Return an element, to its source control area creating a new revision. ! ! DESCRIPTION: ! (REPLACE) ! The buffer containing (element_name) ! is written to the current directory ! then returned to its source control area creating the next version. ! The (element_id) resolves multiple versions of an element. ! When options or settings are needed ! beyond those provided, use "cli ()". ! ! RELATED COMMANDS: ! FETCH ! RESERVE ! UNRESERVE ! ENABLE VMS INTEGRATION COMMANDS ! DISABLE VMS INTEGRATION COMMANDS ! ! CATEGORY: ! Repository ! !doc_end local remark_response; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, 'lse_replace'); ENDON_ERROR; IF lse$prompt_string( remark, remark_response, lse$_remarkprompt, '', '' ) THEN lse_replace := lse$source_control ('replace', element_name, element_id, remark_response); ELSE lse_replace := false; ENDIF; lse$post_command_proc; endprocedure; procedure lse_unreserve( ;element_name, element_id, remark) ! !doc_begin ! ! ONE LINE DEFINITION: ! Cancels a previous reservation of an element. ! ! DESCRIPTION: ! (UNRESERVE) ! Cancels a previous reservation for an element, the ! (element_id), ! and deletes ! the buffer containing the element. When options or settings are needed ! beyond those provided, use "cli ()". ! ! RELATED COMMANDS: ! FETCH ! RESERVE ! REPLACE ! ENABLE VMS INTEGRATION COMMANDS ! DISABLE VMS INTEGRATION COMMANDS ! ! CATEGORY: ! Repository ! !doc_end ! local remark_response; ON_ERROR [OTHERWISE]: lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE,'lse_unreserve'); ENDON_ERROR; IF lse$prompt_string( remark, remark_response, lse$_remarkprompt, '', '' ) THEN lse_unreserve := lse$source_control ('unreserve', element_name, element_id, remark_response); ELSE lse_unreserve := false; ENDIF; lse$post_command_proc; endprocedure; procedure lse$source_control (cmd ;element_name, element_id, remark) ! ! Work routine for fetch, reserve, replace, unreserve. ! Issues cms commands for vms, sccs commands for ultrix. ! LOCAL the_element, the_file, the_remark, icmd; ON_ERROR [OTHERWISE]: lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, 'lse$source_control'); ENDON_ERROR; if lse$get_element_name (element_name, the_element) then if eve$x_ultrix_active then ! ! SCCS ! Note: the_element is the s-file spec ! case cmd ['fetch']: icmd := 'get'; ['reserve']: icmd := 'get -e'; ['replace']: icmd := 'delta'; ['unreserve']: icmd := 'unget'; endcase; if lse$$specified (element_id) then icmd := icmd + ' -r' + element_id; endif; ! -y prevents prompting if (cmd = 'replace') then icmd := icmd + ' -y'; if lse$$specified (remark) then icmd := icmd + '"' + remark + '"'; endif; endif; icmd := icmd + ' ' + the_element; the_file := file_parse( the_element, '', '', name, type ) - 's.'; else ! ! CMS ! icmd := 'cms ' + cmd; if lse$$specified (element_id) then icmd := icmd + '/generation=' + element_id; endif; icmd := icmd + ' ' + the_element; if lse$$specified (remark) then icmd := icmd + ' "' + remark + '"'; endif; the_file := the_element; endif; ! ! Source Control Operations ! ! Write the file before replace operations if cmd = 'replace' then lse_save_file (the_file); endif; ! Source Control Command lse_cli (icmd); ! After fetch, reserve, read file into buffer if (cmd = 'fetch') or (cmd = 'reserve') then lse_open_file (the_file); endif; ! After replace or unreserve, delete the buffer if (cmd = 'replace') or (cmd = 'unreserve') then lse_delete_buffer (the_file); endif; ! lse$key_split_or_one_window; endif; return true; ! until cli returns command status... endprocedure; ! Get element name for repository access procedure lse$get_element_name (element_name, the_element) local cbname; ! if element_name is good, use it. ! if lse$$specified (element_name) then the_element := element_name; return true; endif; ! use the buffer name ! cbname := get_info (current_buffer, 'name'); if not get_info (current_buffer, 'system') and (edit (cbname, upper) <> eve$x_buf_str_main) then the_element := cbname; ! ! lower case is best guess on ultrix... if eve$x_ultrix_active then the_element := 's.' + edit(cbname, lower); endif; return true; endif; ! ask the user ! if not lse$prompt_string ( tpu$k_unspecified, ! always prompt the_element, ! output element name lse$_elemnameprompt, ! "Element name" prompt lse$_noelemspec, ! "No element specified" tpu$k_unspecified) ! default then return false; endif; return (the_element <> tpu$k_unspecified); endprocedure; procedure lse$$specified (;arg) if (arg <> tpu$k_unspecified) and (arg <> '') then return true; else return false; endif; endprocedure; procedure lse_overview_source ! !doc_begin ! ! Equilivent to VIEW SOURCE 1 ! ! ONE LINE DEFINITION: ! Displays an overview of the buffer. ! ! DESCRIPTION: ! (OVERVIEW SOURCE) ! This command displays the top level of detail for the entire buffer. ! LSE determines the relative level of detail of a line by comparing ! the indentation of the line with the indentation of other lines. ! The editor's treatment of line indentation is influenced by indentation ! adjustment definitions. ! ! RELATED COMMANDS: ! COLLAPSE ! NEW ADJUSTMENT ! SET ADJUSTMENT commands ! NEW LANGUAGE ! SET LANGUAGE commands ! EXPAND ! FOCUS ! SET BUFFER OVERVIEW ! ! CATEGORY: ! Program ! !doc_end ! ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_overview_source"); ENDON_ERROR; lse$$save_inserted_text(); lse$$save_undo_reverse_cmd(5,9999); ret_val := lse_view_source( 1 ); lse$$save_redo_reverse_cmd(6,1); return ret_val; endprocedure; procedure lse_set_prompt_terminator( ;user_key_name, add_remove ) ! !doc_begin ! ! ONE LINE DEFINITION: ! Specifies which key completes a prompt. ! ! DESCRIPTION: ! (SET PROMPT TERMINATOR) ! Using a prompt terminator key, tells LSE you are done supplying input ! and to proceed. The default prompt terminators are ! ENTER, FIND, DO, and RETURN. ! ! RELATED COMMANDS: ! SET PROMPT commands ! SHOW PROMPT ATTRIBUTES ! ! CATEGORY: ! Tailor ! !doc_end ! LOCAL add_flag, tpu_keyname; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_prompt_terminator"); ENDON_ERROR; IF lse$prompt_key( user_key_name, tpu_keyname, lse$_keyprompt) THEN IF lse$prompt_add_remove( add_remove, add_flag, '', '', lse$_langdefaddrmv ) THEN If add_flag THEN lse$$x_prompt_terminator_keys{ tpu_keyname } := true; ELSE DELETE( lse$$x_prompt_terminator_keys{ tpu_keyname } ); ENDIF; lse_set_prompt_terminator := true; ELSE lse_set_prompt_terminator := false; ENDIF; ELSE lse_set_prompt_terminator := false; ENDIF; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_set_prompt_abort( ;user_key_name, add_remove ) ! !doc_begin ! ! ONE LINE DEFINITION: ! Defines keys for aborting a prompt. ! ! DESCRIPTION: ! (SET PROMPT ABORT) ! Using a prompt abort key at any prompt, aborts that prompt and prevents ! the command from executing. ! The default abort keys are Ctrl/C, Ctrl/Z and F10. ! ! RELATED COMMANDS: ! SET PROMPT commands ! SHOW PROMPT ATTRIBUTES ! ! CATEGORY: ! Tailor ! !doc_end ! LOCAL add_flag, tpu_keyname; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_prompt_abort"); ENDON_ERROR; IF lse$prompt_key( user_key_name, tpu_keyname, lse$_keyprompt) THEN IF lse$prompt_add_remove( add_remove, add_flag, '', '', lse$_langdefaddrmv ) THEN If add_flag THEN lse$$x_prompt_abort_keys{ tpu_keyname } := true; ELSE DELETE( lse$$x_prompt_abort_keys{ tpu_keyname } ); ENDIF; lse_set_prompt_abort := true; ELSE lse_set_prompt_abort := false; ENDIF; ELSE lse_set_prompt_abort := false; ENDIF; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_set_prompt_dialog( ;prompt_dialog ) ! !doc_begin ! ! ONE LINE DEFINITION: ! Sets dialog box prompting. ! ! DESCRIPTION: ! (SET PROMPT DIALOG) ! By default, LSE uses message window (character-cell) prompting when ! using keys and ! a dialog box when using the mouse. You can specify the parameter ! value (CCT) to always use message window prompting or ! the parameter value (window) to always use a dialog box. !

! This command is ignored when SET PROMPT KEYPAD is VMSLSE. ! ! RELATED COMMANDS: ! SET PROMPT commands ! SHOW PROMPT ATTRIBUTES ! ! CATEGORY: ! Tailor ! !doc_end ! LOCAL response; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_prompt_dialog"); ENDON_ERROR; IF lse$prompt_list( prompt_dialog, response, lse$_pdialogprompt, lse$_pdialogdelimit, lse$_pdialoglist, false, '', lse$_pdialogdef ) THEN CASE response [lse$$k_pdialog_cct, lse$$k_pdialog_default, lse$$k_pdialog_window]: lse$$x_use_dialog := response; [OTHERWISE]: EVE$MESSAGE( lse$_internerr, 0, 'lse_set_prompt_dialog' ); eve$learn_abort; lse$post_command_proc; RETURN false; ENDCASE; lse_set_prompt_dialog := true; ELSE lse_set_prompt_dialog := false; ENDIF; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_set_prompt_keypad( ;prompt_keypad ) ! ! !doc_begin ! ! ONE LINE DEFINITION: ! Specifies the available key bindings for prompting. ! ! DESCRIPTION: ! (SET PROMPT KEYPAD) ! This command allows you to specify which set of key bindings you want ! available at prompts: VMSLSE style key bindings (compatible with ! LSE Version 3.1), ! the default editing (standard EDT or EVE) key bindings, or user ! customized key bindings as used in your regular editing buffers. !

! When using user-defined or default key bindings, LSE stores responses to ! prompts in a special buffer. The prompt area (at the bottom of ! the screen) is essentially its own special buffer. As such, some keys act ! differently than in VMSLSE key bindings because that style of prompting is ! not implemented as a separate buffer. ! ! RELATED COMMANDS: ! SET PROMPT commands ! SHOW PROMPT ATTRIBUTES ! ! CATEGORY: ! Tailor ! !doc_end ! LOCAL response, temp_key_map; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_prompt_keypad"); ENDON_ERROR; IF lse$prompt_list( prompt_keypad, response, lse$_pkeypadprompt, lse$_pkeypaddelimit, lse$_pkeypadlist, false, '', lse$_pkeypaddef ) THEN CASE response [lse$$k_pkeypad_vmslse]: set( key_map_list, 'LSE$PROMPT_KEY_MAP_LIST', lse$prompt_buffer ); set( key_map_list, 'LSE$PROMPT_KEY_MAP_LIST', lse$prompt_list_buff ); set( key_map_list, 'LSE$COMMAND_KEY_MAP_LIST', lse$command_buffER ); [lse$$k_pkeypad_default]: set( key_map_list, 'LSE$PROMPT_KEY_MAP_LIST', lse$prompt_buffer ); set( key_map_list, 'LSE$PROMPT_KEY_MAP_LIST', lse$prompt_list_buff ); set( key_map_list, 'LSE$COMMAND_KEY_MAP_LIST', lse$command_buffER ); [lse$$k_pkeypad_user]: ! Prompt buffers ! SET( KEY_MAP_LIST, "tpu$key_map_list", lse$prompt_buffer ); SET( KEY_MAP_LIST, "tpu$key_map_list", lse$prompt_list_buff ); ! Command buffer ! ! First remove everything ! LOOP temp_key_map := GET_INFO (KEY_MAP, "first", "LSE$USER_COMMAND_KEY_MAP_LIST"); EXITIF temp_key_map = 0; REMOVE_KEY_MAP( 'LSE$USER_COMMAND_KEY_MAP_LIST', temp_key_map, ALL ); ENDLOOP; ! Add in TPU$KEY_MAP_LIST ! temp_key_map := GET_INFO (KEY_MAP, "first", "TPU$KEY_MAP_LIST"); LOOP EXITIF temp_key_map = 0; ADD_KEY_MAP( 'LSE$USER_COMMAND_KEY_MAP_LIST', "last", temp_key_map ); temp_key_map := GET_INFO (KEY_MAP, "next", "TPU$KEY_MAP_LIST"); ENDLOOP; SET( KEY_MAP_LIST, "LSE$USER_COMMAND_KEY_MAP_LIST", lse$command_buffER ); [OTHERWISE]: EVE$MESSAGE( lse$_internerr, 0, 'lse_set_prompt_keypad' ); eve$learn_abort; lse$post_command_proc; RETURN false; ENDCASE; lse$$x_use_keypad := response; lse_set_prompt_keypad := true; ELSE lse_set_prompt_keypad := false; ENDIF; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_set_prompt_expandmenu( ;prompt_keypad ) ! !doc_begin ! ! ONE LINE DEFINITION: ! Specifies the available key bindings for the expand menu prompt. ! ! DESCRIPTION: ! (SET PROMPT EXPANDMENU) ! This command allows you to specify which set of key bindings you want ! available at the expand menu prompt: VMSLSE style key bindings ! (compatible with LSE Version 3.1), ! the default editing (standard EDT or EVE) key bindings, or user ! customized key bindings as used in your regular editing buffers. ! ! RELATED COMMANDS: ! SET PROMPT commands ! SHOW PROMPT ATTRIBUTES ! ! CATEGORY: ! Tailor ! !doc_end ! LOCAL response, temp_key_map; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_prompt_expandmenu"); ENDON_ERROR; IF lse$prompt_list( prompt_keypad, response, lse$_pkeypadprompt, lse$_pkeypaddelimit, lse$_pkeypadlist, false, '', lse$_pkeypaddef ) THEN CASE response [lse$$k_pkeypad_vmslse, lse$$k_pkeypad_default, lse$$k_pkeypad_user]: [OTHERWISE]: EVE$MESSAGE( lse$_internerr, 0, 'lse_set_prompt_expandmenu' ); eve$learn_abort; lse$post_command_proc; RETURN false; ENDCASE; lse$$x_use_expandmenu := response; lse_set_prompt_expandmenu := true; ELSE lse_set_prompt_expandmenu := false; ENDIF; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_show_prompt_attributes ! ! !doc_begin ! ! ONE LINE DEFINITION: ! Displays the prompt attributes. ! DESCRIPTION: ! (SHOW PROMPT ATTRIBUTES) ! ! RELATED COMMANDS: ! SET PROMPT commands ! ! CATEGORY: ! Help ! !doc_end ! LOCAL response; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_show_prompt_attributes.tpu"); ENDON_ERROR; lse_show_prompt_attributes := lse$show( lse$prompt ); lse$post_command_proc; endprocedure; procedure lse_set_prompt_alterminator( ;user_key_name, add_remove ) ! !doc_begin ! ! ONE LINE DEFINITION: ! Defines keys for terminating a prompt that are executed in only ! in the current buffer. ! ! DESCRIPTION: ! (SET PROMPT ALTERMINATOR) ! The default key binding is KP4, KP5. Simple terminator keys are ! not executed but signal the end of a prompt. ! ! RELATED COMMANDS: ! SET PROMPT commands ! ! CATEGORY: ! Tailor ! !doc_end ! LOCAL add_flag, tpu_keyname; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_prompt_alterminator"); ENDON_ERROR; IF lse$prompt_key( user_key_name, tpu_keyname, lse$_keyprompt) THEN IF lse$prompt_add_remove( add_remove, add_flag, '', '', lse$_langdefaddrmv ) THEN If add_flag THEN lse$$x_prompt_alterminator_keys{ tpu_keyname } := true; lse_set_prompt_terminator( tpu_keyname ); ELSE DELETE( lse$$x_prompt_alterminator_keys{ tpu_keyname } ); lse_set_prompt_terminator( tpu_keyname, 'REMOVE' ); ENDIF; lse_set_prompt_alterminator := true; ELSE lse_set_prompt_alterminator := false; ENDIF; ELSE lse_set_prompt_alterminator := false; ENDIF; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_help_key(;user_key_name) ! !doc_begin ! ! ONE LINE DEFINITION: ! Displays help information for the indicated key. ! ! DESCRIPTION: ! (HELP KEY) ! The help text describes the functionality bound to that key. ! If you enter HELP KEY CTRL/E, for example, you get the help text ! for the EXPAND command. ! ! RELATED COMMANDS: ! HELP ! HELP KEYPAD ! HELP INDICATED ! SET LANGUAGE HELP LIBRARY ! SET LANGUAGE HELP TOPIC ! ! CATEGORY: ! Help ! !doc_end ! LOCAL cmd, comm, legend, remark, response, topic; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_help_key"); ENDON_ERROR; if lse$prompt_key(user_key_name, response, lse$_keyprompt) then comm:= lookup_key(response, COMMENT); lse$$decode_key_comment(comm, topic, legend, remark, cmd); if topic = "" then message(lse$_nohelpkey); return(false) else lse_help(topic); return(true) endif else return(false) endif; endprocedure; ! !doc_begin ! ! ONE LINE DEFINITION: ! Accepts keypad and function keys to enter a control code or other ! character as text in the current buffer. ! ! DESCRIPTION: ! (QUOTE KEYNAME) ! For more information, see the QUOTE command. ! ! RELATED COMMANDS: ! QUOTE ! CATEGORY: ! Text ! !doc_end ! procedure lse_quote_keyname LOCAL the_key; ON_ERROR [TPU$_NOTMODIFIABLE]: eve$message (ERROR_TEXT); lse$post_command_proc; eve$learn_abort; return false; [TPU$_READABORTED]: eve$message (ERROR_TEXT); eve$message (lse$_operationabort); lse$post_command_proc; eve$learn_abort; return false; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_quote_keyname"); ENDON_ERROR; the_key := read_key; copy_text (str (eve$key_name (the_key))); lse$post_command_proc; endprocedure; procedure lse_set_menu_mnemonics (;boolean) ! !doc_begin ! ! ONE LINE DEFINITION: ! Sets the menu mnemonics on or off. ! ! DESCRIPTION: ! (SET MENU MNEMONICS) ! The parameter value (off) allows ! all Alt key combinations to be used, since mnemonics consume some Alt key ! combinations. The new menu mnemonics state ! will not take effect until you enter a SAVE SECTION command and ! invoke LSE with that new section file. ! ! RELATED COMMANDS: ! NEW MENU commands ! DELETE MENU commands ! SET MENU commands ! SAVE SECTION ! ! CATEGORY: ! Tailor ! !doc_end ! local the_response; on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_menu_mnemonics"); return false; endon_error; if lse$prompt_boolean( boolean, the_response, lse$_menumnemprompt, '', lse$_menumnemdef) then set (lse$menu_mnemonics, lse$system, the_response); lse_set_menu_mnemonics := true; else lse_set_menu_mnemonics := false; endif; eve$message (lse$_newmnemstate); lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_new_menu_label (;menu_label, tpu_command, mnemonic_character) ! !doc_begin ! ! ONE LINE DEFINITION: ! Defines a new menu label that can be added to a pull-down or pop-up ! menu. ! ! DESCRIPTION: ! (NEW MENU LABEL) ! The definition of the label is a text processing utility (TPU) statement ! that is executed ! when a menu entry using this label is selected from a menu. The ! character used as a mnemonic must be a single character that occurs ! within the label name. ! !

! You can use any command from LSE's Portable command language within ! the definition of a menu label. To view a list of all available Portable ! commands, either choose the "On Commands" entry in the Help pull-down menu, ! or enter the command PLSE HELP. To transform a Portable command ! into a TPU procedure, prefix the command with "LSE_" and substitute ! underscores for any spaces. Add parameters within parentheses, ! and separate them with commas. View the existing label definitions in the ! Menus... dialog box for examples. ! !

! On OpenVMS systems, VMSLSE commands may also be used within menu label ! definitions by calling the LSE$DO_COMMAND procedure, with the ! VMSLSE command enclosed within quotes. ! ! RELATED COMMANDS: ! NEW MENU commands ! DELETE MENU commands ! SET MENU commands ! SAVE SECTION ! ! CATEGORY: ! Tailor ! !doc_end ! local label_str, command_str, char_str; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_new_menu_label"); ENDON_ERROR; if lse$prompt_string( menu_label, label_str, lse$_menulabelprompt, "", "") then if lse$prompt_string(tpu_command, command_str, lse$_tpucmdprompt, "", "") then if lse$prompt_string(mnemonic_character, char_str, lse$_mnemonicprompt, "", "") then if label_str = '' then eve$message (lse$_labelnamneeded); lse$post_command_proc; return false; endif; if command_str = '' then eve$message (lse$_tpucodeneeded); lse$post_command_proc; return false; endif; if char_str = '' then char_str := tpu$k_unspecified; endif; return lse$add_pulldown_label (label_str, command_str, char_str); endif; endif; endif; lse$post_command_proc; return false endprocedure; procedure lse_new_menu_entry (;menu_name, menu_label, before_menu_entry) ! !doc_begin ! ! ONE LINE DEFINITION: ! Adds an entry to the specified pull-down menu or pop-up menu. ! ! DESCRIPTION: ! (NEW MENU ENTRY) ! When this entry is selected, the text processing utility (TPU) ! code associated with the menu label will be executed. ! The menu label specified must have already been defined. !

! The new entry will be added to the menu location before the ! specified existing entry; if no existing entry is specified, ! the new entry will be added to the end of the menu. ! ! RELATED COMMANDS: ! NEW MENU commands ! DELETE MENU commands ! SET MENU commands ! SAVE SECTION ! ! CATEGORY: ! Tailor ! !doc_end ! local before_label_str, label_str, menu_str; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_new_menu_entry"); ENDON_ERROR; if lse$prompt_string( menu_name, menu_str, lse$_menunameprompt, "", "") then if lse$prompt_string(menu_label, label_str, lse$_menulabelprompt, "", "") then if lse$prompt_string(before_menu_entry, before_label_str, lse$_befentryprompt, "", "") then if menu_str = '' then eve$message (lse$_menunamneeded); lse$post_command_proc; return false; endif; if label_str = '' then eve$message (lse$_labelnamneeded); lse$post_command_proc; return false; endif; if before_label_str = '' then before_label_str := tpu$k_unspecified; endif; return lse$add_pulldown_entry (menu_str, label_str, before_label_str); endif; endif; endif; lse$post_command_proc; return false endprocedure; procedure lse_new_menu_separator (;menu_name, before_menu_entry) ! !doc_begin ! ! ONE LINE DEFINITION: ! Adds a separator to a pull-down menu or pop-up menu. ! ! DESCRIPTION: ! (NEW MENU SEPARATOR) ! You can specify the name of an existing entry that ! the separator will precede. If you do not specify an ! entry, the separator is added to the bottom of the menu. ! ! RELATED COMMANDS: ! NEW MENU commands ! DELETE MENU commands ! SET MENU commands ! SAVE SECTION ! ! CATEGORY: ! Tailor ! !doc_end ! local menu_str, before_label_str; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_new_menu_separator"); ENDON_ERROR; if lse$prompt_string( menu_name, menu_str, lse$_menunameprompt, "", "") then if lse$prompt_string(before_menu_entry, before_label_str, lse$_befentryprompt, "", "") then if menu_str = '' then eve$message (lse$_menunamneeded); lse$post_command_proc; return false; endif; if before_label_str = '' then before_label_str := tpu$k_unspecified; endif; return lse$add_pulldown_separator (menu_str, before_label_str); endif; endif; lse$post_command_proc; return false endprocedure; procedure lse_delete_menu_label (;menu_label) ! !doc_begin ! ! ONE LINE DEFINITION: ! Deletes a menu label. ! ! DESCRIPTION: ! (DELETE MENU LABEL) ! The menu label must be removed from all menus before it can be ! deleted. ! ! RELATED COMMANDS: ! NEW MENU commands ! DELETE MENU commands ! SET MENU commands ! SAVE SECTION ! ! CATEGORY: ! Screen ! !doc_end ! local label_str; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_delete_menu_label"); ENDON_ERROR; if lse$prompt_string( menu_label, label_str, lse$_menulabelprompt, "", "") then if label_str = '' then eve$message (lse$_labelnamneeded); lse$post_command_proc; return false; endif; return lse$remove_pulldown_label (label_str); endif; lse$post_command_proc; return false endprocedure; procedure lse_delete_menu_separator (;menu_name, number) ! !doc_begin ! ! ONE LINE DEFINITION: ! Deletes a separator from a pull-down menu or from a pop-up menu. ! ! DESCRIPTION: ! (DELETE MENU SEPARATOR) ! To determine which separator to delete, beginning with one, count the ! separators from the top down. ! ! RELATED COMMANDS: ! NEW MENU commands ! DELETE MENU commands ! SET MENU commands ! SAVE SECTION ! ! CATEGORY: ! Screen ! !doc_end ! local menu_str, default_sep_number, sep_number; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_delete_menu_separator"); ENDON_ERROR; if lse$prompt_string( menu_name, menu_str, lse$_menunameprompt, "", "") then if menu_str = '' then eve$message (lse$_menunamneeded); lse$post_command_proc; return false; endif; default_sep_number := lse$menus_separator_count (menu_str); if lse$prompt_number ( number, sep_number, lse$_sepnumprompt, "", default_sep_number) then return lse$remove_pulldown_separator (menu_str, sep_number); endif; endif; lse$post_command_proc; return false endprocedure; procedure lse_delete_menu_entry (;menu_name, menu_entry) ! !doc_begin ! ! ONE LINE DEFINITION: ! Deletes an entry from a pull-down menu or from a pop-up menu. ! ! DESCRIPTION: ! (DELETE MENU ENTRY) ! The label associated with the menu entry is not deleted. ! ! RELATED COMMANDS: ! NEW MENU commands ! DELETE MENU commands ! SET MENU commands ! SAVE SECTION ! ! CATEGORY: ! Screen ! !doc_end ! local entry_str, menu_str; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_delete_menu_entry"); ENDON_ERROR; if lse$prompt_string( menu_name, menu_str, lse$_menunameprompt, "", "") then if lse$prompt_string(menu_entry, entry_str, lse$_menuentryprompt, "", "") then if menu_str = '' then eve$message (lse$_menunamneeded); lse$post_command_proc; return false; endif; if entry_str = '' then eve$message (lse$_entrynamneeded); lse$post_command_proc; return false; endif; return lse$remove_pulldown_entry (menu_str, entry_str); endif; endif; lse$post_command_proc; return false endprocedure; procedure lse_set_menu_label (;menu_label, tpu_command, mnemonic_character) ! !doc_begin ! ! ONE LINE DEFINITION: ! Modifies an existing menu label. ! ! DESCRIPTION: ! (SET MENU LABEL) ! This command lets you change the text processing utility (TPU) code ! that is bound to a menu label. ! You can also modify the character used as a mnemonic for the label. ! ! RELATED COMMANDS: ! NEW MENU commands ! DELETE MENU commands ! SET MENU commands ! SAVE SECTION ! ! CATEGORY: ! Tailor ! !doc_end ! local label_str, command_str, char_str; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_menu_label"); ENDON_ERROR; if lse$prompt_string( menu_label, label_str, lse$_menulabelprompt, "", "") then if lse$prompt_string(tpu_command, command_str, lse$_tpucmdprompt, "", "") then if lse$prompt_string(mnemonic_character, char_str, lse$_mnemonicprompt, "", "") then if label_str = '' then eve$message (lse$_labelnamneeded); lse$post_command_proc; return false; endif; if command_str = '' then eve$message (lse$_tpucodeneeded); lse$post_command_proc; return false; endif; ! We'll let a null definition string go by if char_str = '' then char_str := tpu$k_unspecified; endif; return lse$modify_pulldown_label (label_str, command_str, char_str); endif; endif; endif; lse$post_command_proc; return false endprocedure; procedure lse_new_learn_key (;user_key_name) ! !doc_begin ! ! ONE LINE DEFINITION: ! Binds a sequence of keystrokes to a key. ! ! DESCRIPTION: ! (NEW LEARN KEY) ! Type the keystroke sequence (called a learn sequence) after the command ! and indicated key. To end the learn sequence, press the key ! for which you are defining the sequence. !

! When executing the learn sequence, LSE includes your responses to all ! prompts but does not prompt you again. (For example, such information ! as the string for a SEARCH command.) ! ! RELATED COMMANDS: ! NEW KEY ! ! CATEGORY: ! Tailor ! !doc_end ! LOCAL tpu_keyname; ON_ERROR [TPU$_ONELEARN]: EVE$MESSAGE( ERROR_TEXT ); lse$post_command_proc; eve$learn_abort; RETURN FALSE; [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_new_learn_key"); ENDON_ERROR; IF lse$prompt_key( user_key_name, tpu_keyname, lse$_keyprompt) THEN ! This defines the key to a call to lse_new_key which redefines ! the key to execute the learn sequence ! lse_new_key(eve$key_name( tpu_keyname ),"","","","", COMPILE("lse_new_key( '" + eve$key_name( tpu_keyname ) + "', '', '', '', '', LEARN_END )" ) ); LEARN_BEGIN( EXACT ); eve$message( lse$_beginlearn ); lse_new_learn_key := true; ELSE lse_new_learn_key := false; ENDIF; lse$post_command_proc; endprocedure; procedure lse_set_save_related_buffers (;boolean) ! !doc_begin ! ! ONE LINE DEFINITION: ! Determines if related modified buffers are written out on COMPILE commands. ! ! DESCRIPTION: ! (SET SAVE RELATED BUFFERS) ! If this attribute is (on), all modified buffers with the same language ! as the buffer being compiled are written out before the compilation ! takes place. If this attribute is (off), any modified buffers ! with the same language are not written out. ! ! RELATED COMMANDS: ! SET BUFFER LANGUAGE ! COMPILE ! COMPILE REVIEW ! SHOW ATTRIBUTES ! ! CATEGORY: ! Compile ! !doc_end ! local the_response; on_error [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_save_related_buffers"); endon_error; if lse$prompt_boolean( boolean, the_response, lse$_savrelprompt, '', lse$_savereldef ) then set (lse$save_related_buffers, lse$system, the_response); lse_set_save_related_buffers := true; else lse_set_save_related_buffers := false; endif; lse$$update_status_lines; lse$post_command_proc; endprocedure; procedure lse_enable_vms_integration_commands !doc_begin ! ! ONE LINE DEFINITION: ! Enables Source Code Analyzer for OpenVMS (SCA) and ! Code Management System for OpenVMS (CMS) integration ! on OpenVMS. ! ! DESCRIPTION: ! (ENABLE VMS INTEGRATION COMMANDS) ! Enables the VMSSCA_ and VMSSCA_ grammar prefixes, which provide ! commands to integrate with SCA and CMS, and enables Version 3.1 style ! SCA-related key bindings and menu entries. ! ! RELATED COMMANDS: ! DISABLE VMS INTEGRATION COMMANDS ! ENABLE GRAMMAR PREFIX ! ! CATEGORY: ! Tailor ! !doc_end ! ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_enable_vms_integration_commands"); ENDON_ERROR; if not eve$x_ultrix_active then lse_ENABLE_GRAMMAR_PREFIX("VMSCMS_"); lse_ENABLE_GRAMMAR_PREFIX ("VMSSCA_"); vmssca_enable_vmssca_bindings; vmscms_enable_vmscms_bindings; lse_enable_vms_integration_commands := true; else eve$message(tpu$_requiresvms); lse_enable_vms_integration_commands := false; endif; lse$post_command_proc; endprocedure; procedure lse_disable_vms_integration_commands !doc_begin ! ! ONE LINE DEFINITION: ! Disables Source Code Analyzer for OpenVMS (SCA) and ! Code Management System for OpenVMS (CMS) integration ! on OpenVMS. ! ! DESCRIPTION: ! (DISABLE VMS INTEGRATION COMMANDS) ! Disables the VMSSCA_ and VMSCMS_ grammar prefixes, and SCA and CMS ! key bindings. ! ! RELATED COMMANDS: ! DISABLE GRAMMAR PREFIX ! ENABLE VMS INTEGRATION COMMANDS ! ! CATEGORY: ! Tailor ! !doc_end ! ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_disable_vms_integration_commands"); ENDON_ERROR; if not eve$x_ultrix_active then lse_DISABLE_GRAMMAR_PREFIX("VMSCMS_"); lse_DISABLE_GRAMMAR_PREFIX("VMSSCA_"); vmssca_disable_vmssca_bindings; vmscms_disable_vmscms_bindings; lse_disable_vms_integration_commands := true; else eve$message(tpu$_requiresvms); lse_disable_vms_integration_commands := false; endif; lse$post_command_proc; endprocedure; procedure lse_set_max_undo( ;number ) ! ! !doc_begin ! ! ONE LINE DEFINITION: ! Sets the maximum number of commands you can undo for a specific buffer. ! ! DESCRIPTION: ! (SET MAX UNDO) ! Specify the maximum number of commands you can undo in the "number". ! qualifier. In the "buffer name" qualifier, specify the buffer for which ! you want to set the maximum number. ! ! If you omit a value in the optional "number" qualifier, LSE displays a ! default maximum Undo number of [100]. Press Return to accept the default ! or specify a different value. ! ! RELATED COMMANDS: ! UNDO ! REDO ! SHOW MAX UNDO ! ! CATEGORY: ! Screen ! !doc_end ! local the_response; ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_set_max_undo "); ENDON_ERROR; if lse$prompt_number( number, the_response, lse$_setmaxundoprompt, '', lse$_setmaxundodef ) then if (the_response < 0) then eve$message(lse$_illvalmaxundo); lse_set_max_undo := false; return; else if (get_info (current_buffer, "mode") = OVERSTRIKE) and (the_response > 0) then eve$message(lse$_undooverstrike); lse_set_max_undo := false; return; endif; if (get_info(current_buffer,'lse$overview_info') = TRUE) and (the_response > 0) then eve$message(lse$_undooverview); lse_set_max_undo := false; return; endif; set (lse$max_undo, current_buffer, the_response); lse_set_max_undo := true; endif ! lse_set_max_undo := lse$$set_max_undo(number, buffer_name); else lse_set_max_undo := false; endif; endprocedure; procedure lse_show_max_undo (; buffer_name) ! ! !doc_begin ! ! ONE LINE DEFINITION: ! Shows the maximum number of commands that you can undo for a specific ! buffer. ! ! DESCRIPTION: ! (SHOW MAX UNDO) ! If you have not set a maximum number with the SET MAX UNDO command, ! the SHOW MAX UNDO command displays the default value of [100]. ! ! RELATED COMMANDS: ! UNDO ! REDO ! SET MAX UNDO ! ! CATEGORY: ! Screen ! !doc_end ! ON_ERROR [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse$$show_max_undo"); ENDON_ERROR; save_buf := CURRENT_BUFFER; if (GET_INFO (buffer_name, "type") <> unspecified) then buf := GET_INFO (BUFFER, "find_buffer", buffer_name); message('Positioning in the specified buffer'); POSITION (buf); else buf := 0; endif; lse_show_max_undo := lse$show (lse$max_undo); if (buf <> 0) then POSITION (save_buf); endif; lse$post_command_proc; ! lse$$open_if_necessary; ! COPY_TEXT( lse$get_message_text( lse$_bufmxudolbl ) + ! STR( lse$$show_max_undo(buffer_name) ) ); ! SPLIT_LINE; endprocedure; procedure lse_undo ! ! !doc_begin ! ! ONE LINE DEFINITION: ! Reverses the most recently executed LSE command. ! ! DESCRIPTION: ! (UNDO) ! The UNDO command reverses any LSE ! command except for the UNDO and REDO commands. ! ! RELATED COMMANDS: ! SET MAX UNDO ! SHOW MAX UNDO ! REDO ! ! CATEGORY: ! Screen ! !doc_end if (get_info (lse$window, 'lse$undo') = 0) then eve$message (lse$_undodisableall); else if (get_info (current_buffer, 'lse$max_undo') < 1) then eve$message (lse$_undodisablecur, 0, get_info(current_buffer,"name")); else lse$$undo; endif; endif; endprocedure; procedure lse_redo ! ! !doc_begin ! ! ONE LINE DEFINITION: ! Reverses the most recent UNDO command. ! ! DESCRIPTION: ! (REDO) ! A followup command to UNDO, the REDO command reverses the most recent ! function that was undone and replaces the original function. The ! REDO replaces any LSE function except for the UNDO and REDO commands. ! ! RELATED COMMANDS: ! SET MAX UNDO ! SHOW MAX UNDO ! REDO ! ! CATEGORY: ! Screen ! !doc_end ! if (get_info (lse$window, 'lse$undo') = 0) then eve$message (lse$_undodisableall); else if (get_info (current_buffer, 'lse$max_undo') < 1) then eve$message (lse$_undodisablecur, 0, get_info(current_buffer,"name")); else lse$$redo; endif; endif; endprocedure; procedure lse_position_cursor (;line, column) if ((get_info(CURRENT_BUFFER, "record_count")+1) < line) then POSITION (BUFFER_END); SPLIT_LINE; else POSITION (line); if (column <> -1) then MOVE_HORIZONTAL (column); if (column <> CURRENT_OFFSET) or (line <> GET_INFO(CURRENT_BUFFER, "record_number")) then POSITION (line); POSITION (LINE_END); ! message("Error POSITIONING CURSOR - cursor not positioned correctly"); endif; else POSITION (LINE_END); endif; endif; endprocedure; procedure lse_erase_num_chars (;number) num_deleted := 0; loop num_tobe_deleted := number - num_deleted; deleted_str := ERASE_CHARACTER (num_tobe_deleted); num_deleted := num_deleted + LENGTH (deleted_str); exitif (num_deleted >= number); exitif (not lse$$erase_character (forward)); num_deleted := num_deleted + 1; endloop; endprocedure; PROCEDURE calculate_current_column ! Procedure to calculate the current column from the current offset, treating ! TAB characters as up to 8 blanks. LOCAL i, line, col; line := current_line; IF INDEX(line,ASCII(9)) = 0 THEN calculate_current_column := current_offset ELSE i := 1; col := 0; LOOP EXITIF i > current_offset; IF SUBSTR(line,i,1) = ASCII(9) THEN col := ((col + 8)/8)*8 ELSE col := col + 1 ENDIF; i := i + 1 ENDLOOP; calculate_current_column := col ENDIF ENDPROCEDURE PROCEDURE replace_tabs_with_blanks_and_pad(target_length) ! Procedure to replace TAB characters by the appropriate number of ! blanks on the current line, then pad the line out to a given length, if it ! is shorter. The routine assumes overstrike mode is in ! effect. It leave the current position at the beginning of the line. LOCAL i, col, curr_length, new_line, eight_blanks; !+ ! Make sure we're not on the EOB marker. !- IF MARK(NONE) <> END_OF(CURRENT_BUFFER) THEN IF INDEX(CURRENT_LINE, ASCII(9)) <> 0 THEN new_line := ''; eight_blanks := " "; i := 1; col := 0; LOOP EXITIF i > LENGTH(CURRENT_LINE); IF SUBSTR(CURRENT_LINE,i,1) = ASCII(9) THEN col := ((col + 8)/8)*8; new_line := new_line + SUBSTR(eight_blanks,1,col-LENGTH(new_line)) ELSE new_line := new_line + SUBSTR(CURRENT_LINE,i,1); col := col + 1 ENDIF; i := i + 1 ENDLOOP; lse$move_horizontal(-CURRENT_OFFSET); COPY_TEXT(new_line) ENDIF ENDIF; lse$move_horizontal(-CURRENT_OFFSET); !+ ! Now pad out the line if we have to !- IF MARK(NONE) = END_OF(CURRENT_BUFFER) THEN cur_length := 0 ELSE cur_length := LENGTH(CURRENT_LINE) ENDIF; IF cur_length < target_length THEN lse$move_horizontal(cur_length); COPY_TEXT(blank_chars_string(target_length - cur_length)); ENDIF; lse$move_horizontal(-CURRENT_OFFSET) ENDPROCEDURE PROCEDURE lse_box_draw !doc_begin ! ! ONE LINE DEFINITION: ! Draws a box. ! ! DESCRIPTION: ! (BOX DRAW) ! This command draws a box in overstrike mode. The diagonally opposite ! corners of the box are given by the beginning and end positions of the ! current selection. The box is drawn using '+' for the corners, '|' for ! the sides and '-' for the top and bottom. ! ! RELATED COMMANDS: ! BOX COPY ! BOX CUT ! BOX CUT PAD ! BOX PASTE ! BOX PASTE OVERSTRIKE ! BOX LOWERCASE ! BOX UPPERCASE ! ! CATEGORY: ! Text ! !doc_end ! ! Based on code from XLSE RECCUTPAS.TPU LOCAL saved_mode, saved_auto_erase, end_of_select, beginning_of_select, end_column, start_column, temp, top_bottom_text, mark1, range1, str1, str2, line_count, noundo; ON_ERROR [TPU$_TRUNCATE]: noundo := 1; EVE$MESSAGE (lse$_resetundobuf); lse$$reset_undo_buf (CURRENT_BUFFER); [OTHERWISE]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_box_draw"); ENDON_ERROR; !+ ! Check for no select active !- IF eve$x_select_position = 0 THEN MESSAGE("Select not active"); eve$learn_abort; RETURN FALSE; ENDIF; !+ ! For Undo !- noundo := 0; lse$$save_inserted_text(); !+ ! Set up mark beginning_of_select !- IF get_info(eve$x_select_position,"type") = RANGE THEN beginning_of_select := BEGINNING_OF (eve$x_select_position); POSITION (END_OF (eve$x_select_position)); ELSE beginning_of_select := eve$x_select_position; ENDIF; ! ! If the current buffer is unmodifiable, then issue an error message ! and leave. ! if not get_info (current_buffer, "modifiable") then message (LSE$_UNMODIFIABLE, 0, "draw box"); eve$learn_abort; return false; endif; !+ ! Set INSERT mode !- saved_mode := box_set_mode(INSERT); saved_auto_erase := get_info(current_buffer,'lse$auto_erase'); set(lse$auto_erase,current_buffer,FALSE); !+ ! Make sure there is a character at the corner of the box opposite ! the begin_select mark. If the end_of_select mark is before the ! begin_select mark, juggle the markers so that begin_select precedes ! end_of_select. !- box_bad_blank; IF MARK(NONE) >= beginning_of_select THEN end_of_select := MARK(NONE); ELSE end_of_select := beginning_of_select; beginning_of_select := MARK(NONE); POSITION(end_of_select) ENDIF; !+ ! Figure out what column the box ends in and set END_COLUMN there. ! Then, clear out the video on eve$x_select_position. Figure out ! the start column. !- end_column := calculate_current_column; POSITION(beginning_of_select); beginning_of_select := MARK(NONE); start_column := calculate_current_column; !+ ! We may have the upper right and lower left corners of the box ! selected. If so, START_COLUMN and END_COLUMN need to be reversed. !- IF start_column > end_column THEN temp := end_column; end_column := start_column; start_column := temp ENDIF; !+ ! Check for presence of overview lines !- line_count := 0; POSITION(beginning_of_select); LOOP line_count := line_count + 1; IF lse$is_overview(MARK(NONE)) THEN eve$message(lse$_undoboxover); POSITION(beginning_of_select); eve$clear_select_position(); lse$move_horizontal(-CURRENT_OFFSET); lse$move_horizontal(start_column); SET(saved_mode, CURRENT_BUFFER); set(lse$auto_erase,current_buffer, saved_auto_erase); eve$learn_abort; return false; ENDIF; EXITIF get_info(MARK(NONE),"record_number") >= get_info(end_of_select,"record_number"); lse$move_vertical(1); ENDLOOP; !+ ! Check selection is large enough for a box to be drawn !- IF (end_column - start_column < 2) or (line_count < 3) THEN MESSAGE("Selection too small to draw a box"); POSITION(beginning_of_select); eve$clear_select_position(); lse$move_horizontal(-CURRENT_OFFSET); lse$move_horizontal(start_column); SET(saved_mode, CURRENT_BUFFER); set(lse$auto_erase,current_buffer, saved_auto_erase); eve$learn_abort; return false; ENDIF; !+ ! For Undo !- POSITION(beginning_of_select); POSITION(LINE_BEGIN); mark1 := MARK(NONE); POSITION(end_of_select); range1 := CREATE_RANGE(mark1,LINE_END); str1 := STR(range1,ASCII(10)); POSITION(beginning_of_select); !+ ! Put in the top line of the box !- top_bottom_text := '+' + blank_chars_string(end_column-start_column-1) + '+'; TRANSLATE(top_bottom_text, "-", " "); SET(OVERSTRIKE, current_buffer); !+ ! Replace all TABs with blanks on this line and pad it, if we need to. !- replace_tabs_with_blanks_and_pad(end_column + 1); lse$move_horizontal(start_column); COPY_TEXT(top_bottom_text); lse$move_vertical(1); lse$move_horizontal(-CURRENT_OFFSET); !+ ! Step through the selected lines, putting vertical bars on either side ! of the selected text. !- LOOP !+ ! Replace all TABs with blanks on this line, if we need to. !- replace_tabs_with_blanks_and_pad(end_column + 1); lse$move_horizontal(start_column); COPY_TEXT("|"); lse$move_horizontal(end_column - CURRENT_OFFSET); COPY_TEXT("|"); lse$move_horizontal(-CURRENT_OFFSET); line_count := line_count - 1; EXITIF line_count <= 2; lse$move_vertical(1); ENDLOOP; !+ ! Now put in the bottom line of the box. !- !+ ! Replace all TABs with blanks on this line, if we need to. !- lse$move_vertical(1); replace_tabs_with_blanks_and_pad(end_column + 1); lse$move_horizontal(start_column); COPY_TEXT(top_bottom_text); !+ ! Position to the beginning of the cut area, reset BEGIN_SELECT, ! restore old insert/overstrike setting !- POSITION(beginning_of_select); eve$clear_select_position(); lse$move_horizontal(-CURRENT_OFFSET); lse$move_horizontal(start_column); SET(saved_mode, CURRENT_BUFFER); set(lse$auto_erase,current_buffer, saved_auto_erase); if (noundo = 0) then !+ ! Set up undo information describing the change as a substitution ! of the lines containing the box. !- str2 := STR(range1,ASCII(10)); if (noundo = 0) then lse$$save_current_position(); lse$$start_substitute(str2); lse$$add_substitute_entry(str1,mark1,''); lse$$end_substitute(); endif; endif; lse$post_command_proc; ENDPROCEDURE PROCEDURE box_other (ctype;) ! Based on code from XLSE RECCUTPAS.TPU LOCAL saved_mode, saved_auto_erase, end_of_select, beginning_of_select, end_column, start_column, temp, pad_chars, save_position, blank_chars, cut_text, mark1, range1, str1, str2, noundo; ON_ERROR [TPU$_TRUNCATE]: noundo := 1; EVE$MESSAGE (lse$_resetundobuf); lse$$reset_undo_buf (CURRENT_BUFFER); [OTHERWISE]: lse$$unexpected_error(ERROR, ERROR_TEXT, ERROR_LINE, "box_cut"); ENDON_ERROR; !+ ! Check for no select active !- IF eve$x_select_position = 0 THEN MESSAGE("Select not active"); eve$learn_abort; RETURN FALSE; ENDIF; ! ! If the current buffer is unmodifiable, then issue an error message ! and leave. ! if ctype > 0 then if not get_info (current_buffer, "modifiable") then if ctype < 3 then message (LSE$_UNMODIFIABLE, 0, "cut") else message (LSE$_UNMODIFIABLE, 0, "change case") endif; eve$learn_abort; return false; endif; endif; !+ ! For Undo !- noundo := 0; if ctype > 0 then lse$$save_inserted_text(); endif; IF get_info(eve$x_select_position,"type") = RANGE THEN beginning_of_select := BEGINNING_OF (eve$x_select_position); POSITION (END_OF (eve$x_select_position)); ELSE beginning_of_select := eve$x_select_position; ENDIF; !+ ! Set INSERT mode and erase paste_buffer !- saved_auto_erase := get_info(current_buffer,'lse$auto_erase'); set(lse$auto_erase,current_buffer,FALSE); lse$$set_paste_buffer(); saved_mode := box_set_mode(INSERT); ERASE(paste_buffer); !+ ! Make sure there is a character at the corner of the box opposite ! the begin_select mark. If the end_of_select mark is before the ! begin_select mark, juggle the markers so that begin_select precedes ! end_of_select. !- box_bad_blank; IF MARK(NONE) >= beginning_of_select THEN end_of_select := MARK(NONE); ELSE end_of_select := beginning_of_select; beginning_of_select := MARK(NONE); POSITION(end_of_select) ENDIF; !+ ! Figure out what column the box ends in and set END_COLUMN there. ! Then, clear out the video on eve$x_select_position. Figure out ! the start column. !- end_column := calculate_current_column; POSITION(beginning_of_select); beginning_of_select := MARK(NONE); start_column := calculate_current_column; !+ ! We may have the upper right and lower left corners of the box ! selected. If so, START_COLUMN and END_COLUMN need to be reversed. !- IF start_column > end_column THEN temp := end_column; end_column := start_column; start_column := temp ENDIF; !+ ! Check for presence of overview lines !- POSITION(beginning_of_select); LOOP IF lse$is_overview() THEN eve$message(lse$_undoboxover); POSITION(beginning_of_select); eve$clear_select_position(); lse$move_horizontal(-CURRENT_OFFSET); lse$move_horizontal(start_column); SET(saved_mode, CURRENT_BUFFER); set(lse$auto_erase,current_buffer, saved_auto_erase); eve$learn_abort; return false; ENDIF; EXITIF get_info(MARK(NONE),"record_number") >= get_info(end_of_select,"record_number"); lse$move_vertical(1); ENDLOOP; !+ ! Get a string of the appropriate number of blanks to paste back in !- pad_chars := blank_chars_string(end_column - start_column + 1); !+ ! For Undo !- if ctype > 0 then POSITION(beginning_of_select); POSITION(LINE_BEGIN); mark1 := MARK(NONE); POSITION(end_of_select); range1 := CREATE_RANGE(mark1,LINE_END); str1 := STR(range1,ASCII(10)); endif; !+ ! Step through the selected lines, copying the text to the paste buffer ! and replacing it with blanks as we go. Replace all TABs with blanks ! before we look at it so we get the columns straight. !- POSITION(beginning_of_select); lse$move_horizontal(-current_offset); SET(OVERSTRIKE, current_buffer); LOOP !+ ! Replace all TABs with blanks on this line, if we need to. !- replace_tabs_with_blanks_and_pad(end_column + 1); !+ ! Obtain the text we're cutting !- cut_text := SUBSTR(CURRENT_LINE, start_column + 1, end_column - start_column + 1); !+ ! Replace the text with blanks !- lse$move_horizontal(start_column); IF ctype = 1 THEN COPY_TEXT(pad_chars); ENDIF; IF ctype = 2 THEN ERASE_CHARACTER(end_column-start_column+1); ENDIF; IF ctype = 3 THEN COPY_TEXT(CHANGE_CASE(cut_text, LOWER)); ENDIF; IF ctype = 4 THEN COPY_TEXT(CHANGE_CASE(cut_text, UPPER)); ENDIF; !+ ! Copy the text to the paste buffer !- if ctype < 3 then save_position := MARK(NONE); POSITION(paste_buffer); COPY_TEXT(cut_text); lse$move_horizontal(1); endif; !+ ! Reposition to the other buffer and move to the next line !- POSITION(save_position); lse$move_horizontal(-CURRENT_OFFSET); EXITIF get_info(MARK(NONE),"record_number") >= get_info(end_of_select,"record_number"); lse$move_vertical(1); ENDLOOP; ! ! If we put the text into the clipboard, then we must ask to own it now. ! if eve$x_decwindows_active AND (paste_buffer = lse$$clipboard_buffer) then lse$$write_clipboard; endif; !+ ! Position to the beginning of the cut area, reset BEGIN_SELECT, ! restore old insert/overstrike setting !- POSITION(beginning_of_select); eve$clear_select_position(); lse$move_horizontal(-CURRENT_OFFSET); lse$move_horizontal(start_column); SET(saved_mode, CURRENT_BUFFER); set(lse$auto_erase,current_buffer, saved_auto_erase); !+ ! Set up undo information describing the change as a substitution ! of the lines containing the box. !- if (ctype > 0) and (noundo = 0) then str2 := STR(range1,ASCII(10)); if (noundo = 0) then lse$$save_current_position(); lse$$start_substitute(str2); lse$$add_substitute_entry(str1,mark1,''); lse$$end_substitute(); endif; endif; return true; ENDPROCEDURE PROCEDURE lse_box_copy !doc_begin ! ! ONE LINE DEFINITION: ! Copies the selected box to buffer $PASTE or the clipboard. ! ! DESCRIPTION: ! (BOX COPY) ! This command copies the currently selected box to the default location ! (the DECwindows clipboard or paste buffer). The diagonally opposite ! corners of the box are given by the beginning and end positions of ! the current selection. ! ! RELATED COMMANDS: ! BOX CUT ! BOX CUT PAD ! BOX PASTE ! BOX PASTE OVERSTRIKE ! BOX DRAW ! BOX LOWERCASE ! BOX UPPERCASE ! SET CLIPBOARD ! ! CATEGORY: ! Text ! !doc_end ! on_error [otherwise]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_box_copy"); endon_error; box_other(0); lse$post_command_proc; ENDPROCEDURE PROCEDURE lse_box_cut !doc_begin ! ! ONE LINE DEFINITION: ! Moves the selected box to buffer $PASTE or the clipboard. ! ! DESCRIPTION: ! (BOX CUT) ! This command moves the currently selected box to the default location ! (the DECwindows clipboard or paste buffer). The diagonally opposite ! corners of the box are given by the beginning and end positions of ! the current selection. ! ! RELATED COMMANDS: ! BOX COPY ! BOX CUT PAD ! BOX PASTE ! BOX PASTE OVERSTRIKE ! BOX DRAW ! BOX LOWERCASE ! BOX UPPERCASE ! SET CLIPBOARD ! ! CATEGORY: ! Text ! !doc_end ! on_error [otherwise]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_box_cut"); endon_error; box_other(2); lse$post_command_proc; ENDPROCEDURE PROCEDURE lse_box_cut_pad !doc_begin ! ! ONE LINE DEFINITION: ! Moves the selected box to buffer $PASTE or the clipboard. ! ! DESCRIPTION: ! (BOX CUT PAD) ! This command moves the currently selected box to the default location ! (the DECwindows clipboard or paste buffer), the box is replaced by ! spaces. The diagonally opposite corners of the box are given by the ! beginning and end positions of the current selection. ! ! RELATED COMMANDS: ! BOX COPY ! BOX CUT ! BOX PASTE ! BOX PASTE OVERSTRIKE ! BOX DRAW ! BOX LOWERCASE ! BOX UPPERCASE ! SET CLIPBOARD ! ! CATEGORY: ! Text ! !doc_end ! on_error [otherwise]: lse$post_command_proc; lse$$unexpected_error(ERROR, ERROR_TEXT, ERROR_LINE, "lse_box_cut_pad"); endon_error; box_other(1); lse$post_command_proc; ENDPROCEDURE PROCEDURE lse_box_lowercase !doc_begin ! ! ONE LINE DEFINITION: ! Changes the case of the text in the currently selected box. ! ! DESCRIPTION: ! (BOX LOWERCASE) ! This command changes the case of the text in the currently selected box. ! The diagonally opposite corners of the box are given by the beginning ! and end positions of the current selection. ! ! RELATED COMMANDS: ! BOX COPY ! BOX CUT ! BOX CUT PAD ! BOX PASTE ! BOX PASTE OVERSTRIKE ! BOX DRAW ! BOX UPPERCASE ! SET CLIPBOARD ! ! CATEGORY: ! Text ! !doc_end ! on_error [otherwise]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_box_change_case"); endon_error; box_other(3); lse$post_command_proc; ENDPROCEDURE PROCEDURE lse_box_uppercase !doc_begin ! ! ONE LINE DEFINITION: ! Changes the case of the text in the currently selected box. ! ! DESCRIPTION: ! (BOX UPPERCASE) ! This command changes the case of the text in the currently selected box. ! The diagonally opposite corners of the box are given by the beginning ! and end positions of the current selection. ! ! RELATED COMMANDS: ! BOX COPY ! BOX CUT ! BOX CUT PAD ! BOX PASTE ! BOX PASTE OVERSTRIKE ! BOX DRAW ! BOX LOWERCASE ! SET CLIPBOARD ! ! CATEGORY: ! Text ! !doc_end ! on_error [otherwise]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_box_change_case"); endon_error; box_other(4); lse$post_command_proc; ENDPROCEDURE PROCEDURE box_paste(ptype;) ! Based on code from XLSE RECCUTPAS.TPU LOCAL save_position, start_column, paste_line, save_buffer, save_mode, saved_auto_erase, mark1, mark2, range1, str1, str2, noundo; ON_ERROR [TPU$_TRUNCATE]: noundo := 1; EVE$MESSAGE (lse$_resetundobuf); lse$$reset_undo_buf (CURRENT_BUFFER); [TPU$_ENDOFBUF]: message (error_text); lse$post_command_proc; eve$learn_abort; RETURN FALSE; [OTHERWISE]: lse$$unexpected_error(ERROR, ERROR_TEXT, ERROR_LINE, "box_paste"); ENDON_ERROR; ! ! If the current buffer is unmodifiable, then issue an error message ! and leave. ! if not get_info (current_buffer, "modifiable") then message (LSE$_UNMODIFIABLE, 0, "PASTE"); eve$learn_abort; return false; endif; lse$$set_paste_buffer(); ! ! If this is DECwindows and they have said to paste from the clipboard, ! then prepare the clipboard buffer for a paste operation. This may in ! fact read the DECwindows clipboard. ! if eve$x_decwindows_active AND (paste_buffer = lse$$clipboard_buffer) then lse$$read_clipboard; endif; save_buffer := CURRENT_BUFFER; save_position := MARK(NONE); start_column := calculate_current_column; IF ptype = 1 THEN save_mode := box_set_mode(OVERSTRIKE); ELSE save_mode := box_set_mode(INSERT); ENDIF; POSITION(BEGINNING_OF(paste_buffer)); IF MARK(NONE) = END_OF(paste_buffer) THEN MESSAGE("Paste buffer is empty"); eve$learn_abort; RETURN FALSE; ENDIF; saved_auto_erase := get_info(current_buffer,'lse$auto_erase'); set(lse$auto_erase,current_buffer,FALSE); !+ ! For Undo !- noundo := 0; POSITION(save_position); POSITION(LINE_BEGIN); mark1 := MARK(NONE); POSITION(BEGINNING_OF(paste_buffer)); LOOP EXITIF MARK(NONE) = END_OF(paste_buffer); IF lse$is_overview() THEN eve$message(lse$_undoboxover); POSITION(save_position); lse$move_horizontal(-CURRENT_OFFSET); lse$move_horizontal(start_column); SET(save_mode, CURRENT_BUFFER); set(lse$auto_erase,current_buffer, saved_auto_erase); eve$learn_abort; return false; ENDIF; lse$move_vertical(1); POSITION(save_buffer); IF MARK(NONE) = END_OF(save_buffer) THEN eve$message(lse$_unexeof); POSITION(save_position); lse$move_horizontal(-CURRENT_OFFSET); lse$move_horizontal(start_column); SET(save_mode, CURRENT_BUFFER); set(lse$auto_erase,current_buffer, saved_auto_erase); eve$learn_abort; return false; ENDIF; IF lse$is_overview() THEN eve$message(lse$_undoboxover); POSITION(save_position); lse$move_horizontal(-CURRENT_OFFSET); lse$move_horizontal(start_column); SET(save_mode, CURRENT_BUFFER); set(lse$auto_erase,current_buffer, saved_auto_erase); eve$learn_abort; return false; ENDIF; POSITION(LINE_END); mark2 := MARK(NONE); lse$move_vertical(1); POSITION(paste_buffer) ENDLOOP; range1 := CREATE_RANGE(mark1, mark2); str1 := STR(range1, ASCII(10)); POSITION(save_position); lse$$save_inserted_text(); !+ ! Loop through lines in the paste buffer, putting them at the ! appropriate offset in the current buffer. !- POSITION(BEGINNING_OF(paste_buffer)); LOOP EXITIF MARK(NONE) = END_OF(paste_buffer); !+ ! Get the current line of the paste buffer. !- paste_line := CURRENT_LINE; lse$move_vertical(1); !+ ! Convert tabs to blanks on the line in the current buffer. !- POSITION(save_buffer); replace_tabs_with_blanks_and_pad(start_column+1); !+ ! Position at the correct offset and overwrite the text there. !- lse$move_horizontal(start_column); COPY_TEXT(paste_line); lse$move_vertical(1); POSITION(paste_buffer) ENDLOOP; !+ ! Position to start of pasted text and restore old mode setting. !- POSITION(save_position); lse$move_horizontal(-CURRENT_OFFSET); lse$move_horizontal(start_column); SET(save_mode, CURRENT_BUFFER); set(lse$auto_erase,current_buffer, saved_auto_erase); !+ ! Set up undo information describing the change as a substitution ! of the lines containing the box. !- if (noundo = 0) then str2 := STR(range1,ASCII(10)); if (noundo = 0) then lse$$save_current_position(); lse$$start_substitute(str2); lse$$add_substitute_entry(str1,mark1,''); lse$$end_substitute(); endif; endif; return true; ENDPROCEDURE PROCEDURE lse_box_paste !doc_begin ! ! ONE LINE DEFINITION: ! Copies the contents of the default location to a box at the current ! location. ! ! DESCRIPTION: ! (BOX PASTE) ! This command copies the contents from the default location (the DECwindows ! clipboard or paste buffer) to a box with its top left corner at the ! current location. The contents are copied in insert mode. ! ! RELATED COMMANDS: ! BOX COPY ! BOX CUT ! BOX CUT PAD ! BOX PASTE OVERSTRIKE ! BOX DRAW ! BOX LOWERCASE ! BOX UPPERCASE ! SET CLIPBOARD ! ! CATEGORY: ! Text ! !doc_end ! on_error [otherwise]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_box_paste"); endon_error; box_paste(0); lse$post_command_proc; ENDPROCEDURE PROCEDURE lse_box_paste_overstrike !doc_begin ! ! ONE LINE DEFINITION: ! Copies the contents of the default location to a box at the current ! location. ! ! DESCRIPTION: ! (BOX PASTE OVERSTRIKE) ! This command copies the contents from the default location (the DECwindows ! clipboard or paste buffer) to a box with its top left corner at the ! current location. The contents are copied in overstrike mode. ! ! RELATED COMMANDS: ! BOX COPY ! BOX CUT ! BOX CUT PAD ! BOX PASTE ! BOX DRAW ! BOX LOWERCASE ! BOX UPPERCASE ! SET CLIPBOARD ! ! CATEGORY: ! Text ! !doc_end ! on_error [otherwise]: lse$post_command_proc; lse$$unexpected_error( ERROR, ERROR_TEXT, ERROR_LINE, "lse_box_paste_overstrike"); endon_error; box_paste(1); lse$post_command_proc; ENDPROCEDURE PROCEDURE box_bad_blank !+ ! This procedure drops a space at the current position if the current ! character is null so that any mark will be for an existing character. ! We really want a mark in a particular screen column. In TPU, ! an EOL mark would move if the line were extended. The cursor is returned ! to its original position after the space is copied to the current position ! in the current buffer. !- IF MARK(NONE) = END_OF(CURRENT_BUFFER) THEN copy_text(" "); lse$move_horizontal(-1) ELSE if current_character = "" then copy_text(" "); lse$move_horizontal(-1); endif ENDIF endprocedure ! box_bad_blank PROCEDURE box_set_mode(new_mode) ! This procedure returns the current mode for the current buffer ! and sets it to the value in NEW_MODE. box_set_mode := get_info(current_buffer,"MODE"); set(new_mode, current_buffer); endprocedure ! box_set_mode PROCEDURE blank_chars_string(v_blank_count) ! This procedure returns a string of v_blank_count blank chars. local v_blank_chars, v_oldlen, v_blanks_so_far; ! Length of blank char string so far IF v_blank_count = 0 THEN RETURN "" ENDIF; v_blank_chars := " "; v_blanks_so_far := 1; loop exitif v_blanks_so_far >= v_blank_count; v_oldlen := LENGTH(v_blank_chars); v_blank_chars := v_blank_chars + v_blank_chars; v_blanks_so_far := v_blanks_so_far + v_oldlen; endloop; IF v_blanks_so_far > v_blank_count THEN v_blank_chars := SUBSTR(v_blank_chars,1,v_blank_count) ENDIF; RETURN v_blank_chars endprocedure ! blank_chars_string !procedure lse_is_placeholder !if lse$is_placeholder(1,1) then ! MESSAGE('is placeholder'); ! MESSAGE(CURRENT_LINE); !endif; !endprocedure !procedure lse_is_OVERVIEW !if lse$is_overview() then ! MESSAGE('is overview'); ! MESSAGE(CURRENT_LINE); !endif; !endprocedure ! Constants ! constant lse$k_default_lib := "HELPLIB" variable lse$$$_x_space_pattern, lse$$x_help_prefix, lse$$x_last_new_or_goto_mark, lse$$x_last_new_mark, lse$$x_search_attribute_changed;