!******** EAG style Marker support under EVE !******** Eveplus ! Distribution: MAR 22 1985 File name: eag$markers.tpu Prefix: EAG_ ! =========== =========== ==== ! Please send bugs to smiley::beckett ! EAG markers trade a little ease of learning for speed and convenience. ! They are one of the more popular features of the TPU based EAG editor. ! EAG markers are unamed. Instead of identifying the destination marker ! by name, you go to the most recently accessed marker in a circular list ! of markers. Successive requests cause you to circulate through your markers ! one by one. If you define two markers, you can ping pong between the two. ! EAG maps three marker functions to keys - ! INSERT - Places a marker at the current cursor position. ! FIND - Positions to the most recently accessed marker unless ! you are already there, in which case it positions you ! to the next marker in the circular list. ! REMOVE - Removes the marker at the current cursor position. If ! you aren't on a marker, you get a warning message. ! This file is an EVEPlus format include file which implements an alternative ! style of marker support for EVEPlus users. It is designed to allow you ! flexability without your needing to modify the source code. You can - ! 1 Enable/disable the marker keys interactively and your original keypad ! assignments will be saved and restored. (Your shift key is also ! saved and restored if you defined it via EVE or EVEPlus. ! 2 Reassign or disable those default key assignments which you might ! already have assigned to your own functions. The marker code ! will not disturb keys which you want to keep for other uses. ! 3 Use markers as part of your default interface; the keys will ! be defined in your section file. ! Since this file itself need never be modified to supply you with a custom ! interface, bug fixes, etc. can be made without your having to re-edit ! anything; simply rerun the EVEPlus build. ! HOW TO CUSTOMIZE: ! This section is a template for customizing the EAG$MARKER.TPU support. ! It is entirely optional; you need not do anything put run the EVEPlus ! build including EAG$MARKER.TPU to get marker support, but if you want ! to change the way the support is supplied, copy this section of the ! file into your own initialization and edit those statments you wish. ! Use this section in your EVE Plus input files if you - ! 1 Want to change the rendition of EAG$MARKERS - uncomment and ! modify the statement below to get the marker style you want. ! (REVERSE is the default; do nothing if that's what you'd like.) ! eag_g_mark_rendition := reverse; ! eag_g_mark_rendition := none; ! eag_g_mark_rendition := bold; ! eag_g_mark_rendition := underline; ! eag_g_mark_rendition := blink; ! 2 Want to change the keypad assignment of one or more Marker keys. ! Here are the default assignments. Do nothing if you want them. ! Uncomment the statement(s) you need and modify the key name on ! the right to get alternate assignments. ! EVEPLUS_SET_SHIFT_KEY ( pf1 ); ! Change if you want different key ! eag_g_insert_mark_key := key_name ( e2, shift_key ); ! Insert mark ! eag_g_remove_mark_key := key_name ( e3, shift_key ); ! Remove mark ! eag_g_find_mark_key := key_name ( e1, shift_key ); ! Find a mark ! 3 Want to include EAG marker support in your default keypad - by ! default, EAG marker support is not enabled. To use EAG markers, ! issue the eve command SET EAG MARKERS. To diable them, issue ! the eve command SET NOEAG MARKERS. To get marker support in your ! default keypad, uncomment the statements below and place them ! in your build input file. ! EVEPLUS_SET_SHIFT_KEY ( pf1 ); ! eve_set_eag_markers; ! Edit History ! ! Which When Who What ! ! X00-00 21-mar-85 CDB Created ! X00-00 22-mar-85 CDB Added keypad save/restore support ! X00-00 26-mar-85 CDB Upgrade to VAXTPU/fix variable names. ! X00-01 22-apr-85 CDB Upgrade to VAXTPU/fix variable names. ! Changes from last file: ! This is the first version under EVE, and incorporates EAG logic. ! The EVE 'go to' command is called internally to move to marks. procedure tpu$local_init eag_v_mark1 := 0; eag_v_mark2 := 0; eag_v_mark3 := 0; eag_v_mark4 := 0; eag_v_mark5 := 0; ! endprocedure procedure eve_set_eag_markers; ! Define EAG marker keys if (get_info ( eag_g_shift_key, "type") = UNSPECIFIED ) then eag_g_shift_key := pf1 ; endif; eag_g_shift_key_save_pgm := 0; eag_g_shift_key_save_doc := 0; eag_redefine_key ( "eve_eag_insert_mark", eag_g_shift_key, "EAG shift key", eag_g_shift_key_save_pgm, eag_g_shift_key_save_doc ); eag_g_users_shift_key := EVEPLUS_SET_SHIFT_KEY ( eag_g_shift_key ); if (get_info ( eag_g_insert_mark_key, "type") = UNSPECIFIED ) then eag_g_insert_mark_key := key_name ( e2, shift_key ); endif; eag_g_insert_mark_key_save_pgm := 0; eag_g_insert_mark_key_save_doc := 0; eag_redefine_key ( "eve_eag_insert_mark", eag_g_insert_mark_key, "EAG insert mark", eag_g_insert_mark_key_save_pgm, eag_g_insert_mark_key_save_doc ); if (get_info ( eag_g_remove_mark_key, "type") = UNSPECIFIED ) then eag_g_remove_mark_key := key_name ( e3, shift_key ); endif; eag_g_remove_mark_key_save_pgm := 0; eag_g_remove_mark_key_save_doc :=0; eag_redefine_key ( "eve_eag_remove_mark", eag_g_remove_mark_key, "EAG remove mark", eag_g_remove_mark_key_save_pgm, eag_g_remove_mark_key_save_doc ); if (get_info ( eag_g_find_mark_key, "type") = UNSPECIFIED ) then eag_g_find_mark_key := key_name ( e1, shift_key ); endif; eag_g_find_mark_key_save_pgm :=0; eag_g_find_mark_key_save_doc :=0; eag_redefine_key ( "eve_eag_find_mark", eag_g_find_mark_key, "EAG find mark", eag_g_find_mark_key_save_pgm, eag_g_find_mark_key_save_doc ); message ('EAG markers enabled '); endprocedure procedure eve_set_noeag_markers; if (get_info ( eag_g_users_shift_key, "type") = UNSPECIFIED ) then message ("EAG marker keypad is your default, can't disable"); return; endif; undefine_key ( eag_g_shift_key ); EVEPLUS_SET_SHIFT_KEY ( eag_g_users_shift_key ); eag_restore_key ( eag_g_shift_key, eag_g_shift_key_save_pgm, eag_g_shift_key_save_doc ); eag_restore_key ( eag_g_remove_mark_key, eag_g_remove_mark_key_save_pgm, eag_g_remove_mark_key_save_doc ); eag_restore_key ( eag_g_find_mark_key, eag_g_find_mark_key_save_pgm, eag_g_find_mark_key_save_doc ); eag_restore_key ( eag_g_remove_mark_key, eag_g_remove_mark_key_save_pgm, eag_g_remove_mark_key_save_doc ); message ('EAG markers disabled '); endprocedure procedure eag_redefine_key ! Redefine a key, saving old definition ( new_pgm, default_key, new_doc, save_pgm, save_doc ) on_error endon_error; if (get_info ( lookup_key ( default_key, program), "type") = program) then save_doc := lookup_key ( default_key, comment); save_pgm := lookup_key ( default_key, program); else save_doc := "none"; save_pgm := "none"; endif; if substr (new_doc, 1, 1) <> ' ' then define_key ( new_pgm, default_key, ' '+new_doc ); else define_key ( new_pgm, default_key, new_doc ); endif; if (get_info ( save_doc, "type") <> string ) then save_doc := "none"; endif; endprocedure procedure eag_restore_key ( default_key, save_pgm, save_doc ) on_error endon_error; if (get_info ( save_pgm, "type") = program ) then if (get_info ( save_doc, "type") = string ) then if (save_doc <> 'none') then define_key ( save_pgm, default_key, save_doc ); endif; else define_key ( save_pgm, default_key ); endif; else undefine_key (default_key); endif; endprocedure procedure eve_eag_insert_mark ! Set a mark at the current position !+ ! Set a mark at the current position so that we can come back to it later. !- eve_mark ( 'EAG_mark' ); if eag_v_mark5 <> 0 then ! The mark already exists, delete (eag_v_mark5); ! ... delete it endif; if (get_info ( eag_g_mark_rendition, "type") = UNSPECIFIED ) then eag_g_mark_rendition := reverse; endif; eag_v_mark5 := eag_v_mark4; eag_v_mark4 := eag_v_mark3; eag_v_mark3 := eag_v_mark2; eag_v_mark2 := eag_v_mark1; eag_v_mark1 := mark ( eag_g_mark_rendition ); endprocedure procedure eve_eag_find_mark ! Rotate through all marks set !+ ! Go to a previously set mark. !- local temp_mark; if eag_v_mark1 = 0 then message ("You have no marks to position to"); else if mark(none) <> eag_v_mark1 then eve$mark_eag_mark := eag_v_mark1; eve_go_to ( 'EAG_Mark' ); else if eag_v_mark2 <> 0 then temp_mark := eag_v_mark1; eag_v_mark1 := eag_v_mark2; eag_v_mark2 := eag_v_mark3; eag_v_mark3 := eag_v_mark4; eag_v_mark4 := eag_v_mark5; if eag_v_mark2 = 0 then eag_v_mark2 := temp_mark; else if eag_v_mark3 = 0 then eag_v_mark3 := temp_mark; else if eag_v_mark4 = 0 then eag_v_mark4 := temp_mark; else eag_v_mark5 := temp_mark; endif; endif; endif; eve$mark_eag_mark := eag_v_mark1; eve_go_to ( 'EAG_Mark' ); else message ("You only have one mark, and you're on it"); endif; endif; endif; endprocedure procedure eve_eag_remove_mark ! Remove the current mark if eag_v_mark1 <> 0 then if mark(none) = eag_v_mark1 then delete (eag_v_mark1); eag_v_mark1 := eag_v_mark2; eag_v_mark2 := eag_v_mark3; eag_v_mark3 := eag_v_mark4; eag_v_mark4 := eag_v_mark5; eag_v_mark5 := 0; else message ("You can only delete a mark when you're on it"); endif; else message ("You have no marks to delete."); endif; endprocedure !************** END OF CODE ***************** !********************************************************