! File: [Ray.World]DBR_Eve_Enhancement.TPU ! Last Update: 03/Sep/1987 @ 0946 by D.Ray ! ! This is a TPU command file containing enhancements to the standard ! Digital EVE interface. This TPU command file follows the Digital ! suggested method of adding procedures and key definitions to ! an existing section file. ! ! All variables referenced in this command file with a "eve$" or "eve_" ! prefix are defined in SYS$LIBRARY:EVESECINI.TPU ! ! All variables and procedures defined in this command file have the ! prefix "enh_". ! ! DCL command line to compile this command file and add the enhancements ! to the Digital EVE interface. ! ! $ EDIT/TPU/SECTION=EVESECINI/COMMAND=[Ray.World]DBR_Eve_Enhancement.TPU ! ! ! * Initialize global variable(s) used by enhancement procedures ! ! procedure enh_init_global_variables ! variable to be used as equivlent for TPU Shift_Key keyword GOLD := 0; ! name of buffer upon entry into EVE enh_main_buffer := get_info(current_buffer, eve$kt_name); ! previous buffer name enh_previous_buffer := enh_main_buffer; ! last deleted line enh_deleted_line := eve$x_restore_text; ! last deleted word enh_deleted_word := eve$x_restore_text; ! last deleted character enh_deleted_char := eve$x_restore_text; ! shift screen right/left increment value enh_screen_shift := get_info(screen,"width") / 4; ! endprocedure; ! !- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! Procedure code extracted from TPU's SYS$LIBRARY:EVESECINI.TPU !- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! ! ! *Modification - changed position of direction/mode strings to match ! up with position of direction/mode toggle key position ! and added directional arrow to direction indicator. ! ! Set status line of a window to include buffer name and mode indications. ! Used primarily to indicate insert/overstrike and forward/reverse toggling. ! ! Parameters: ! ! this_window Window whose status line is being set - input procedure eve$set_status_line (this_window) local this_buffer, ! Current buffer mode_string, ! String version of current mode direction_string, ! String version of current direction buffer_name; ! String containing name of current buffer this_buffer := get_info (this_window, eve$kt_buffer); ! Don't add a status line to windows without a status line if (this_buffer = 0) or (get_info (this_window, "status_line") = 0) then return; endif; if get_info (this_buffer, eve$kt_mode) = insert then mode_string := "Insert "; else mode_string := "Overstrike"; endif; if get_info (this_buffer, "direction") = reverse then direction_string := " eve$x_max_buffer_name_length then buffer_name := substr (buffer_name, 1, eve$x_max_buffer_name_length); else buffer_name := buffer_name + substr (eve$kt_spaces, 1, eve$x_max_buffer_name_length - length (buffer_name)); endif; ! ! unmodified output mode_string then direction_string ! set (status_line, this_window, reverse, " Buffer " + buffer_name + " " + direction_string + " " + mode_string); endprocedure ! ! ! *Modification - place erased character in enhancement ! global variable "enh_deleted_char" ! ! Delete current character procedure eve_erase_character local this_position; ! Marker for current cursor position this_position := mark (none); if this_position = end_of (current_buffer) then return; else if current_character = eve$kt_null then move_horizontal (1); if mark (none) = end_of (current_buffer) then move_horizontal (-1); else eve$append_line; endif; else if get_info (current_buffer, eve$kt_mode) = overstrike then copy_text (" "); else enh_deleted_char := erase_character (1); ! modification endif; endif; endif; endprocedure; ! !- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! Procedure code extracted from TPU's SYS$LIBRARY:EDTSECINI.TPU !- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! ! ! * Emulation of EDT's next-previous-line command ! ! procedure enh_next_prev_line LOCAL start_offset; start_offset := current_offset; move_horizontal(-start_offset); if current_direction = forward then move_vertical(1) else if start_offset = 0 then move_vertical(-1) endif; endif; endprocedure ! ! ! * Emulation of EDT's changecase command ! ! change case of current character ! procedure enh_change_case LOCAL character, range_to_change ; ! change case of characters in select range if eve$x_select_position <> 0 then range_to_change := select_range; change_case ( range_to_change, invert); eve$x_select_position := 0; return; endif; ! ! change case of single character if current_character <> eve$kt_null then character := current_character; change_case(character,invert); erase_character(1); copy_text(character); if current_direction <> forward then move_horizontal(-2); endif; return endif; endprocedure ! ! ! * Emulation of EDT's end of line ! ! procedure enh_end_of_line if current_direction = forward then if mark(none) <> end_of (current_buffer) then if current_character = eve$kt_null then move_vertical(1) endif; if mark(none) <> end_of (current_buffer) then move_horizontal(length(current_line)-current_offset); endif; endif; ! ! reverse direction else move_horizontal((-current_offset)+(-1)); endif; endprocedure ! !- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! User developed procedure code !- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! ! ! * Emulation of EDT's open-line command ! ! procedure enh_open_line LOCAL start_offset; start_offset := current_offset; split_line; move_vertical(-1); move_horizontal(start_offset); erase_character(length(current_line)); endprocedure ! ! ! * Save current_buffer name and go to message buffer ! ! procedure enh_go_to_message_buffer enh_previous_buffer := get_info(current_buffer, eve$kt_name); eve_buffer("message"); endprocedure; ! ! ! * Insert current system date & time at current cursor position ! ! procedure enh_insert_timestamp local char_string, start_offset, minutes; ! erase any previous date/timestamp start_offset := current_offset; erase_character(+18); ! copy current system date & time to buffer copy_text(fao("!%D",0)); ! erase seconds info erase_character(-6); ! erase & save minute info, remove ":" and replace minute info minutes := erase_character(-2); erase_character(-1); copy_text(minutes); ! move to beginning of date/timestamp move_horizontal(-(current_offset - start_offset)); ! replace leading blank with "0" if present if current_character = " " then copy_text("0"); erase_character(+1); else move_horizontal(+1); endif; ! replace "-" with "/" move_horizontal(+1); copy_text("/"); erase_character(+1); ! change last 2 characters of month to lower case move_horizontal(+1); char_string := erase_character(+2); change_case(char_string,lower); copy_text(char_string); ! replace "-" with "/" copy_text("/"); erase_character(+1); ! insert "@" between date & time move_horizontal(+4); copy_text(" @"); ! leave cusor at end of data/timestamp move_horizontal(+5); endprocedure ! ! ! * Emulation of EDT's delete line ! ! procedure enh_delete_line ! delete line via EVE procedure eve_erase_line; ! store just deleted line in enhancement global variable enh_deleted_line := eve$x_restore_text; endprocedure ! ! ! * Emulation of EDT's undelete line ! ! procedure enh_undelete_line ! restore last deleted line to EVE's restore buffer & restore eve$x_restore_text := enh_deleted_line; eve_restore; endprocedure ! ! ! * Emulation of EDT's delete next word ! ! procedure enh_delete_next_word ! delete next word via EVE procedure eve_erase_word; ! store just deleted word in enhancement global variable enh_deleted_word := eve$x_restore_text; endprocedure ! ! ! * Emulation of EDT's delete previous word ! ! procedure enh_delete_previous_word ! delete previous word via EVE procedure eve_erase_previous_word; ! store just deleted word in enhancement global variable enh_deleted_word := eve$x_restore_text; endprocedure ! ! ! * Emulation of EDT's undelete next or previous word ! ! procedure enh_undelete_word ! restore last deleted word to EVE's restore buffer & restore eve$x_restore_text := enh_deleted_word; eve_restore; endprocedure ! ! ! * Emulation of EDT's undelete character ! ! procedure enh_undelete_char ! restore last deleted line to EVE's restore buffer & restore eve$x_restore_text := enh_deleted_char; eve_restore; endprocedure ! ! ! * Toggle from one window to two windows and if already in two window ! environment toggle from current window to other window ! ! procedure enh_window_toggle if eve$x_number_of_windows = 1 then eve_two_windows; else eve_other_window; endif; endprocedure; ! !- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! ! * create enhanced vt200 keys help buffer ! ! procedure enh_vt200_keys_help ! save current buffer enh_previous_buffer := get_info(current_buffer, eve$kt_name); ! create dedicated enhancement help buffer eve_buffer("Enhanced_VT200_Keys_Help_Buffer"); ! set buffer characteristics set (eob_text,current_buffer,"[End of Enhancement Help]"); set (no_write,current_buffer); ! generate instructions copy_text("Use Screen movement keys to move within this Help buffer"); split_line; split_line; ! generate key descriptions copy_text("PF1 = "+lookup_key(PF1,comment)); split_line; split_line; ! copy_text("*** Function Keys ***"); split_line; copy_text("F9 = "+lookup_key(F9,comment)); split_line; copy_text("GOLD/F9 = "+lookup_key(key_name(F9,GOLD),comment)); split_line; copy_text("F10 = "+lookup_key(F10,comment)); split_line; copy_text("GOLD/F10 = "+lookup_key(key_name(F10,GOLD),comment)); split_line; copy_text("F17 = "+lookup_key(F17,comment)); split_line; copy_text("GOLD/F17 = "+lookup_key(key_name(F17,GOLD),comment)); split_line; copy_text("F20 = "+lookup_key(F20,comment)); split_line; split_line; ! copy_text("*** Edit Keys ***"); split_line; copy_text("GOLD/<- = "+lookup_key(key_name(LEFT,GOLD),comment)); split_line; copy_text("GOLD/-> = "+lookup_key(key_name(RIGHT,GOLD),comment)); split_line; split_line; ! copy_text("*** Keypad Keys ***"); split_line; copy_text("PF2 = "+lookup_key(PF2,comment)); split_line; copy_text("GOLD/PF2 = "+lookup_key(key_name(PF2,GOLD),comment)); split_line; copy_text("PF4 = "+lookup_key(PF4,comment)); split_line; copy_text("GOLD/PF4 = "+lookup_key(key_name(PF4,GOLD),comment)); split_line; copy_text("GOLD/KP7 = "+lookup_key(key_name(KP7,GOLD),comment)); split_line; copy_text("Minus = "+lookup_key(MINUS,comment)); split_line; copy_text("GOLD/Minus = "+lookup_key(key_name(MINUS,GOLD),comment)); split_line; copy_text("GOLD/KP4 = "+lookup_key(key_name(KP4,GOLD),comment)); split_line; copy_text("GOLD/KP5 = "+lookup_key(key_name(KP5,GOLD),comment)); split_line; copy_text("Comma = "+lookup_key(COMMA,comment)); split_line; copy_text("GOLD/Comma = "+lookup_key(key_name(COMMA,GOLD),comment)); split_line; copy_text("KP1 = "+lookup_key(KP1,comment)); split_line; copy_text("GOLD/KP1 = "+lookup_key(key_name(KP1,GOLD),comment)); split_line; copy_text("KP2 = "+lookup_key(KP2,comment)); split_line; copy_text("KP0 = "+lookup_key(KP0,comment)); split_line; copy_text("GOLD/KP0 = "+lookup_key(key_name(KP0,GOLD),comment)); split_line; split_line; ! copy_text("*** Main Keyboard Keys ***"); split_line; copy_text("GOLD/T = "+lookup_key(key_name('T',GOLD),comment)); split_line; ! re-define PF2 to simply move to already created help buffer for the ! remainder of this edit session define_key('eve_buffer("Enhanced_VT200_Keys_Help_Buffer")',PF2, "display_enhancement_Help_buffer",enh_vt200_keys); ! << remove when all descriptions entered >> split_line; copy_text("*** All key definitions May Not be listed above ***"); ! move to top of buffer eve_top; endprocedure ! ! ! * * VT200 series keyboard enhancements * * ! ! procedure enh_enhancements ! ! create key map for enhancement key mapping definitions ! enh_vt200_keys := create_key_map ( "enh_vt200_key_map"); ! ! Define vt200 series keypad with EDT-like command configuration ! ! set PF1 key as Shift key for enhancement keypad & function keys ! NOTE: Throughout the remainder of this command file and in all ! other text pretaining to these key definitions, the Shift ! key will be referred to as the GOLD key. ! define_key("copy_text('')",PF1,"GOLD",enh_vt200_keys); set (Shift_key,PF1,eve$x_key_map_list); ! ! set global variable equivalent name for Shift Key GOLD := SHIFT_KEY; ! ! vt200 keypad key definitions define_key('enh_vt200_keys_help',PF2, "display_enhancement_Help_buffer",enh_vt200_keys); define_key('enh_delete_line',PF4,"delete_line",enh_vt200_keys); define_key('enh_delete_next_word',MINUS,"delete_next_word",enh_vt200_keys); define_key('eve_erase_character',COMMA,"delete_character",enh_vt200_keys); define_key('eve_move_by_word',KP1,"move_by_word",enh_vt200_keys); define_key('enh_end_of_line',KP2,"end_of_line",enh_vt200_keys); define_key('enh_next_prev_line',KP0,"move_start_next_line",enh_vt200_keys); define_key('eve_return',ENTER,"return",enh_vt200_keys); ! ! GOLD ("PF1") vt200 keypad key definitions ! define_key('eve_top; eve_buffer(enh_previous_buffer)',key_name(PF2,GOLD), "return_from_enhancement_Help_buffer",enh_vt200_keys); define_key('enh_undelete_line',key_name(PF4,GOLD), "undelete_line",enh_vt200_keys); define_key('eve_tpu("")',key_name(KP7,GOLD),"tpu_command",enh_vt200_keys); define_key('enh_undelete_word',key_name(MINUS,GOLD), "undelete_word",enh_vt200_keys); define_key('eve_bottom',key_name(KP4,GOLD),"bottom",enh_vt200_keys); define_key('eve_top',key_name(KP5,GOLD),"top",enh_vt200_keys); define_key('enh_undelete_char',key_name(COMMA,GOLD), "undelete_char",enh_vt200_keys); define_key('enh_change_case',key_name(KP1,GOLD),"change_case", enh_vt200_keys); define_key('enh_open_line',key_name(KP0,GOLD),"open_line",enh_vt200_keys); ! ! Define vt200 series function keys ! ! vt200 function key definitions ! define_key('enh_go_to_message_buffer',F9,"move_to_message_buffer", enh_vt200_keys); define_key('enh_delete_previous_word',F13,"delete_previous_word", enh_vt200_keys); define_key('enh_window_toggle',F17,"1_to_2_windows/other_window", enh_vt200_keys); define_key('eve_buffer(enh_main_buffer)',F20,"go_to_main_buffer", enh_vt200_keys); ! ! GOLD ("PF1") vt200 function key definitions ! define_key('eve_buffer(enh_previous_buffer)',key_name(F9,GOLD), "return_from_message_buffer",enh_vt200_keys); define_key('eve_quit',key_name(F10,GOLD),"quit",enh_vt200_keys); define_key('eve_one_window',key_name(F17,GOLD), "2_to_1_window", enh_vt200_keys); ! ! Define vt200 series edit keys ! ! GOLD ("PF1") vt200 edit key definitions ! define_key('eve_shift_right(enh_screen_shift)',key_name(RIGHT,GOLD), "shift_screen_right",enh_vt200_keys); define_key('eve_shift_left(enh_screen_shift)',key_name(LEFT,GOLD), "shift_screen_left",enh_vt200_keys); ! ! Define vt200 series keyboard keys ! ! GOLD vt200 keyboard key definitions ! define_key('enh_insert_timestamp',key_name('T',GOLD), "insert_date/timestamp",enh_vt200_keys); ! ! ! place enhancements key map in default EVE key map list ! 1. eve$user_keys ! 2. enh_vt200_key_map ! 3. eve$standard_keys ! remove_key_map(eve$x_key_map_list,eve$x_user_keys,ALL); remove_key_map(eve$x_key_map_list,eve$x_vt200_keys,ALL); add_key_map(eve$x_key_map_list,eve$kt_first,enh_vt200_keys); add_key_map(eve$x_key_map_list,eve$kt_first,eve$x_user_keys); ! ! EVE enhancement message to user ! message ("** This is an ENHANCED VT200 keypad version of EVE <> **"); endprocedure ! ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! Execute TPU Local Initialization procedure ! ! verify terminal is vt200 series before executing key definition ! procedure TPU$LOCAL_INIT. ! ( 1 = true, 0 = false ) ! procedure TPU$LOCAL_INIT ! ! initialize enhancement global variables enh_init_global_variables; ! ! make certain terminal is vt200 series (standard EVE interface can be fooled) ! if get_info(screen,"vt200") = 1 then enh_enhancements; ! ! if terminal not vt200 series, make certain keypad setup for vt100 series ! else eve$vt100_keys; message ("*** This is the non-VT200 version of EVE ***"); endif; endprocedure ! TPU$LOCAL_INIT ! ! save enhanced EVE section file in home directory ! SAVE ("SYS$LOGIN:DBR_EVESECINI.GBL"); ! ! force immediate quit to prevent alteration to command file ! QUIT;