! EVE$EXTEND.TPU 31-DEC-1992 10:25 Page 1 module eve$extend ident "V03-011" ! ! COPYRIGHT © 1987,1992 BY ! DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS ! ALL RIGHTS RESERVED ! ! THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED ! ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE ! INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR ANY OTHER ! COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY ! OTHER PERSON. NO TITLE TO AND OWNERSHIP OF THE SOFTWARE IS HEREBY ! TRANSFERRED. ! ! THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE ! AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT ! CORPORATION. ! ! DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS ! SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL. ! !++ ! FACILITY: ! DECTPU - Text Processing Utility ! EVE - Extensible Versatile Editor ! ! ABSTRACT: ! This is the source program for the EVE interface extend, save, and ! define key features. This file was obtained from the old ! evesecini.tpu file. ! ! ENVIRONMENT: ! OpenVMS VAX, OpenVMS AXP, RISC/ULTRIX ! !Author: Bill Robinson ! ! CREATION DATE: 10-Oct-1986 ! ! MODIFIED BY: !-- ! EVE$EXTEND.TPU Page 2 !++ ! Table of Contents ! ! EVE$EXTEND.TPU ! 31-DEC-1992 10:25 ! ! Procedure name Page Description ! -------------- ---- ------------ ! ! eve$set_section_attributes 3 overridden by attr. logic ! eve$$extend_exit_handler 4 Shell for common quit/exit logic ! eve$$extend_quit_handler 4 Shell for common quit/exit logic ! eve$$ext_comm_quitexit_handler 4 Quit/exit common logic ! eve_define 5 Synonym for DEFINE KEY ! eve_define_key 6 User key definitions ! eve_remember 7 Bind learn sequence to key (may be mouse key) ! eve$$remember 7 Guts of REMEMBER ! eve$define_key 8 EVE's version of the TPU builtin ! eve_undefine 9 Synonym for UNDEFINE KEY ! eve_undefine_key 10 undefine a key definition ! eve_save 11 Resolve ambiguity EVE vs TPU ! eve_save_extended 11 Resolve ambiguity EVE vs TPU ! eve_extend_tpu 11 Synonym for extend EVE ! eve_extend_eve 12 Compile buffer or procedures ! eve_extend_this 13 Extend the procedure we're in ! eve_extend 14 EXT => EXT TH, EXT foo => EXT EVE ! eve_extend_all 14 Synonym for EXTEND EVE * ! eve_learn 15 Learn a sequence of keys ! eve_save_extended_tpu 16 syn. for save extended eve ! eve_save_extended_eve 17 Save environment in section file ! eve_set_shift_key 18 Synonym for SET GOLD KEY ! eve_set_gold_key 19 Define a new GOLD key ! eve_set_noshift_key 20 Synonym for SET NOGOLD KEY ! eve_set_nogold_key 20 Remove a GOLD key ! eve_tpu 21 Execute a DECTPU command ! eve$numeric_keys 22 Define numeric keypad ! eve_set_keypad_numeric 22 Set keyapd to numeric ! eve_set_keypad_vt100 23 Set keypad to VT100 ! eve$set_keypad_vt100_1 23 Set keypad to VT100 ! eve_save_attributes 24 interactive prompting for file ! eve_set_default_command_file 25 for use in saving attributes ! eve_set_nodefault_command_file 25 undefine default command file ! eve_set_default_section_file 26 for use in saving attributes ! eve_set_nodefault_section_file 26 undefine default section file ! eve_set_section_file_prompting 27 allow settings saving section file ! eve_set_nosection_file_prompting 27 for settings saving section file ! eve_set_exit_attribute_check 28 check/prompt on modified attributes ! eve_set_noexit_attribute_check 28 check/prompt on modified attributes ! eve$attr_save_nocheck 29 supress saving in section file ! eve$define_attr 30 settings to be saved accross sessions ! eve$locate_eve_generated_code 31 in command file ! eve$$locate_eve_generated_attrs 32 in command file ! eve$$build_attr_code 33 As a range or buffer of code ! eve$$accumulate_attrs 34 Accumulates a "before" picture ! eve$clear_accumulated_attrs 34 Reset ! eve$restore_accumulated_attrs 35 re-enstate settings ! eve$$get_default_command_file 36 Derives or returns it !-- ! EVE$EXTEND.TPU Page 3 procedure eve$set_section_attributes ! overridden by attr. logic ! Dummy procedure overridden by user attributes logic endprocedure; ! eve$set_section_attributes ! EVE$EXTEND.TPU Page 4 procedure eve$$extend_exit_handler ! Shell for common quit/exit logic return eve$$ext_comm_quitexit_handler; endprocedure ! eve$$extend_exit_handler procedure eve$$extend_quit_handler ! Shell for common quit/exit logic return eve$$ext_comm_quitexit_handler; endprocedure ! eve$$extend_quit_handler procedure eve$$ext_comm_quitexit_handler ! Quit/exit common logic ! Note: exit and quit handler status meaning is the REVERSE of standard ! EVE status returns. FALSE: handler wants EVE to continue with ! default actions. ! TRUE: handler wanst EVE to supress its own ! default actions. ! For EXIT and QUIT handlers which want EVE to continue the exit or ! quit, this means return FALSE if all went well! if eve$$x_attrs_modified and eve$$x_attr_exit_check then ! If the user has modified attributes during the session, we will prompt ! for a method to save those attributes if eve$insist_y_n (message_text (EVE$_ATTRPROMPT, tpu$k_message_text)) then ! OK, s/he wants to save the attributes return not (eve_save_attributes); ! interactive prompting for file else ! User doesn't want to save attributes at all: just return eve$message (EVE$_ATTRNOTSAVED); endif; endif; return (FALSE); ! return status meaning is the REVERSE of standard endprocedure ! eve$$ext_comm_quitexit_handler ! EVE$EXTEND.TPU Page 5 procedure eve_define ! Synonym for DEFINE KEY (key_string, define_parameter) return (eve_define_key (key_string, define_parameter)); endprocedure; ! eve_define ! EVE$EXTEND.TPU Page 6 procedure eve_define_key ! User key definitions (key_string, define_parameter) ! ! Associate a key with an Eve command. Prompts for the key. ! Defined keys can be indentified by a leading space in the comment field. ! Need this to be able to differentiate during keypad initialization. ! ! Parameters: ! key_string Optional string containing key name - input ! define_parameter String containing command name - input ! ! DEFINE KEY will allow the key to be specified on either ! the the command line (or in an initialization file) or to copy ! the definition of a key in one keypad to a user-defined key. ! ! Format: DEFINE KEY[=key-name¹] {command | keypad-name key-name²} ! ! where ! ! key-name¹ The name of the key being bound to. ! Key-name syntax is described below. ! ! eve-command The command to be execute when the key is ! struck. ! ! keypad-name Keypad to copy a key definition from. ! ! key-name² Key in the specified keypad to copy to ! the key specified by key-name¹. ! ! NOTE: A space is not a permitted separator after either CTRL, SHIFT, or GOLD. ! ! The following are legal examples of this command: ! ! DEFINE KEY fill ! DEFINE KEY WPS SHIFT/R ! DEFINE KEY=PF2 help keypad ! DEFINE KEY=CTRL_F fill ! DEFINE KEY=SHIFT/1 one window ! DEFINE KEY=GOLD/CTRL-A insert mode ! DEFINE KEY=PF3 EDT MINUS ! DEFINE KEY=GOLD/PF3 EDT GOLD/MINUS local command_name, ! Local copy of define_parameter temp, ! Temporary got_key, ! boolean: is key specified on command line the_word, ! parsed pieces of key to be defined the_key, ! local copy of key_string the_key_name, ! key_name of the key to define the_phrase, ! local copy of define_parameter dollar_index, ! Index to "$" in key_map string under_index, ! Index to "_" in key_map string mouse_number, ! Number of mouse clicked key_pressed, ! Set if defined key was pressed filtered_key, ! Key returned from key validation routine key_msg; ! EVE message to issue for input key on_error [TPU$_NOTDEFINABLE]: eve$message (EVE$_NOKEYDEF); eve$learn_abort; return (FALSE); [OTHERWISE]: endon_error; ! A bit of initialization... the_key := key_string; the_phrase := define_parameter; ! see if "=keyname" were specified (e.g., DEFINE KEY=KP5) if the_key <> "" then if substr (the_key, 1, 1) = "=" then ! valid key string? got_key := TRUE; ! Check for space between = and key string, or just a = if (substr (the_key, 2, length (the_key) - 1) = "") then the_key := "=" + eve$$get_next_word (the_phrase, " "); endif; else ! not a key specification -- must be first word of command the_phrase := the_key + " " + the_phrase; ! append into 1 command endif; endif; ! ! Now parse up command string ! if not (eve$prompt_string (the_phrase, command_name, eve$x_eve_command_prompt, message_text (EVE$_NOKEYDEF, 1))) then eve$learn_abort; return (FALSE); endif; ! ! now parse up the key ! if not got_key then the_key_name := eve$prompt_key (message_text (EVE$_KEYTODEF, 1), 1); ! 1 = allow mouse keys in user windows if the_key_name = 0 then eve$learn_abort; return (FALSE); endif; got_key := TRUE; key_pressed := TRUE; else the_key_name := eve$$parse_keystring (substr (the_key, 2, length (the_key) - 1)); if the_key_name = 0 then eve$learn_abort; return (FALSE); endif; endif; ! ! Run entered key through input filter ! if eve$$filter_key (the_key_name, filtered_key, key_msg) then eve$$define_key (command_name, filtered_key, eve$x_user_keys); if eve$test_synonym ("do", command_name) then eve$$add_do_key (filtered_key, eve$x_user_keys); endif; case key_msg [EVE$_SUBSTITUTE]: eve$message (EVE$_SUBSTITUTE, 0, eve$key_name (the_key_name), eve$key_name (filtered_key)); endcase; else eve$message (key_msg); eve$learn_abort; return (FALSE); endif; return (TRUE); endprocedure; ! eve_define_key ! EVE$EXTEND.TPU Page 7 !++ ! Description ! Remember a learn sequence. Must be bound to a key in order to work; ! cannot be used from command line !-- procedure eve_remember ! Bind learn sequence to key (may be mouse key) eve$$remember (TRUE); endprocedure; ! eve_remember procedure eve$$remember ! Guts of REMEMBER (display_errors) local learn_sequence, ! Learn sequence returned by end_learn builtin learn_key, ! Keyword for key to bind sequence to remember_key, ! Keyword for last key pressed before this proc mouse_number, ! Number of mouse clicked define_error, ! Integer - true if recursive key definition filtered_key, ! Key returned from key validation routine key_msg; ! EVE message to issue for input key on_error [TPU$_NOTLEARNING]: if display_errors then eve$message (EVE$_NOREMEM); eve$learn_abort; endif; return (FALSE); [TPU$_RECURLEARN]: eve$message (EVE$_NORECURS); define_error := 1; [OTHERWISE]: endon_error; remember_key := last_key; ! Insure REMEMBER isn't entered from the command line - that doesn't work. if eve$$x_state_array {eve$$k_command_line_flag} then if eve$test_synonym ("remember", eve$$lookup_comment (CTRL_R_KEY, eve$x_key_map_list)) then eve$message (EVE$_REMEMBERCTRLR); else eve$message (EVE$_REMEMBERKEY); endif; eve$learn_abort; return (FALSE); endif; learn_sequence := learn_end; eve$set_message (""); ! restore the null message as the default loop learn_key := eve$prompt_key (message_text (EVE$_KEYTOLEARN, 1), 1); ! 1 = allow mouse keys in user windows if learn_key = 0 then eve$learn_abort; return (FALSE); endif; ! Return gets you out without redefining a key if learn_key = RET_KEY then eve$message (EVE$_SEQNOTREM); eve$learn_abort; return (FALSE); endif; ! ! Run entered key through input filter ! if eve$$filter_key (learn_key, filtered_key, key_msg) then ! ! Reject user binding sequence to key that invoked this procedure. ! if remember_key = filtered_key then eve$message (EVE$_NOLRNREMEMBER); else define_key (learn_sequence, filtered_key, eve$x_sequence, eve$x_user_keys); if define_error then ! recursive learn caught by on_error define_error := 0; else case key_msg [EVE$_SUBSTITUTE]: eve$message (EVE$_SUBSTITUTE, 0, eve$key_name (learn_key), eve$key_name (filtered_key)); endcase; exitif; endif; endif; else eve$message (key_msg); eve$learn_abort; endif; ! end of if endloop; eve$message (EVE$_SEQREMMED); return (TRUE); endprocedure; ! eve$$remember ! EVE$EXTEND.TPU Page 8 procedure eve$define_key ! EVE's version of the TPU builtin (the_command, the_key; ! Description ! EVE's version of TPU builtin DEFINE_KEY. It only allows a single ! procedure call to be bound to the key. This procedure adds an ! error handler and insures that the program bound to the key returns ! a value (TRUE for success and FALSE for failure).tt ! Parameters (input) ! the_command = string of TPU statements to be bound to the_key ! the_key = keyword for the key to define ! the_comment = comment string (if unspecified, set to "") ! the_keymap = key_map or key_map_list (if unspecified, set to ! eve$x_user_keys = the user key_map) the_comment, the_keymap) local local_command, local_comment, local_keymap; on_error [OTHERWISE]: endon_error; local_command := eve$$kt_return + the_command; if the_comment = tpu$k_unspecified then local_comment := ""; else local_comment := the_comment; endif; if the_keymap = tpu$k_unspecified then local_keymap := eve$x_user_keys; else local_keymap := the_keymap; endif; define_key (local_command, the_key, local_comment, local_keymap); endprocedure; ! eve$define_key ! EVE$EXTEND.TPU Page 9 procedure eve_undefine ! Synonym for UNDEFINE KEY (key_string) ! name of key to undefine return (eve_undefine_key (key_string)); endprocedure; ! eve_undefine ! EVE$EXTEND.TPU Page 10 procedure eve_undefine_key ! undefine a key definition (key_string) ! Undefine a defined key in the user key map. GOLD keys are not allowed to be ! undefined here - the user must use SET NOGOLD. DO keys are allowed to be ! undefined provided at least one other DO key exists on the keypad. local the_key, ! Key to be undefined the_key_name; ! KEYWORD of key to undefine the_key := key_string; if the_key <> "" then if substr (the_key, 1, 1) = "=" then the_key := substr (the_key, 2, length (the_key)); ! Take = off endif; the_key_name := eve$$parse_keystring (the_key); ! into KEYWORD else the_key_name := eve$prompt_key (message_text (EVE$_KEYTOUNDEF, 1), 1); ! 1 = allow mouse keys in user windows endif; if the_key_name = 0 then eve$learn_abort; return (FALSE); endif; if the_key_name = get_info (eve$current_key_map_list, "shift_key") then ! it's the shift key eve$message (EVE$_NOGOLDUNDEF); eve$learn_abort; return (FALSE); else %if eve$x_option_decwindows %then if get_info (the_key_name, "type") = ARRAY then if the_key_name {0} = eve$k_user_window then the_key_name := the_key_name {1}; if eve$is_mouse_down (the_key_name) then ! Convert DOWN's into CLICK's case the_key_name [M2DOWN]: the_key_name := M2CLICK; [M3DOWN]: the_key_name := M3CLICK; [M4DOWN]: the_key_name := M4CLICK; [M5DOWN]: the_key_name := M5CLICK; endcase; endif; endif; endif; %endif if lookup_key (the_key_name, KEY_MAP) <> eve$x_user_keys then eve$message (EVE$_NOKEYUNDEF); eve$learn_abort; return (FALSE); else ! is in eve$x_user_keys if eve$test_synonym ("do", eve$$lookup_comment (the_key_name, "")) then ! check if last available VALID DO key - if yes don't redefine it if not eve$$redefine_do_key (the_key_name, "", 0, 1) then eve$message (EVE$_NODEFDO); ! can't delete last DO key eve$learn_abort; return (FALSE); endif; else eve$$undefine_key (the_key_name, eve$x_user_keys); if not eve$$x_state_array {eve$$k_in_init_file} then eve$message (EVE$_KEYUNDEF); endif; endif; ! if do endif; ! if user keymap endif; return (TRUE); endprocedure; ! eve_undefine_key ! EVE$EXTEND.TPU Page 11 procedure eve_save ! Resolve ambiguity EVE vs TPU (extend_parameter) return (eve_save_extended_eve (extend_parameter)); endprocedure; ! eve_save procedure eve_save_extended ! Resolve ambiguity EVE vs TPU (extend_parameter) return (eve_save_extended_eve (extend_parameter)); endprocedure; ! eve_save_extended procedure eve_extend_tpu ! Synonym for extend EVE (extend_parameter) return (eve_extend_eve (extend_parameter)); endprocedure; ! eve_extend_tpu ! EVE$EXTEND.TPU Page 12 procedure eve_extend_eve ! Compile buffer or procedures (extend_parameter) ! Compile the procedure in the current buffer. If name = "*", compile ! the entire buffer. Otherwise, compile procedure with this name. ! Procedure and endprocedure statements must start in column 1. ! ! Parameters: ! ! extend_parameter String containing procedure name or * - input local procedure_name, ! Local copy of extend_parameter saved_mark, ! Marker for current cursor position this_informational, ! Keyword for display of informational messages search_pattern, ! Pattern used to search for start of procedure procedure_pattern, ! Pattern used to skip the PROCEDURE keyword search_range, ! Temporary range for start of/end of procedure case_status, ! For return status value start_procedure, ! Marker at beginning of "procedure" procedure_range, ! Range including procedure name identifier this_name, ! Procedure name string from procedure_range whole_procedure_range, ! Range including entire procedure definition found_a_procedure; ! True if procedure is found on_error [TPU$_CONTROLC]: eve$$restore_position (saved_mark); eve$learn_abort; abort; [TPU$_COMPILEFAIL]: ! DECTPU will produce message eve$message (EVE$_NOTCOMPILE); eve$$restore_position (saved_mark); set (INFORMATIONAL, this_informational); eve$learn_abort; return (FALSE); [OTHERWISE]: eve$$restore_position (saved_mark); endon_error; if not eve$prompt_string (extend_parameter, procedure_name, message_text (EVE$_PROCPROMPT, 1), message_text (EVE$_NOTEXTEND, 0)) then eve$learn_abort; return (FALSE); endif; eve$cleanse_string (procedure_name); change_case (procedure_name, UPPER); position (search (ANCHOR, FORWARD)); ! snap cursor - no padding saved_mark := mark (FREE_CURSOR); if get_info (SYSTEM, "informational") then this_informational := ON; else this_informational := OFF; endif; if procedure_name = "*" then eve$message (EVE$_EXTENDING); set (INFORMATIONAL, ON); compile (current_buffer); set (INFORMATIONAL, this_informational); eve$message (EVE$_EXTENDED); return (TRUE); endif; erase (eve$choice_buffer); eve$message (EVE$_FINDINGPROC, 0, procedure_name); position (beginning_of (current_buffer)); procedure_pattern := ANCHOR + "procedure" + span (eve$x_whitespace); search_pattern := LINE_BEGIN + "procedure" + span (eve$x_whitespace) + procedure_name; loop search_range := search_quietly (search_pattern, FORWARD); exitif search_range = 0; position (beginning_of (search_range)); ! Get entire name of this procedure start_procedure := mark (FREE_CURSOR); position (end_of (search_quietly (procedure_pattern, FORWARD))); move_horizontal (1); procedure_range := search_quietly (eve$pattern_procname, FORWARD); ! Find corresponding endprocedure search_range := search_quietly (eve$pattern_endprocedure, FORWARD); if search_range = 0 then found_a_procedure := 0; else position (end_of (search_range)); whole_procedure_range := create_range (start_procedure, mark (NONE), NONE); found_a_procedure := 1; endif; ! If we have a whole procedure, check for exact match etc. if found_a_procedure then this_name := substr (procedure_range, 1, length (procedure_range)); change_case (this_name, UPPER); if this_name = procedure_name then erase (eve$choice_buffer); eve$add_choice (this_name); exitif 1; else eve$add_choice (this_name); endif; endif; position (start_procedure); position (LINE_END); move_horizontal (1); endloop; case_status := FALSE; case get_info (eve$choice_buffer, "record_count") from 0 to 1 [0]: eve$message (EVE$_PROCNOTFOUND, 0, procedure_name); [1]: eve$message (EVE$_EXTENDING); set (INFORMATIONAL, ON); compile (whole_procedure_range); set (INFORMATIONAL, this_informational); eve$message (EVE$_EXTENDEDBY, 0, this_name); case_status := TRUE; [OUTRANGE]: eve$display_choices (message_text (EVE$_AMBPROC, 0, procedure_name), !** How do we get the synonym for the key that was defined to this command? "extend tpu ", procedure_name); endcase; position (saved_mark); return (case_status); endprocedure ! eve_extend_eve ! EVE$EXTEND.TPU Page 13 procedure eve_extend_this ! Extend the procedure we're in local saved_mark, saved_informational, procedure_range, endprocedure_range, name_range, whole_procedure_range; on_error [TPU$_CONTROLC]: eve$$restore_position (saved_mark); set (INFORMATIONAL, saved_informational); eve$learn_abort; abort; [TPU$_COMPILEFAIL]: ! DECTPU will produce message eve$message (EVE$_NOTCOMPILE); eve$$restore_position (saved_mark); set (INFORMATIONAL, saved_informational); eve$learn_abort; return (FALSE); [OTHERWISE]: eve$$restore_position (saved_mark); set (INFORMATIONAL, saved_informational); endon_error; position (search (ANCHOR, FORWARD)); ! no padding saved_mark := mark (FREE_CURSOR); if get_info (SYSTEM, "informational") then saved_informational := ON; else saved_informational := OFF; endif; procedure_range := search_quietly (eve$pattern_startprocedure, REVERSE); if procedure_range = 0 then eve$message (EVE$_NOPROCEDURE); eve$learn_abort; return (FALSE); else endprocedure_range := search_quietly (eve$pattern_endprocedure, REVERSE); if endprocedure_range <> 0 then ! Allow cursor to be at start of line below the endprocedure position (endprocedure_range); position (LINE_END); move_horizontal (1); if (mark (FREE_CURSOR) < saved_mark) and (beginning_of (endprocedure_range) > beginning_of (procedure_range)) then position (saved_mark); eve$message (EVE$_NOPROCEDURE); eve$learn_abort; return (FALSE); endif; endif; position (end_of (procedure_range)); move_horizontal (1); name_range := search_quietly (eve$pattern_procname, FORWARD); endprocedure_range := search_quietly (eve$pattern_endprocedure, FORWARD); if endprocedure_range <> 0 then whole_procedure_range := create_range (beginning_of (procedure_range), end_of (endprocedure_range), NONE); else ! If there's no ENDPROCEDURE, try to extend to the end of the ! buffer, and let the parser tell that ENDPROCEDURE is missing ! whole_procedure_range := create_range (beginning_of (procedure_range), BUFFER_END, NONE); endif; eve$message (EVE$_EXTENDING); set (INFORMATIONAL, ON); compile (whole_procedure_range); set (INFORMATIONAL, saved_informational); eve$message (EVE$_EXTENDEDBY, 0, substr (name_range, 1, length (name_range))); endif; position (saved_mark); return (TRUE); endprocedure ! eve_extend_this ! EVE$EXTEND.TPU Page 14 procedure eve_extend ! EXT => EXT TH, EXT foo => EXT EVE (extend_parameter) if extend_parameter = "" then return (eve_extend_this); else return (eve_extend_eve (extend_parameter)); endif; endprocedure; ! eve_extend procedure eve_extend_all ! Synonym for EXTEND EVE * return (eve_extend_eve ("*")); endprocedure; ! eve_extend_all ! EVE$EXTEND.TPU Page 15 ! Learn mode procedures procedure eve_learn ! Learn a sequence of keys on_error [TPU$_ONELEARN]: if eve$test_synonym ("remember", eve$$lookup_comment (CTRL_R_KEY, eve$x_key_map_list)) then eve$message (EVE$_ENDLEARNCTRLR); else eve$message (EVE$_ENDLEARN); endif; eve$learn_abort; return (FALSE); [OTHERWISE]: endon_error; learn_begin (EXACT); if eve$test_synonym ("remember", eve$$lookup_comment (CTRL_R_KEY, eve$x_key_map_list)) then eve$set_message (EVE$_LEARNPROMPT); else eve$set_message (EVE$_LEARNPROMPTKEY); endif; return (TRUE); endprocedure; ! eve_learn ! EVE$EXTEND.TPU Page 16 procedure eve_save_extended_tpu ! syn. for save extended eve (save_parameter) return (eve_save_extended_eve (save_parameter)); endprocedure; ! eve_save_extended_tpu ! EVE$EXTEND.TPU Page 17 procedure eve_save_extended_eve ! Save environment in section file (save_parameter) ! String containing name of section file - input local save_file, ! Local copy of save_parameter saved_window, saved_mark, default_save_parameter, ! Used in deterining if a default spec exists results, ! of attribute building. Not used. saved_informational, ! Keyword for display of informational messages saved_success; ! Keyword for display of success messages on_error [TPU$_CONTROLC]: eve$$restore_position (saved_window, saved_mark); set (INFORMATIONAL, saved_informational); set (SUCCESS, saved_success); [TPU$_COMPILEFAIL]: eve$message (EVE$_ATTRNOTSAVED); ! Define the procedure as null since the attributes code won't ! compile - we need to be able to execute this procedure on startup. compile ("procedure eve$set_section_attributes; endprocedure"); [OTHERWISE]: eve$$restore_position (saved_window, saved_mark); set (INFORMATIONAL, saved_informational); set (SUCCESS, saved_success); endon_error; position (search (ANCHOR, FORWARD)); ! prevent padding saved_mark := mark (FREE_CURSOR); saved_window := current_window; if eve$$x_attrs_modified and eve$$x_attr_save_check then ! Save user attributes in the section file by overriding the ! eve$build_attrs procedure with the attributes code if eve$$reserve_scratch_buffer then set (INSERT, eve$$x_scratch_buffer); erase (eve$$x_scratch_buffer); position (beginning_of (eve$$x_scratch_buffer)); copy_text ("procedure eve$set_section_attributes;"); eve$$build_attr_code (end_of (eve$$x_scratch_buffer), results); position (end_of (eve$$x_scratch_buffer)); copy_text ("endprocedure;"); compile (eve$$x_scratch_buffer); eve$$release_scratch_buffer; eve$$x_attrs_modified := FALSE; else eve$message (EVE$_ATTRNOTSAVED); endif; else if not eve$$x_attr_exit_check then eve$message (EVE$_ATTRNOTSAVED); endif; endif; if eve$$x_section_default <> "" then default_save_parameter := eve$$x_section_default; else default_save_parameter := save_parameter; endif; if eve$prompt_string (default_save_parameter, save_file, message_text (EVE$_SAVEPROMPT, 1), message_text (EVE$_NOTSAVED, 0)) then if get_info (SYSTEM, "informational") then saved_informational := ON; else saved_informational := OFF; endif; if get_info (SYSTEM, "success") then saved_success := ON; else saved_success := OFF; endif; ! Make a backup copy (if enabled on ULTRIX), fail if couldn't backup if not eve$backup_file (0, save_file, eve$x_section_version, eve$x_backup_string, eve$x_last_section_backup) then eve$$restore_position (saved_window, saved_mark); return (FALSE); endif; set (INFORMATIONAL, OFF); set (SUCCESS, OFF); eve$$save_settings; ! save GOLD and DO key arrays set (INFORMATIONAL, ON); set (SUCCESS, ON); save (save_file); set (INFORMATIONAL, saved_informational); set (SUCCESS, saved_success); eve$$restore_position (saved_window, saved_mark); return (TRUE); else eve$learn_abort; eve$$restore_position (saved_window, saved_mark); return (FALSE); endif; endprocedure; ! eve_save_extended_eve ! EVE$EXTEND.TPU Page 18 procedure eve_set_shift_key ! Synonym for SET GOLD KEY (key_string) ! Allow users to define a gold key (like EDT or WPS gold key) in ! the eve$x_user_keys key_map. Allows undefining the GOLD key by: ! SET GOLD KEY GOLD/current-gold-key ! SET GOLD KEY SHIFT/current-gold-key ! ^ ! |___ or "-" or "_" eve$message (EVE$_SHIFTOBSOLETE); return (eve_set_gold_key (key_string)); endprocedure ! eve_set_shift_key ! EVE$EXTEND.TPU Page 19 procedure eve_set_gold_key ! Define a new GOLD key (; key_string) local the_key, the_keypad, result; if key_string <> "" then the_key := eve$$parse_keystring (key_string); else the_key := eve$prompt_key (message_text (EVE$_KEYFORSHIFT, 1)); endif; if the_key = 0 then eve$learn_abort; return (FALSE); endif; result := eve$set_gold_key (the_key, eve$x_user_keys); eve$message (result); if int (result) then ! save current keypad's gold key (if it has one) return (eve$set_user_gold (the_key)); else eve$learn_abort; return (FALSE); endif; endprocedure ! eve_set_gold_key ! EVE$EXTEND.TPU Page 20 procedure eve_set_noshift_key ! Synonym for SET NOGOLD KEY ! Allow users to undefine the gold key in the eve$x_user_keys key_map eve$message (EVE$_SHIFTOBSOLETE); return (eve_set_nogold_key); endprocedure ! eve_set_noshift_key procedure eve_set_nogold_key ! Remove a GOLD key ! Provide synonym SET NOSHIFT KEY for SET NOGOLD KEY ! Restore any keypad gold key that was hidden by SET GOLD KEY, and ! indicate no user gold key is defined now return (eve$set_user_gold (OFF)); endprocedure; ! eve_set_nogold_key ! EVE$EXTEND.TPU Page 21 procedure eve_tpu ! Execute a DECTPU command (tpu_parameter) ! Execute a DECTPU command line ! ! Parameters: ! ! tpu_parameter DECTPU command string - input local tpu_command, ! Local copy of tpu_parameter saved_informational; ! Keyword for display of informational messages on_error [OTHERWISE]: set (INFORMATIONAL, saved_informational); endon_error; if not eve$declare_intention (eve$k_action_commands) then return (FALSE); endif; if eve$prompt_string (tpu_parameter, tpu_command, message_text (EVE$_TPUPROMPT, 1), message_text (EVE$_NOTPUCMD, 0)) then if get_info (SYSTEM, "informational") then saved_informational := ON; else saved_informational := OFF; endif; set (INFORMATIONAL, ON); execute (tpu_command); set (INFORMATIONAL, saved_informational); if current_window = tpu$x_show_window then eve$set_status_line (tpu$x_show_window); endif; else eve$learn_abort; return (FALSE); endif; return (TRUE); endprocedure; ! eve_tpu ! EVE$EXTEND.TPU Page 22 procedure eve$numeric_keys ! Define numeric keypad ! Define numeric keypad layout for lk201 series keyboards on_error [OTHERWISE]: endon_error; if not eve$on_a_pre_lk201 then eve$set_keypad (eve$x_numeric_keys); eve$x_numeric_keypad := TRUE; return TRUE; else return FALSE; endif; endprocedure; ! eve$numeric_keys procedure eve_set_keypad_numeric ! Set keyapd to numeric ! Commands to set numeric and VT100 style keypads if eve$numeric_keys then eve$message (EVE$_NUMPADDEF); return (TRUE); else eve$message (EVE$_NOTON100); eve$learn_abort; return (FALSE); endif; endprocedure ! eve_set_keypad_numeric ! EVE$EXTEND.TPU Page 23 procedure eve_set_keypad_vt100 ! Set keypad to VT100 return (eve$set_keypad_vt100_1); endprocedure; ! eve_set_keypad_vt100 procedure eve$set_keypad_vt100_1 (; define_do_flag) ! Set keypad to VT100 ! Parameter ! define_do_flag = 0 if ok to do only code past call to eve$vt100_keys ! = 1 if ok to call eve$vt100_keys and all code past it ! = 2 or "" or tpu$k_unspecified if ok to do all code local status, doit; if (define_do_flag = tpu$k_unspecified) or (define_do_flag = "") then doit := 2; else doit := define_do_flag; endif; if doit <> 0 then ! 0 for VT100 keypad in eve$init_do_key status := eve$vt100_keys (0, define_do_flag); if status <> eve$k_success then return (status); endif; endif; eve$message (EVE$_VT100DEF); return (TRUE); endprocedure; ! eve$set_keypad_vt100_1 ! EVE$EXTEND.TPU Page 24 procedure eve_save_attributes ! interactive prompting for file local results, ! ...of attribute building. Not used. the_command_buffer, ! Points to $local$ini$ save_file, ! File spec to use for saved command file attrs_range; ! holds previous settings code in command file if eve$$x_prompt_for_section then ! User should get prompted to save section files if eve$insist_y_n (message_text (EVE$_ATTRSECTION, tpu$k_message_text)) then ! User wants to use a section file. ! Call save extended EVE and we're done here return (eve_save_extended_eve (eve$$x_section_default)); endif; else ! User doesn't get prompted - if user has a default use it, ! else skip saving section file if eve$$x_section_default <> "" then return (eve_save_extended_eve (eve$$x_section_default)); endif; endif; ! Should we save in a command file? if eve$insist_y_n (message_text (EVE$_ATTRCOMMAND, tpu$k_message_text)) then eve$$x_command_default := eve$$get_default_command_file; ! Now generate the attributes code in the command file buffer. attrs_range := eve$$locate_eve_generated_attrs; if get_info (attrs_range, "type") = RANGE then if beginning_of (attrs_range) <> end_of (attrs_range) then erase (attrs_range); ! Get rid of old code endif; eve$$build_attr_code (beginning_of (attrs_range), results); endif; ! Give the user a chance to override default command file spec. save_file := eve$prompt_line (message_text (EVE$_FILEPROMPTDEF, tpu$k_message_text, eve$$x_command_default), eve$$x_prompt_terminators); if save_file = 0 then eve$learn_abort; return (TRUE); endif; if save_file = "" then eve$message (EVE$_DEFAULTUSED); write_file (get_info (BUFFER, "find_buffer", "$LOCAL$INI$"), eve$$x_command_default); else write_file (get_info (BUFFER, "find_buffer", "$LOCAL$INI$"), save_file); endif; eve$$x_attrs_modified := FALSE; return (TRUE); ! return status meaning is the REVERSE of standard endif; return (TRUE); ! return status meaning is the REVERSE of standard endprocedure ! eve_save_attributes ! EVE$EXTEND.TPU Page 25 procedure eve_set_default_command_file ! for use in saving attributes (the_file); ! default command file's file spec local def_file, local_file, save_file; eve$clear_message; local_file := the_file; if local_file = "" then ! User didn't enter a parameter, derive a default def_file := eve$$get_default_command_file; save_file := eve$prompt_line (message_text (EVE$_FILEPROMPTDEF, tpu$k_message_text, def_file), eve$$x_prompt_terminators); if save_file = 0 then eve$learn_abort; return (FALSE); endif; if save_file <> "" then eve$$x_command_default := save_file; else eve$$x_command_default := def_file; endif; else eve$$x_command_default := local_file; endif; eve$message (EVE$_DEFCOMMAND, 0, eve$$x_command_default); return (eve$define_attr ("eve_set_default_command_file", "eve_set_default_command_file('" + eve$$x_command_default + "'); ", message_text (EVE$_DEFCOMMAND, 0, eve$$x_command_default))); endprocedure ! eve_set_default_command_file procedure eve_set_nodefault_command_file ! undefine default command file eve$$x_command_default := ""; eve$message (EVE$_NODEFCOMMAND); return (eve$define_attr ("eve_set_default_command_file", "eve_set_nodefault_command_file;", message_text (EVE$_NODEFCOMMAND, tpu$k_message_text))); endprocedure ! eve_set_nodefault_command_file ! EVE$EXTEND.TPU Page 26 procedure eve_set_default_section_file ! for use in saving attributes (the_file); local def_file, local_file, save_file; eve$clear_message; local_file := the_file; if local_file = "" then ! User didn't enter a parameter, derive a default def_file := eve$$x_section_default; if def_file = "" then def_file := eve$$kt_def_priv_section; endif; save_file := eve$prompt_line (message_text (EVE$_FILEPROMPTDEF, tpu$k_message_text, def_file), eve$$x_prompt_terminators); if save_file = 0 then eve$learn_abort; return (FALSE); endif; if save_file <> "" then eve$$x_section_default := save_file; else eve$$x_section_default := def_file; endif; else eve$$x_section_default := local_file; endif; eve$message (EVE$_DEFSECTION, 0, eve$$x_section_default); return (eve$define_attr ("eve_set_default_section_file", "eve_set_default_section_file('" + eve$$x_section_default + "');", message_text (EVE$_DEFSECTION, 0, eve$$x_section_default))); endprocedure ! eve_set_default_section_file procedure eve_set_nodefault_section_file ! undefine default section file eve$$x_section_default := ""; eve$message (EVE$_NODEFSECTION, 0); return (eve$define_attr ("eve_set_default_section_file", "eve_set_nodefault_section_file;", message_text (EVE$_NODEFSECTION, tpu$k_message_text))); endprocedure ! eve_set_nodefault_section_file ! EVE$EXTEND.TPU Page 27 procedure eve_set_section_file_prompting ! allow settings saving section file eve$$x_prompt_for_section := TRUE; eve$message (EVE$_SECTIONPRMT); return (eve$define_attr ("eve_set_section_file_prompting", "eve_set_section_file_prompting;", message_text (EVE$_SECTIONPRMT, 0))); endprocedure ! eve_set_section_file_prompting procedure eve_set_nosection_file_prompting ! for settings saving section file eve$$x_prompt_for_section := FALSE; eve$message (EVE$_NOSECTIONPRMT); return (eve$define_attr ("eve_set_section_file_prompting", "eve_set_nosection_file_prompting;", message_text (EVE$_NOSECTIONPRMT, 0))); endprocedure ! eve_set_nosection_file_prompting ! EVE$EXTEND.TPU Page 28 procedure eve_set_exit_attribute_check ! check/prompt on modified attributes eve$$x_attr_exit_check := TRUE; eve$message (EVE$_CHECKATTR); return (eve$define_attr ("eve_set_exit_attribute_check", "eve_set_exit_attribute_check;", message_text (EVE$_CHECKATTR, 0))); endprocedure ! eve_set_exit_attribute_check procedure eve_set_noexit_attribute_check ! check/prompt on modified attributes eve$$x_attr_exit_check := FALSE; eve$message (EVE$_NOCHECKATTR); return (eve$define_attr ("eve_set_exit_attribute_check", "eve_set_noexit_attribute_check;", message_text (EVE$_NOCHECKATTR, 0))); endprocedure ! eve_set_noexit_attribute_check ! EVE$EXTEND.TPU Page 29 procedure eve$attr_save_nocheck ! supress saving in section file eve$$x_attr_save_check := FALSE; endprocedure ! eve$attr_save_nocheck ! EVE$EXTEND.TPU Page 30 procedure eve$define_attr ! settings to be saved accross sessions (attr_identifier, ! A facility code attrixed string ! which uniquely identifies the setting. ! Examples: "EVE$LEFT_MARGIN" ! "EVE$EDIT_MODE" ! "EVE$MENU_ENTRY: NO_SELECT 001" attr_code; ! A string containing valid TPU executable code. ! This code should compile to a program which ! calls code to do the setting AND CALLS ! EVE$DEFINE_ATTR. display_string); ! A string containing valid TPU executable code. ! This code should compile to a program which ! returns a string which describes the setting. ! Validate our arguments if get_info (attr_identifier, "type") <> STRING then return (FALSE); else if get_info (attr_code, "type") <> STRING then return (FALSE); endif; endif; ! If the setting is a repeat, then we need not process any more. ! Make this request a no-op and don't set eve$$x_attrs_modified if (eve$$x_attrs_array {attr_identifier} = attr_code) and (eve$$x_display_array {attr_identifier} = display_string) then return (TRUE); endif; ! Are we accumulating changed settings? If so, see if this is a changed ! setting. if eve$$x_accumulate_attrs then if get_info (eve$$accum_attrs_array {attr_identifier}, "type") = UNSPECIFIED then ! We are supposed to accumulate the original attribute values when a ! attribute changes for the first time. Since we haven't accumulated ! for this attribute identifier yet, it must be the first time it has ! changed since we started accumulating - save it. eve$$x_accum_attrs_array {attr_identifier} := eve$$x_attrs_array {attr_identifier}; eve$$accum_display_array {attr_identifier} := eve$$x_display_array {attr_identifier}; endif; endif; ! Update the current value of the code and display arrays/ eve$$x_attrs_array {attr_identifier} := attr_code; eve$$x_display_array {attr_identifier} := display_string; eve$$x_attrs_modified := TRUE; return (TRUE); endprocedure ! eve$define_attr ! EVE$EXTEND.TPU Page 31 procedure eve$locate_eve_generated_code ! in command file ! Returns a range containing EVE-generated code in the $LOCAL$INI$ (/command) ! buffer. Sub ranges of this range may be generated by various components ! of EVE and/or layered applications. If the buffer was not created or does ! not contain an EVE-generated code range, then the buffer and range will be ! created here. Code ranges are created at the end of the buffer, but may ! be moved anywhere in the buffer by the user. local save_file, ! Local copy of save_parameter saved_window, saved_mark, the_command_buffer, beginning_delimiter, ending_delimiter, code_begin, code_end; on_error [TPU$_CONTROLC]: eve$$restore_position (saved_window, saved_mark); eve$learn_abort; abort; [OTHERWISE]: eve$$restore_position (saved_window, saved_mark); endon_error; position (search (ANCHOR, FORWARD)); ! prevent padding saved_mark := mark (FREE_CURSOR); saved_window := current_window; the_command_buffer := get_info (BUFFER, "find_buffer", "$LOCAL$INI$"); if get_info (the_command_buffer, "type") <> BUFFER then ! We have no command buffer: create one the_command_buffer := eve$init_buffer ("$LOCAL$INI$", ""); endif; position (beginning_of (the_command_buffer)); beginning_delimiter := search_quietly (LINE_BEGIN + eve$$kt_code_begin, FORWARD, NO_EXACT); if get_info (beginning_delimiter, "type") = RANGE then ! Begining code delimiter was found - find ending delimiter position (end_of (beginning_delimiter)); ending_delimiter := search_quietly (LINE_BEGIN + eve$$kt_code_end, FORWARD, NO_EXACT); if get_info (ending_delimiter, "type") = RANGE then position (beginning_of (beginning_delimiter)); move_vertical (1); code_begin := mark (NONE); position (beginning_of (ending_delimiter)); move_horizontal (-1); code_end := mark (NONE); else eve$message (EVE$_BADDELIMITER); eve$$restore_position (saved_window, saved_mark); return (FALSE); endif; else ! No code delimiters found - create them at end of buffer position (end_of (the_command_buffer)); copy_text (eve$$kt_code_begin); split_line; copy_text (eve$$kt_code_end); position (LINE_BEGIN); code_begin := mark (NONE); code_end := mark (NONE); endif; eve$$restore_position (saved_window, saved_mark); return create_range (code_begin, code_end, NONE); endprocedure ! eve$locate_eve_generated_code ! EVE$EXTEND.TPU Page 32 procedure eve$$locate_eve_generated_attrs ! in command file ! Returns a range containing EVE-generated attributes code in the ! $LOCAL$INI$ (/command) buffer. This range is a sub range of the all ! EVE-generated code in the buffer. We call eve$locate_eve_generated_code ! to locate the larger range and search that range for attributes code. local save_file, ! Local copy of save_parameter saved_window, saved_mark, beginning_delimiter, ! Ranges to mark begin and end of ending_delimiter, ! attribute code code_range, ! The actual range of generated code attrs_begin, ! Markers for beginning and ending of attrs_end; ! attributes on_error [TPU$_CONTROLC]: eve$$restore_position (saved_window, saved_mark); eve$learn_abort; abort; [OTHERWISE]: eve$$restore_position (saved_window, saved_mark); endon_error; position (search (ANCHOR, FORWARD)); ! prevent padding saved_mark := mark (FREE_CURSOR); saved_window := current_window; code_range := eve$locate_eve_generated_code; if code_range = 0 then return (FALSE); endif; position (beginning_of (code_range)); beginning_delimiter := search_quietly (LINE_BEGIN + eve$$kt_attrs_begin, FORWARD, NO_EXACT); if get_info (beginning_delimiter, "type") = RANGE then ! We found the attributes code beginning delimiter position (end_of (beginning_delimiter)); ending_delimiter := search_quietly (LINE_BEGIN + eve$$kt_attrs_end, FORWARD, NO_EXACT); if get_info (ending_delimiter, "type") = RANGE then position (beginning_of (beginning_delimiter)); move_vertical (1); attrs_begin := mark (NONE); position (beginning_of (ending_delimiter)); if attrs_begin = mark (NONE) then ! no code exists eve$$restore_position (saved_window, saved_mark); return create_range (attrs_begin, attrs_begin, NONE); endif; move_horizontal (-1); attrs_end := mark (NONE); else eve$message (EVE$_BADDELIMITER); eve$$restore_position (saved_window, saved_mark); return (FALSE); endif; else ! Attributes code beginning delimiter isn't there - creat a range position (end_of (code_range)); split_line; move_horizontal (-1); copy_text (eve$$kt_attrs_begin); split_line; copy_text (eve$$kt_attrs_end); position (LINE_BEGIN); attrs_begin := mark (NONE); attrs_end := mark (NONE); endif; eve$$restore_position (saved_window, saved_mark); return create_range (attrs_begin, attrs_end, NONE); endprocedure ! eve$$locate_eve_generated_code ! EVE$EXTEND.TPU Page 33 procedure eve$$build_attr_code ! As a range or buffer of code (code_mark, ! A mark were the code should be inserted resulting_code); ! A range which encloses the result, or unspecified ! if no range was built ! This routine takes all the attributes settings entered since the start of ! the editing session (including those specified from a command file or from ! the section file during startup) and creates a section of TPU code which ! restores those attributes. ! The generated code is copied to the specified mark, allowing the code to ! be inserted in a command file buffer or into a scratch buffer. local start_result, ! Starting mark of resulting range saved_window, saved_mark, attr_index; ! index into the array of code on_error [TPU$_CONTROLC]: eve$$restore_position (saved_window, saved_mark); eve$learn_abort; abort; [OTHERWISE]: eve$$restore_position (saved_window, saved_mark); endon_error; position (search (ANCHOR, FORWARD)); ! prevent padding saved_mark := mark (FREE_CURSOR); saved_window := current_window; position (code_mark); attr_index := get_info (eve$$x_attrs_array, "first"); if get_info (attr_index, "type") = STRING then ! We have at least on element whose code needs to be extracted copy_text (eve$$x_attrs_array {attr_index}); split_line; move_vertical (-1); start_result := mark (NONE); move_vertical (1); loop attr_index := get_info (eve$$x_attrs_array, "next"); exitif get_info (attr_index, "type") <> STRING; copy_text (eve$$x_attrs_array {attr_index}); split_line; endloop; resulting_code := create_range (start_result, mark (NONE), NONE); eve$$restore_position (saved_window, saved_mark); return (TRUE); else ! No elements: return no range resulting_code := tpu$k_unspecified; eve$$restore_position (saved_window, saved_mark); return (FALSE); endif; endprocedure ! eve$$build_attr_code ! EVE$EXTEND.TPU Page 34 procedure eve$$accumulate_attrs ! Accumulates a "before" picture ! Call this routine to keep a 'snap shot' of the current settings. As ! the user changes settings, EVE will make copies of the original settings ! so that they may be restored exactly as they are now if the user decides ! to cancel an operation. eve$$x_accumulate_attrs := TRUE; eve$$x_saved_attrs_modified := eve$$x_attrs_modified; eve$$accum_display_array := create_array; eve$$x_accum_attrs_array := create_array; return (TRUE); endprocedure ! eve$$accumulate_attrs procedure eve$clear_accumulated_attrs ! Reset ! Call this routine sometime after your call to eve$$accumulate_attrs, when ! the user has committed to a group of settings and you no longer need to keep ! a 'before' picture of those settings. EVE will stop making copies of the ! original settings. eve$$x_accumulate_attrs := FALSE; eve$$accum_display_array := 0; eve$$x_accum_attrs_array := 0; return (TRUE); endprocedure ! eve$clear_accumulated_attrs ! EVE$EXTEND.TPU Page 35 procedure eve$restore_accumulated_attrs ! re-enstate settings ! Call this routine sometime after your call to eve$$accumulate_attrs, when ! the user has decided s/he wants things back the way they were. EVE will ! restore each original setting that has changed since you last called ! eve$$accumulate_attrs. local attr_index; ! Index into attrs array eve$$x_accumulate_attrs := FALSE; if get_info (eve$$x_accum_attrs_array, "type") = ARRAY then attr_index := get_info (eve$$x_accum_attrs_array, "first"); loop exitif attr_index = 0; execute (eve$$x_accum_attrs_array {attr_index}); endloop; endif; eve$$x_attrs_modified := eve$$x_saved_attrs_modified; return (eve$clear_accumulated_attrs); endprocedure ! eve$restore_accumulate_attrs ! EVE$EXTEND.TPU Page 36 procedure eve$$get_default_command_file ! Derives or returns it local the_command_buffer; ! Points to it if eve$$x_command_default = "" then ! We don't already have a default command file. Derive one ! from the following priority ordered list: ! 1) User specified default, if it exists ! 2) Output file spec of command buffer, if it exists ! 3) Input file spec of command buffer, if it exists ! 4) "TPU$COMMAND" the_command_buffer := get_info (BUFFER, "find_buffer", "$LOCAL$INI$"); if get_info (the_command_buffer, "type") = BUFFER then eve$$x_command_default := get_info (the_command_buffer, "output_file"); if get_info (eve$$x_command_default, "type") <> STRING then eve$$x_command_default := get_info (the_command_buffer, "file_name"); endif; if get_info (eve$$x_command_default, "type") <> STRING then eve$$x_command_default := "TPU$COMMAND"; endif; else eve$$x_command_default := "TPU$COMMAND"; endif; endif; ! Strip version number from file so subsequent writes using this string ! don't try to write that exact version number. if index (eve$$x_command_default, ";") <> 0 then return substr (eve$$x_command_default, 1, index (eve$$x_command_default, ";") - 1); else return eve$$x_command_default; endif; endprocedure ! eve$$get_default_command_file ! EVE$EXTEND.TPU Page 37 ! Module initialization code eve$x_last_section_backup := ""; eve$x_section_version := 1; ! eve_set_nodefault_command_file eve$define_attr ("eve_set_default_command_file", "eve_set_nodefault_command_file;", message_text (EVE$_NODEFCOMMAND)); ! eve_set_nodefault_section_file eve$define_attr ("eve_set_default_section_file", "eve_set_nodefault_section_file;", message_text (EVE$_NODEFSECTION, 0)); ! eve_set_section_file_prompting eve$define_attr ("eve_set_section_file_prompting", "eve_set_section_file_prompting;", message_text (EVE$_SECTIONPRMT, 0)); ! eve_set_exit_attribute_check eve$define_attr ("eve_set_exit_attribute_check", "eve_set_exit_attribute_check;", message_text (EVE$_CHECKATTR, 0)); if not eve$x_ultrix_active then eve$$kt_def_priv_section := "sys$login:eve$section"; else eve$$kt_def_priv_section := "eve_section.tpu_section"; endif; endmodule; ! EVE$EXTEND.TPU Page 38 ! ! Global Constant and Variable Declarations ! constant eve$$kt_code_begin := "! EVE-generated code begin"; constant eve$$kt_code_end := "! EVE-generated code end"; constant eve$$kt_attrs_begin := "! EVE attributes begin"; constant eve$$kt_attrs_end := "! EVE attributes end"; variable eve$$x_attrs_modified; ! TRUE: attributes have been modified variable eve$$x_saved_attrs_modified; ! Holds/saves eve$$x_attrs_modified variable eve$$x_attr_exit_check; ! TRUE: check/save changed attributes on exit variable eve$$x_attr_save_check; ! TRUE: check/save changed attrs on save variable eve$$x_prompt_for_section; ! TRUE: User gets prompted for section name variable eve$$x_section_default; ! Default file specification for section file variable eve$$x_command_default; ! Default file specification for command file variable eve$x_last_section_backup; ! filespec of last section file backup copy variable eve$x_section_version; ! version num of last section file backup copy ! EVE$EXTEND.TPU Page 39 ! ! EVE$BUILD time executable code ! define_key (eve$$kt_return + "eve_remember", CTRL_R_KEY, " remember", eve$x_standard_keys); eve$attr_save_nocheck; ! supress saving in section file during eve$build