! LSE$EVE_CORE.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 superceded EVE procedures that are located in the ! file EVE$CORE.TPU. ! ! ENVIRONMENT: ! VAX/VMS ! ! CREATION DATE: 21-DEC-1989 ! ! MODIFIED BY: ! ! X3.1-1 DAS 21-Dec-89 First pass. ! X3.2 WC3 01-Oct-90 Use get_info( lse$search, 'lse$auto_reverse' ) ! instead of lse$$x_search_all ! X3.2-1 DAS 26-Nov-90 Excise dead code and conditional compilations. ! X3.2-2 SAA 15-Jan-90 Add extra arg to eve$selection...new EVE code ! expects it. ! X4.0 SHE 11-Jun-91 lse$$widget_set_find_direction renamed to ! lse$$widget_set_search_direction. ! X4.0-1 WC3 13-Jun-91 Prompting consistency ! X4.0-2 WC3 31-Jul-91 Use lse$prompt_boolean for reverse questions ! X4.0-3 SHE 14-Aug-91 Uncommented out code for managing the menu bar ! X4.0-4 SHE 22-Aug-91 Added SET (GLOBAL_SELECT) to eve$select_a_range ! X4.0-5 WC3 15-Oct-91 Fix missing LSE> prompt. eve$select_a_range ! was doing post_key_procedure stuff w/o ! using eve$set_key_procedure ! X4.0-6 DAS 15-Nov-91 Removed empty module init ! X4.0-7 WC3 12-Dec-91 Remove MODULE/ENDMODULE construct ! Remove eve$init_procedure !- procedure lse$eve_core_module_ident return "4.7-3"; endprocedure; ! EVE$CORE.TPU Page 37 procedure eve_set_pending_delete ! Enable pending delete behavior ! Enable pending delete behavior: with a select active, pressing a typing key ! removes the selected text into the $RESTORE$SELECTION$ buffer eve$$x_state_array {eve$$k_pending_delete_enabled} := TRUE; !LSE Added the following lines of code to fix LSE_XBUGS note 784. ! if eve$x_select_position <> 0 then eve$start_pending_delete; endif; ! !LSE End of changes eve$message (EVE$_PENDINGDELON); return (eve$define_attr ("eve_set_pending_delete", "eve_set_pending_delete;", message_text (EVE$_PENDINGDELON, 0))); endprocedure; ! eve_set_pending_delete ! EVE$CORE.TPU Page 28 procedure eve$$test_find_terminator ! Test if must change direction (the_key) ! key for test !+ ! Description ! See if the_key is one of the keys whose definition comment is contained in ! eve$kt_find_/direction/_keys ! E.G., eve$x_find_forward_keys := " advance forward " ! E.G., eve$x_find_reverse_keys := " backup reverse " ! Returned value ! false = the_key is not one of the find terminators ! true = the_key is one of the find terminators, and the direction ! is now set per that terminator (it may not have changed) !- local facility, legend, topic; on_error [OTHERWISE]: endon_error; if (eve$$x_state_array {eve$$k_command_line_flag} = eve$k_invoked_by_menu) then return (FALSE); endif; eve$$parse_comment (the_key, "", facility, legend, topic); if topic = "" then return FALSE; endif; edit (topic, LOWER, OFF); if eve$test_terminator (eve$$x_find_toggle_keys, topic) then ! It's a change-the-direction terminator (F11) if current_direction = FORWARD then set (REVERSE, current_buffer); else set (FORWARD, current_buffer); endif; !+ ! ### LSE change: ! eve$x_old_find_direction := current_direction; ! Uncomment to restore search and substitute dialog box live direction ! lse$$widget_set_search_direction; return (TRUE); endif; if current_direction = REVERSE then if eve$test_terminator (eve$$x_find_reverse_keys, topic) then return (TRUE); ! already in reverse, just return true else ! do we need to change to forward? if not eve$test_terminator (eve$$x_find_forward_keys, topic) then return (FALSE); else set (FORWARD, current_buffer); !+ ! ### LSE change: ! eve$x_old_find_direction := current_direction; ! Uncomment to restore search and substitute dialog box live direction ! lse$$widget_set_search_direction; return (TRUE); endif; endif; else if eve$test_terminator (eve$$x_find_forward_keys, topic) then return (TRUE); ! already in forward, just return true else ! do we need to change to reverse? if not eve$test_terminator (eve$$x_find_reverse_keys, topic) then return (FALSE); else set (REVERSE, current_buffer); !+ ! ### LSE change: ! eve$x_old_find_direction := current_direction; ! Uncomment to restore search and substitute dialog box live direction ! lse$$widget_set_search_direction; return (TRUE); endif; endif; endif; endprocedure; ! eve$$test_find_terminator ! ! This procedure is from the TPU_17JUN area which is the 2.3 version of the ! procedure. Mouse selection has changed in more recent build areas. ! ! A change was made which is commented out with the line !LSE. This is to fix ! LSE_BUGS note number 316. ! ! The lines beginning with !%IF eve$x_at_least_tpu_2_2 were removed. ! ! Changed to get_info ("buffer") from using range to use mark ! ! ! EVE$CORE.TPU Page 28 procedure eve$select_a_range (arg_1; arg_2) local saved_mark, start_mark, end_mark, first_mark, last_mark, old_filter, the_key_map_list; on_error [TPU$_CONTROLC]: eve$$restore_position (saved_mark); eve$learn_abort; abort; [OTHERWISE]: eve$$restore_position (saved_mark); eve$learn_abort; endon_error; saved_mark := mark (FREE_CURSOR); case get_info (arg_1, "type") [INTEGER]: eve$clear_select_position; return (FALSE); [RANGE]: eve$x_select_position := create_range (beginning_of (arg_1), end_of (arg_1), eve$x_highlighting); [MARKER]: if get_info (arg_2, "type") <> MARKER then eve$message (TPU$_INVPARAM, 0, 2, "", str (get_info (arg_2, "type")), "", "MARKER"); eve$learn_abort; return (FALSE); else if not get_info (arg_1, "bound") then position (arg_1); start_mark := mark (NONE); else start_mark := arg_1; endif; if not get_info (arg_2, "bound") then position (arg_2); end_mark := mark (NONE); else end_mark := arg_2; endif; !LSE if get_info (eve$x_select_position, "type") = RANGE !LSE then ! Make last (first) character in forward (reverse) direction ! not be in the select range (as in SELECT builtin). if start_mark <= end_mark then first_mark := start_mark; last_mark := end_mark; else ! In reverse direction, first_mark := end_mark; ! swap them so last_mark is last_mark := start_mark; ! > first_mark. endif; ! Adjust last_mark left 1 character so it's not selected ! as in !+ ! ### LSE CHANGE ### (1) ! LSE allow at end of the buffer !- ! ! else ! if do_messages ! then ! if extend_null_range ! then ! eve$message (EVE$_SELCAN); ! default = msg at eob ! else ! eve$clear_message; ! EDT-type clear paste buffer ! endif; ! endif; ! return (FALSE); ! error condition ! endif; ! ! ### END OF CHANGE ### (2) ! endif; return (possible_selection); endif; else %if eve$x_option_decwindows %then ! we don't have a select range if use_global and eve$x_decwindows_active then possible_selection := get_global_select (PRIMARY, "STRING"); if get_info (possible_selection, "type") = STRING then return (possible_selection); endif; endif; %endif ! No selection or global select if use_found_range then if get_info (eve$x_found_range, "type") = RANGE then if get_info (eve$x_found_range, "buffer") = current_buffer then possible_selection := eve$x_found_range; if cancel_range then eve$$remove_found_range; endif; return (possible_selection); else if do_messages then eve$message (EVE$_FINDSAMEBUF); endif; return (FALSE); endif; endif; endif; endif; if do_messages then eve$message (EVE$_NOSELECT); endif; return (FALSE); endprocedure; ! EVE$CORE.TPU Page 15 procedure eve$search ! Search (including leading w/s) (the_target, ! \ the_direction, ! >-all as per the SEARCH built-in exactness, ! / leading_whitespace,! if true include all leading w/s replacing; ! if true allow a match at the current location the_position) ! 0 - FIND Skip current location ! 1 - REPLACE Allow a match here ! 2 - WILDCARD FIND Skip current location ! !### LSE CHANGE: ! ! the_position Specified - SEARCH string immediately from ! the current position local the_range, on_range, saved_mark; on_error [TPU$_CONTROLC]: eve$$restore_position (saved_mark); eve$learn_abort; abort; [OTHERWISE]: eve$$restore_position (saved_mark); endon_error; saved_mark := mark (FREE_CURSOR); position (TEXT); ! snap cursor to text ! ! ### LSE CHANGE : ! ! this change is to resolve the problem found in cut/substitute. ! (In EVE, it skips every other substitutionwhen you do "cut/substitute" with ! the following example ! string is : abcabcabcabc ! and paste buffer contains xyz ! then you do "search abc", then do "cut/substitute".) ! if the_position = tpu$k_unspecified then if get_info (eve$x_found_range, "type") = RANGE then if get_info (eve$x_found_range, "buffer") = current_buffer then on_range := TRUE; endif; endif; if on_range then if get_info (saved_mark, "within_range", eve$x_found_range) then if the_direction = FORWARD then position (end_of (eve$x_found_range)); move_horizontal (1); else position (beginning_of (eve$x_found_range)); if mark (NONE) <> beginning_of (current_buffer) then move_horizontal (-1); endif; endif; endif; else if current_direction = FORWARD then if mark (FREE_CURSOR) <> end_of (current_buffer) then ! ! ### LSE CHANGE ! lse$$x_replacement is indicated that search is invoked by ! substitute command. ! if (not replacing) AND NOT (lse$$x_replacement) then move_horizontal (1); endif; endif; else if mark (FREE_CURSOR) <> beginning_of (current_buffer) then move_horizontal (-1); endif; endif; endif; endif; loop the_range := search_quietly (the_target, the_direction, exactness); exitif the_range = 0; if leading_whitespace then position (the_range); exitif current_offset = 0; move_horizontal (-1); if index (eve$kt_whitespace, current_character) <> 0 then loop exitif current_offset = 0; move_horizontal (-1); if index (eve$kt_whitespace, current_character) = 0 then move_horizontal (1); exitif 1; endif; endloop; the_range := create_range (mark (NONE), end_of (the_range), NONE); exitif 1; else ! ! move_horizontal (2); ! v2.3 ! move_horizontal (1); ! move back exitif; ! not whitespace char endif; else exitif 1; endif; endloop; if the_range <> 0 then eve$$x_saved_found_range := the_range; endif; position (saved_mark); return (the_range); endprocedure; ! EVE$CORE.TPU Page 16 procedure eve$remember_found ! Remember the search string (the_range) ! If a find succeeded, hilight the found range and associate a ! found_post_key "filter" procedure with the buffer's key_map_list. local the_key_map_list, same_buffer, old_filter; on_error [OTHERWISE]: endon_error; if (get_info (the_range, "type") = RANGE) then if get_info (eve$$x_found_post_filter, "type") <> PROGRAM then eve$$x_found_post_filter := compile ("eve$$found_post_filter"); endif; ! Remove the found_range and associated filter if the found_range ! is in a buffer with a key_map_list different from the current_buffer's ! (filters are tied to key_map_lists which are tied to buffers) if get_info (eve$x_found_range, "type") = RANGE then if get_info (current_buffer, "key_map_list") <> get_info (get_info (eve$x_found_range, "buffer"), "key_map_list") then eve$$remove_found_range; else same_buffer := TRUE; endif; endif; eve$x_found_range := create_range (beginning_of (the_range), end_of (the_range), eve$x_found_highlighting); ! Add the found filter to the command/mouse/user k_m_l's post-key procedure if not same_buffer ! insure filters aren't already set then the_key_map_list := get_info (get_info (eve$x_found_range, "buffer"), "key_map_list"); if current_window = eve$command_window then eve$set_key_procedure (FALSE, eve$x_command_key_map_list, eve$$x_found_post_filter, eve$$k_found_post_filter_id); else eve$set_key_procedure (FALSE, the_key_map_list, eve$$x_found_post_filter, eve$$k_found_post_filter_id); endif; eve$set_key_procedure (FALSE, eve$x_mouse_list, eve$$x_found_post_filter, eve$$k_found_post_filter_id); endif; ! ! ### LSE change ! ! Expand sufficent lines to make the cursor position visible if current ! record is invisible. ! lse$make_visible(0); ! ! end of LSE change ! return TRUE; else eve$$remove_found_range; return FALSE; endif; endprocedure; ! eve$remember_found ! EVE$CORE.TPU Page 21 procedure eve$find_target ! Find subprocedure (how_exact, replacing, move_flag; old_find) ! Search for eve$x_target in the current direction. If not found in the ! current direction look in the opposite direction, but do not go ! there without prompting the user. ! Returns range if eve$x_target found, otherwise returns false. ! ! Parameters: ! how_exact eve$x_find_exact or eve$x_find_no_exact - input ! replacing 1 = called by eve_replace: allow a ! match at current cursor position and ! return if no string found ! 2 = called by wildcard_find ! 0 = called by eve_find - input ! move_flag 1 = position to found string ! 0 = don't position to found string - input ! old_find 1 = called by eve$find - optional input local saved_mark, ! Marker for current cursor position text_mark, ! Marker for current text position other_direction, ! Keyword for opposite direction find_range, ! Range returned by search ! status, ! Result of set (widget) leading_whitespace, ! Boolean for including leading whitespace the_prompt, ! Prompt for going in other direction find_reply, ! Reply to inquiry about changing direction change_direction_key, ! Keyword for key used to end find_reply saved_direction, ! Direction upon entry yesno; on_error [TPU$_CONTROLC]: if (saved_direction <> current_direction) and (get_info (saved_direction, "type") = KEYWORD) then set (saved_direction, current_buffer); endif; eve$$restore_position (saved_mark); eve$learn_abort; abort; [OTHERWISE]: if (saved_direction <> current_direction) and (get_info (saved_direction, "type") = KEYWORD) then set (saved_direction, current_buffer); endif; eve$$restore_position (saved_mark); endon_error; saved_direction := current_direction; saved_mark := mark (FREE_CURSOR); ! mark original position position (TEXT); ! snap cursor to text text_mark := mark (NONE); if current_direction = FORWARD then if saved_mark <> end_of (current_buffer) then find_range := eve$search (eve$x_target, FORWARD, how_exact, eve$$x_state_array {eve$$k_leading_whitespace}, replacing); else find_range := 0; endif; else if saved_mark <> beginning_of (current_buffer) then !!!! move_horizontal (-1); !!! EVE v2.3 find_range := eve$search (eve$x_target, REVERSE, how_exact, eve$$x_state_array {eve$$k_leading_whitespace}, replacing); !!!! move_horizontal (1); !!! EVE V2.3 so we can be reentered by dialog box else find_range := 0; endif; endif; ! ! ### LSE change ! ! In LSE, we don't need to search in the other direction if search fails. ! if NOT (get_info( lse$search, 'lse$auto_reverse' )) then if find_range = 0 then if get_info (eve$x_target, "type") = STRING then eve$message (EVE$_STRNOTFOUND, 0, eve$x_target); else eve$message (EVE$_STRNOTFOUND, 0, eve$x_printable_target); endif; position (saved_mark); return (0); endif; endif; ! ! ### end of LSE change ! if find_range = 0 ! didn't find in original direction then if ( replacing = 1 ) or ( lse$$x_replacement = 1) then position (saved_mark); return (FALSE); else if learn_abort ! Don't look in opposite dir if in LEARN SEQ then eve$message (EVE$_FINDFAIL); eve$message (EVE$_LEARNABORTBIG); position (saved_mark); return (FALSE); endif; if current_direction = FORWARD then other_direction := REVERSE; else other_direction := FORWARD; endif; position (text_mark); ! go back to original text if other_direction = FORWARD ! and look in other direction then if saved_mark <> end_of (current_buffer) then find_range := eve$search (eve$x_target, FORWARD, how_exact, eve$$x_state_array {eve$$k_leading_whitespace}, replacing); else find_range := 0; endif; else if saved_mark <> beginning_of (current_buffer) then !!! move_horizontal (-1); !!! EVE V2.3 find_range := eve$search (eve$x_target, REVERSE, how_exact, eve$$x_state_array {eve$$k_leading_whitespace}, replacing); !!! move_horizontal (1); !!! V2.3 so we can be reentered by dialog box else find_range := 0; endif; endif; if find_range = 0 then ! couldn't find in other direction either - give up if get_info (eve$x_target, "type") = STRING then eve$message (EVE$_STRNOTFOUND, 0, eve$x_target); else eve$message (EVE$_STRNOTFOUND, 0, eve$x_printable_target); endif; position (saved_mark); return (0); else if other_direction = FORWARD then ! found in other direction, go there? the_prompt := message_text (EVE$_FOUNDFORWARD, 1); else the_prompt := message_text (EVE$_FOUNDREVERSE, 1); endif; ! LSE change, use lse$prompt_boolean ! IF NOT lse$prompt_boolean( , find_reply, the_prompt, '', 'Y' ) THEN position (saved_mark); return (0); ELSE IF find_reply then set (other_direction, current_buffer); if move_flag then eve$position_in_middle (beginning_of (find_range)); endif; !+ ! LSE add to change eve$x_old_find_direction and ! direction in FIND dialog box !- eve$x_old_find_direction := CURRENT_DIRECTION; ! Uncomment to restore search and substitute dialog box live direction ! lse$$widget_set_search_direction; ! return (find_range); else position (saved_mark); return (0); endif; ENDIF; endif; endif; else if move_flag then eve$position_in_middle (beginning_of (find_range)); endif; return (find_range); endif; endprocedure; ! EVE$CORE.TPU Page 19 procedure eve$get_find_target ! Find subprocedure (target, how_exact, replacing; ! Set up for a find. ! If , use the direction in eve$x_old_find_direction; ! otherwise, use the buffer's current direction (OR the direction specified ! by a direction-changing terminator that terminates the find prompt). ! Parameters: ! target String to find - input + output ! how_exact eve$x_find_exact or eve$x_find_no_exact - output ! replacing 1 = called by eve_replace: allow a ! match at current cursor position and ! return if no string found ! 2 = called by wildcard_find ! 0 = called by a find procedure - input ! old_find 1 = called by eve$find - optional input old_find) local new_target, ! Local copy of target return_value, ! Value returned by eve$$build_pattern start_find_key, ! String describing key used to invoke find stop_find_key, ! String describing key used after prompt leading_whitespace, ! Boolean for including leading whitespace status, ! Status from set (widget) result, ! Result returned from eve$$test_find_terminator the_prompt, ! Prompt string execute_it, prefix, ! Execute arg postfix, ! Execute arg key_is_defined, ! Boolean for key press = "FIND xxx" saved_direction; ! Direction upon entry on_error [TPU$_CONTROLC]: if (saved_direction <> current_direction) and (get_info (saved_direction, "type") = KEYWORD) then set (saved_direction, current_buffer); endif; eve$learn_abort; abort; [OTHERWISE]: if (saved_direction <> current_direction) and (get_info (saved_direction, "type") = KEYWORD) then set (saved_direction, current_buffer); endif; endon_error; saved_direction := current_direction; start_find_key := last_key; if start_find_key <> 0 then if eve$test_synonym ("return", eve$$lookup_comment (start_find_key, "")) then start_find_key := DO; endif; endif; if replacing = 1 then eve$$remove_found_range; endif; eve$clear_message; if target <> "" then new_target := target; if start_find_key <> 0 then eve$$test_find_terminator (last_key); ! possibly change direction endif; else loop if current_direction = FORWARD then if replacing <> 2 ! <> wildcard find then if current_direction = eve$x_old_find_direction then the_prompt := lse$$k_forward_search_prompt; ! the_prompt := message_text (EVE$_FINDPROMPT, 1); else if (eve$$x_state_array {eve$$k_command_line_flag} = eve$k_invoked_by_menu) and (eve$$x_state_array {eve$$k_dialog_box}) then the_prompt := lse$$k_forward_search_prompt; ! the_prompt := message_text (EVE$_FINDPROMPT, 1); else the_prompt := lse$$k_forward2_search_prompt; ! the_prompt := message_text (EVE$_FINDPROMPT2, 1); endif; endif; else if current_direction = eve$x_old_find_direction then the_prompt := lse$$k_forward3_search_prompt; ! the_prompt := message_text (EVE$_WILDFINDPROMPT, 1); else if (eve$$x_state_array {eve$$k_command_line_flag} = eve$k_invoked_by_menu) and (eve$$x_state_array {eve$$k_dialog_box}) then the_prompt := lse$$k_forward3_search_prompt; ! the_prompt := message_text (EVE$_WILDFINDPROMPT, 1); else the_prompt := lse$$k_forward4_search_prompt; ! the_prompt := message_text (EVE$_WILDFINDPROMPT2, 1); endif; endif; endif; else if replacing <> 2 ! <> wildcard find then if current_direction = eve$x_old_find_direction then the_prompt := lse$$k_reverse_search_prompt; ! the_prompt := message_text (EVE$_REVPROMPT, 1); else if (eve$$x_state_array {eve$$k_command_line_flag} = eve$k_invoked_by_menu) and (eve$$x_state_array {eve$$k_dialog_box}) then the_prompt := lse$$k_reverse_search_prompt; ! the_prompt := message_text (EVE$_REVPROMPT, 1); else the_prompt := lse$$k_reverse2_search_prompt; ! the_prompt := message_text (EVE$_REVPROMPT2, 1); endif; endif; else if current_direction = eve$x_old_find_direction then the_prompt := lse$$k_reverse3_search_prompt; ! the_prompt := message_text (EVE$_WILDREVPROMPT, 1); else if (eve$$x_state_array {eve$$k_command_line_flag} = eve$k_invoked_by_menu) and (eve$$x_state_array {eve$$k_dialog_box}) then the_prompt := lse$$k_reverse3_search_prompt; ! the_prompt := message_text (EVE$_WILDREVPROMPT, 1); else the_prompt := lse$$k_reverse4_search_prompt; ! the_prompt := message_text (EVE$_WILDREVPROMPT2, 1); endif; endif; endif; endif; if (eve$$x_state_array {eve$$k_command_line_flag} = eve$k_invoked_by_menu) and (eve$$x_state_array {eve$$k_dialog_box}) then ! supersede the program bound to the find_ok button ! (cant call eve$$get_find_target cause data expected from widget) return (eve$k_async_prompting); else IF NOT lse$prompt_string( , new_target, the_prompt, '', lse$$search_string ) THEN if (saved_direction <> current_direction) and (get_info (saved_direction, "type") = KEYWORD) then set (saved_direction, current_buffer); endif; eve$learn_abort; abort; ENDIF; !+ ! LSE Changed ### ! ! if search_string is null, then searches previous search_string ! if last key is CTRL_Z_KEY, then it cancels the command !- if ((last_key = CTRL_Z_KEY) OR (last_key = F10)) then if (saved_direction <> current_direction) and (get_info (saved_direction, "type") = KEYWORD) then set (saved_direction, current_buffer); endif; eve$learn_abort; abort; endif; ! Test the terminator, and change direction if it's ! a direction-setting terminator. if start_find_key <> 0 then result := eve$$test_find_terminator (last_key); else result := 0; endif; if new_target = 0 then return (FALSE); endif; ! stay in loop if just a direction-setting key were pressed exitif not ((new_target = "") and (result)); endif; endloop; endif; if start_find_key <> 0 then stop_find_key := last_key; endif; if new_target = "" then ! allow both and ! (as well as wildcard versions) if start_find_key <> 0 then if (start_find_key = stop_find_key) or (eve$test_synonym ("find", eve$$lookup_comment (stop_find_key, ""))) then if eve$x_target = "" then eve$message (EVE$_NOPREVTARG); return (0); else ! use the direction for the prior set (eve$x_old_find_direction, current_buffer); if get_info (eve$x_target, "type") = STRING then eve$message (EVE$_FINDPREV, 0, eve$x_target); else eve$message (EVE$_FINDPREVWILD, 0, eve$x_printable_target); endif; endif; else ! ! ### LSE change ! ! if input search string is "" then it searches the previous ! search string. ! if lse$$search_string = "" then eve$message (EVE$_NOFIND); return (0); ! let caller set direction back if needed else new_target := lse$$search_string; endif; endif; else if lse$$search_string = "" then eve$message (EVE$_NOFIND); return (0); ! let caller set direction back if needed else new_target := lse$$search_string; endif; ! ! ### end of LSE change ! endif; else ! restore eve$$k_find_ok widget to invalid_event program ! insure a key = "FIND xxx" will always do a find next if start_find_key <> 0 then if (eve$$x_state_array {eve$$k_command_line_flag} = eve$k_invoked_by_key) and (start_find_key = stop_find_key) and (target <> "") then if (((get_info (eve$x_target, "type") = STRING) and (eve$x_target = target)) or ((get_info (eve$x_target, "type") = PATTERN) and (eve$x_printable_target = target))) then set (eve$x_old_find_direction, current_buffer); key_is_defined := TRUE; endif; endif; endif; if not key_is_defined then if replacing = 2 then if get_info (lse$search, 'lse$pattern') = lse$os_tpu then eve$x_target_pattern := new_target; return_value := 1; leading_whitespace := false; else return_value := eve$$build_pattern (new_target, eve$x_target_pattern, leading_whitespace); endif; if get_info (return_value, "type") = KEYWORD then ! (keyword means an error occurred) return (0); ! let caller set direction back if needed else if return_value ! eve$x_target_pattern is pattern string, e.g., then ! "\" = bol + abcd + eol execute_it := TRUE; else ! eve$x_target_pattern is a search string eve$x_target := eve$x_target_pattern; endif; endif; else if get_info (new_target, "type") = STRING then if eve$$x_state_array {eve$$k_find_whitespace} then if eve$$build_space_pattern (new_target, eve$x_target_pattern, leading_whitespace) then ! spaces in new_target execute_it := TRUE; else ! no spaces in new_target eve$x_target := eve$x_target_pattern; endif; else eve$x_target := new_target; endif; else execute_it := TRUE; endif; endif; if execute_it ! create a pattern variable for wildcard/whitespace then prefix := "return("; postfix := ")"; if length (eve$x_target_pattern) > (256 - length (prefix) - length (postfix)) then eve$message (EVE$_TARGETTOOBIG); return (FALSE); endif; eve$x_target := execute (prefix + eve$x_target_pattern + postfix); if (get_info (lse$search, 'lse$pattern') = lse$os_tpu) and (get_info(eve$x_target, "type") <> STRING) and (get_info(eve$x_target, "type") <> PATTERN) then message('Error in search pattern'); return (FALSE); endif; endif; if get_info (new_target, "type") = STRING then eve$x_printable_target := new_target; endif; eve$$x_state_array {eve$$k_leading_whitespace} := leading_whitespace; endif; endif; ! ! ### LSE change here ! !!! eve$set_find_target_case(how_exact); ! lse$$search_get_how_exact(how_exact); return (TRUE); ! let caller set direction back if needed endprocedure; procedure eve$$insert_here ! Insert text here (the_paste_buffer) local line_left_margin; on_error [OTHERWISE]: eve$learn_abort; endon_error; if eve$test_if_modifiable (current_buffer) then if beginning_of (the_paste_buffer) <> end_of (the_paste_buffer) then if current_offset = 0 then if mark (FREE_CURSOR) <> end_of (current_buffer) then ! remember to honor this line's left margin line_left_margin := get_info (mark (FREE_CURSOR), "left_margin"); else line_left_margin := get_info (current_buffer, "left_margin"); endif; endif; if eve$insert_text (the_paste_buffer) = 0 then eve$learn_abort; return (FALSE); else move_horizontal (-1); ! prevent erasing the line break if the paste buffer last line ! is unmodifiable if get_info (mark (NONE), "modifiable") then erase (create_range (mark (NONE), mark (NONE), NONE)); if (get_info (the_paste_buffer, "record_count") = 1) and (line_left_margin <> 0) then ! no line-break was pasted, restore line's left margin set (RECORD_ATTRIBUTE, mark (FREE_CURSOR), LEFT_MARGIN, line_left_margin); endif; else move_horizontal (1); endif; eve$show_first_line; return (TRUE); endif; endif; ! ! ### lse change ### ! LSE will not output the following messages ! ! if eve$x_select_position <> 0 ! then ! eve$message (EVE$_NOINSUSEREM); ! else ! eve$message (EVE$_NOINSUSESEL); ! endif; ! endif; eve$learn_abort; return (FALSE); endprocedure; procedure eve$init_postprocedure !EVE's init postprocedure local saved_mark, initial_position; on_error [OTHERWISE]: eve$$restore_position (saved_mark); endon_error; eve$$x_attrs_modified := FALSE; ! Reset in case /COMMAND modified attributes ! Execute logic for initialization files, user-supplied if any exists. ! ! LSE change here: LSE doesn't have to do EVE$INIT initialization ?? ! !if get_info (eve$$x_dcl_init_file_pgm, "type") = UNSPECIFIED !then ! eve$dcl_init_file_logic ! EVE default logic !else ! if execute (eve$$x_dcl_init_file_pgm) ! User specified logic ! then ! eve$dcl_init_file_logic ! EVE default logic ! endif; !endif; ! ! end of LSE change ! ! If EVE is in control of the interface, e.g., the windows haven't been ! torn down by a call to EVE$TEARDOWN_WINDOWS: ! - Create the default buffer, copying the attributes from the ! eve$x_source_for_default_buffer as set by tpu$local_init, /COMMAND, ! and /INITIALIZATION. ! - Ensure that the initial editing position is not no the borders ! of the screen (as might happen from a /START_POSITION). ! If EVE is not in control of the interface: ! - Create the default buffer using TPU's default attributes. ! ! NOTE: eve$display_choices uses the fact that the default buffer is not ! created until this time during initialization in order to know if ! a command is from the /COMMAND file. ! if eve$x_buf_str_defaults = tpu$k_unspecified ! then ! eve$x_buf_str_defaults := "$Defaults$"; ! endif; if eve$eve_in_control then ! ! ### LSE change ### ! ! if get_info (eve$x_source_for_default_buffer, "journaling") ! then ! eve$default_buffer := create_buffer (eve$x_buf_str_defaults, "", ! eve$x_source_for_default_buffer, ! "NL:"); ! no journal file ! else ! eve$default_buffer := create_buffer (eve$x_buf_str_defaults, "", ! eve$x_source_for_default_buffer); ! endif; ! initial_position := mark (FREE_CURSOR); if initial_position <> beginning_of (current_buffer) then eve$position_in_middle (initial_position); endif; ! Remember if a paragraph_indent was set on the default buffer: if eve$$x_paragraph_indent {eve$x_source_for_default_buffer} <> tpu$k_unspecified then eve$$x_paragraph_indent {eve$default_buffer} := eve$$x_paragraph_indent { eve$x_source_for_default_buffer }; endif; %if eve$x_option_decwindows %then ! layered applications can delay menu creation by assigning to this ! variable in a module pre_init if eve$x_delay_menu_creation = tpu$k_unspecified then eve$manage_menu_bar; ! put up the menu_bar endif; %endif ! ! else ! ! EVE$SETUP_WINDOWS will manage the menu_bar if not already managed ! ! eve$default_buffer := create_buffer (eve$x_buf_str_defaults); endif; ! LSE CHANGE - we are creating and setting the attributes on EVE$DEFAULT_BUFFER. ! !set (MODIFIABLE, eve$default_buffer, OFF); ! GET FILE, BUFFER will override !set (NO_WRITE, eve$default_buffer); ! GET FILE, BUFFER will override !set (SYSTEM, eve$default_buffer); ! Start buffer journaling on default buffer so journaling will be ! inherited by user buffers. ! if eve$$x_buffer_change_journaling ! then ! if not get_info (eve$default_buffer, "journaling") ! then ! set (JOURNALING, eve$default_buffer, ON, "NL:"); ! endif; ! endif; ! Tell user if neither keystroke or buffer change journaling ! if (not eve$$x_buffer_change_journaling) and ! (get_info (SYSTEM, "journal_file") = "") ! then ! eve$message (TPU$_NOJOURNAL); ! endif; ! for ungrab/grab of input focus !LSE CHANGE - only get this information if we are displaying ! IF GET_INFO(COMMAND_LINE, "display") THEN eve$$x_saved_window := current_window; eve$$x_saved_buffer := current_buffer; ENDIF; ! If user specified ambiguous input file name, then do a GET FILE and ! complete startup (after displaying the choices buffer). !if eve$$x_ambiguous_input_file <> 0 !then ! if (current_buffer <> eve$x_main_buffer) and ! (not get_info (current_buffer, "system")) ! then ! ! user created buffer in /command or /init, delete buffer Main and ! ! make eve$x_main_buffer point to the current buffer ! delete (eve$x_main_buffer); ! ! eve$x_main_buffer := current_buffer; ! endif; ! ! ! this will leave us in the command window with choices displayed ! eve_get_file (eve$$x_ambiguous_input_file); !endif; ! Don't enter TPU's main loop without /DISPLAY if not get_info (COMMAND_LINE, "display") then exit; endif; ! Clear startup flag that lasts from end of eve$init_procedure until ! end of eve$init_postprocedure eve$x_post_starting_up := FALSE; endprocedure; ! eve$init_postprocedure procedure eve_overstrike_mode ! Change to overstrike mode lse_set_buffer_text(overstrike); eve$update_status_lines; return (TRUE); endprocedure; ! eve_overstrike_mode procedure eve_insert_mode ! Change to insert mode lse_set_buffer_text(insert); eve$update_status_lines; return (TRUE); endprocedure; ! eve_insert_mode