.! To the Pageswapper editor: .! .! Observe that there are many underscores and no exotic .! characters, so I have placed a ".no flags accept" line .! in the first group of commands and a ".flags accept" .! line at the end of the file to restore to normal .! operation. .! .no flags accept .page size 58,73 .flags overstrike .flags bold .enable bolding .keep .nast .nap .no headers .page size 48,72 .left margin 8 .right margin 72 .spacing 1 .no fill .nojustify .paging .c;^*Cleaning up the TPU EDT Emulator\* .c;Richard D. Piccard .c;Educational Computing#### .c;Kalamazoo College######## .c;Kalamazoo, Michigan 49007 .headers ^&Abstract\& This paper reports what may well be the final revisions to our customizations of DIGITAL's EDT Emulator interface for TPU. Because DIGITAL has announced that they intend no further development of the EDT Emulator, these include the code for fixes to outright bugs as well as some improvements. The full code for our customizations is included in the submission from Kalamazoo College on the DECUS VAX SIG Symposium Tape for Anaheim, 1987. I. Introduction VMS V4.6 comes with the cheering news that DIGITAL will provide no further updates to the EDT Emulator interface for TPU. ("But the EDT keypad is available under EVE." or words to that effect; this is comforting?) Furthermore, that section file will disappear automatically during the VMS V5.0 upgrade, so anyone who wants to continue using an interface based on that code must squirrel away a copy of .c;^*SYS$SHARE:EDTSECINI.TPU\* ^&before the upgrade\&. After that event, it may prove more effective to directly modify a copy of their file, but we are continuing for now to use the fully layered approach, in which a stock section file is used with a command file that implements our customizations and saves them to a new section file. Since DIGITAL has been happy in the past to provide EDTSECINI.TPU to all licensed VMS sites, it will be included in our VAX SIG Symposium Tape submission, which should be distributed down the tree at about the same time that VMS V5.0 hits the streets. II. Bug Fixes The method we use to fix bugs in DIGITAL's EDTSECINI.TPU code is to include in the command file that will create the layered section, KAZSECINI.TPU in our case, a copy of their defective procedure, and then modify it. The corrected version will then supercede the original procedure when the new section file is saved. The stock word wrapping procedure, normally bound to the space bar, wraps one column too early and also wraps the entire last word of a line even when all the printing characters do fit within the wrapping margins, but the ^&second\& (or later) space character following the word moves the cursor beyond the limit. The fix is to modify their procedure EDT$WRAP_WORD, as indicated below. .test page 10 ================================================================ procedure edt$wrap_word ! space key (wrap word) ! !+ ! Modified from EDTSECINI.TPU ! ! COPYRIGHT © DIGITAL EQUIPMENT CORPORATION ! ! Procedure to wrap the word to the next line. Bound to space ! key when a SET WRAP is done. ! ! 28-SEP-1987 RDP: use the full number of columns (the ! current_column is one beyond the last ! character typed); if the previous ! character was a space, and are now ! too far, then just split_line. !- LOCAL word_size , temp_char, trash_space ; if edt$x_wrap_position = 0 then return endif; if current_column > edt$x_wrap_position + 1 then move_horizontal(-1); temp_char := current_character; move_horizontal(+1); if (temp_char = ' ') then split_line; return; else word_size := edt$beg_word; split_line; move_horizontal(word_size); endif; endif; copy_text(' '); endprocedure ================================================================ .test page 10 Ever since the original release of the EDT Emulator, FILL has split a word in the middle whenever the select range starts in a word that extends beyond the specified margin. The fix below has been included in previous versions of KAZSECINI, as submitted to the Fall, 1985, and Fall, 1986, VAX SIG Symposium Tapes; it is included here for completeness. As above, a copy of the stock procedure is included in KAZSECINI and modified as shown in the early portion of the procedure, below. .test page 10 ================================================================ procedure edt$preserve_blanks(flag) ! support routine for fill . . on_error all_done:=1; ! cause exit endon_error; original_position:=mark(none); b_mark:=beginning_of(edt$x_select_range); ! position (b_mark); move_horizontal (-current_offset); b_mark := mark(none); ! ! the above three lines are Kalamazoo's fix of a bug. ! . . ================================================================ .test page 10 The structured tabs features of EDT have also been poorly emulated ever since the original release. In particular, the emulator procedure bound to CTRL/T sets all indentations in the selected block to exact multiples of the current "tab size", rather than ^&changing\& the indentation of each line in the block ^&by\& the specified multiple of the tab size. Our earlier versions of KAZSECINI included attempts to cure this behavior. We are confident that the following code is satisfactory under the current version of TPU. As before, a modified copy of the stock procedure is included in KAZSECINI. The code below is an early portion of the modified procedure. .test page 10 ================================================================ procedure edt$tab_adjust !ctrl t (adjust tabs) . . !+ ! Go to beginning of line. ! Calculate tab depth for this line ! Strip off spaces and tabs at beginning of line. ! Set up new tab goal ! Call the tab routine. !- if length (current_line) > 0 then loop exitif (current_character <> ' ') AND (current_character <> ' '); move_horizontal(1); endloop; ! ! tab_level := get_info(current_buffer,'offset_column') ! / edt$x_tab_size; ! edt$x_Tab_goal := (tab_level + adjust_level) ! * edt$x_tab_size; ! ! For KAZSECINI, the above two statements are deactivated ! and replaced by the next statement. ! edt$x_Tab_goal := get_info(current_buffer,'offset_column') - 1 + (adjust_level * edt$x_tab_size) ; if (edt$x_tab_goal < 0) then edt$x_tab_goal := 0 endif; erase_character(-current_offset); edt$tab; endif; . . ================================================================ .test page 10 In VMS V4.6, once again, DIGITAL's love-hate relationship with the GIGI rears its ugly head. The scrolling region limitation, which is noted in the unchanged TPU documentation, is defaulted differently, so that code that used to function quite nicely is now unworkable. The fix is simple this time. The workaround was developed with Edward M. King of the Colorado Customer Support Center. Even though scrolling is "OFF", the line limits ^&are\& obeyed by pseudo-scrolling, repainting the screen. Our procedure for setting up the environment now includes the following lines: .test page 10 ================================================================ procedure tpu$local_init local gigi; . . gigi := get_info(SCREEN, "vk100"); if (gigi = 0) then ! this is not a GIGI, so ! set (scrolling,KAZ_x_top_window,on,3,3,0); set (scrolling,KAZ_x_bottom_window,on,3,3,0); set (scrolling,main_window,on,7,7,0); else ! this is a GIGI, so ! set (scrolling,KAZ_x_top_window,off,2,2,3); set (scrolling,KAZ_x_bottom_window,off,2,2,3); set (scrolling,main_window,off,4,4,6); set (scrolling,message_window,off,0,0,0); endif; ! . . ================================================================ .test page 10 III. Improvements While browsing through EDTSECINI we noticed the SHOW VERSION line-mode command. It seemed reasonable to include the date of the KAZSECINI revision. We have created one global variable to carry that information, which is initialized in our procedure tpu$local_init, and modified a copy of the stock procedure edt$show to take advantage of it. The KAZSECINI date does require modification by hand. The modified portions of the two procedures are show below. .test page 10 ================================================================ procedure tpu$local_init . . ! kaz_x_version := ' - KAZSECINI 9/28/87'; ! . . ================================================================ .test page 10 ================================================================ procedure edt$show ! support routine for line mode(show cmd) . . .test page 6 [4]: ! SHOW VERSION message('TPU Version V'+str(get_info(system,'version'))+'.'+ str(get_info(system,'update')) + ' - ' + edt$x_version + kaz_x_version); . . ================================================================ .test page 10 Following the suggestion provided in the July, 1985, issue of "The HEAP," our earlier versions of KAZSECINI had included the following statement in the local initialization: SET(MESSAGE_FLAGS,1); This did permit more of the informative text of most messages to be visibly displayed on screen, but not the initial file read-in message. We have therefore included in the current KAZSECINI a copy of the stock procedure EDT$INIT_VARIABLES, and moved the statement given above from our procedure TPU$LOCAL_INIT to become the ^&first\& executable line of EDT$INIT_VARIABLES. This means that the message about reading in the file has room for 15 more characters of subdirectory information before going off the screen. .test page 10 ================================================================ procedure edt$init_variables ! initialize global variables . . set (message_flags,1); . . ================================================================ .test page 10 We found that when the procedures we bind to GOLD/B, for reading a file into a buffer, were executed, we were almost always interested in starting at the top of the buffer, but that the code was leaving the cursor at the bottom. We therefore modified the procedure, as shown below, by adding a line to automatically position the cursor at the top of the buffer. .test page 10 ================================================================ procedure kaz_grab_a_buffer(buffer_name,new_window) . . if file_name <> kaz_x_empty then read_file(file_name); position (beginning_of(buffer_ptr)); ! new line endif; ! else ! buffer already exists ! kaz_status_line(buffer_ptr,new_window); map(new_window,buffer_ptr); endif; ! kaz_x_this_window := current_window; return 1; endprocedure ================================================================ .test page 10 IV. What Next The time is fast approaching to bid a fond farewell to EDT and the EDT Emulator. We plan to try to sustain the enhanced EDT Emulator at Kalamazoo College under VMS V5.0, but probably not beyond. We will be encouraging adventurous users to experiment with EVE and EVE-Plus during the end of VMS V4, and will then try to merge the best parts of our modified EDT Emulator into some variant of EVE. I suspect that we will abandon most of the line-mode commands, except, perhaps, EXIT, but that we may prefer to keep more EDT key definitions than just the keypad. I would be delighted to hear directly, or better yet through these pages, from anyone who has migrated a user community from EDT or the EDT Emulator to any variant of EVE. In particular, our system has many VT-100 and Zenith Z-29 terminals, and no VT-200 series terminal. Hence, the optimization of EVE using the more limited keyboard is critical for us, and it does not strike me as being at all obvious that it has been done right: I suspect strongly that DIGITAL's recent research has mostly been done on their modern terminals. .flags accept