gregg@a.cs.okstate.edu (Gregg Wonderly) (11/26/88)
The following DCL archive is a diff that updates the recent posting of TPUVI for VMS. This update fixes some V5 compatibility problems that I did not know about (and had not discovered) before the original posting. Apply these diff's by hand... (sigh) There are 2 files here, curdiff.out, the differences output, and changes., a list of the changes I made. -------------- Gregg Wonderly UUCP: {cbosgd, ihnp4, rutgers}!okstate!gregg Domain: gregg@A.CS.OKSTATE.EDU $!............................................................................. $! VAX/VMS archive file created by VMS_SHAR V-5.03 07-Oct-1987 $! which was written by Michael Bednarek (U3369429@ucsvc.dn.mu.oz.au) $! To unpack, simply save and execute (@) this file. $! $! This archive was created by GREGG $! on Friday 25-NOV-1988 17:46:04.27 $! $! It contains the following 2 files: $! CURDIFF.OUT CHANGES. $!============================================================================= $ Set Symbol/Scope=(NoLocal,NoGlobal) $ Version=F$GetSYI("VERSION") ! See what VMS version we have here: $ If Version.ges."V4.4" then goto Version_OK $ Write SYS$Output "Sorry, you are running VMS ",Version, - ", but this procedure requires V4.4 or higher." $ Exit 44 $Version_OK: CR[0,8]=13 $ Pass_or_Failed="failed!,passed." $ Goto Start $Convert_File: $ Read/Time_Out=0/Error=No_Error1/Prompt="creating ''File_is'" SYS$Command ddd $No_Error1: Define/User_Mode SYS$Output NL: $ Edit/TPU/NoSection/NoDisplay/Command=SYS$Input/Output='File_is' - VMS_SHAR_DUMMY.DUMMY set(Informational, off); set (success, off); f:=Get_Info(Command_Line,"File_Name"); b:=Create_Buffer("",f); o:=Get_Info(Command_Line,"Output_File"); Set(Output_File,b,o); Position(Beginning_of(b)); Loop x:=Erase_Character(1); Loop ExitIf x<>"V"; Move_Vertical(1); x:=Erase_Character(1); Append_Line; Move_Horizontal(-Current_Offset); EndLoop; Move_Vertical(1); ExitIf Mark(None)=End_of(b) EndLoop; Position(Beginning_of(b)); Loop x:=Search("`",Forward,Exact); ExitIf x=0; Position(x); Erase_Character(1); If Current_Character='`' then Move_Horizontal(1); else Copy_Text(ASCII(INT(Erase_Character(3)))); EndIf; EndLoop; Exit; $ Delete VMS_SHAR_DUMMY.DUMMY;* $ Checksum 'File_is $ Success=F$Element(Check_Sum_is.eq.CHECKSUM$CHECKSUM,",",Pass_or_Failed)+CR $ Read/Time_Out=0/Error=No_Error2/Prompt=" CHECKSUM ''Success'" SYS$Command ddd $No_Error2: Return $Start: $ File_is="CURDIFF.OUT" $ Check_Sum_is=23285900 $ Copy SYS$Input VMS_SHAR_DUMMY.DUMMY X************ XFile VI$ROOT:[000000]VI.OUT;635 X 13 ! Version number 2, edit 636, 25-NOV-1988 16:29:57.38 X 14 ! X****** XFile VI$ROOT:[V5_CURRENT.SRC]VI.TPU;2 X 13 ! Version number 2, edit 631, 28-AUG-1988 19:09:47.00 X 14 ! X************ X************ XFile VI$ROOT:[000000]VI.OUT;635 X 813 IF (save_buffer AND (NOT old_global)) THEN X 814 vi$save_for_undo (CURRENT_BUFFER, VI$LINE_MODE, 1); X 815 vi$in_global := 1; X 816 ENDIF; X****** XFile VI$ROOT:[V5_CURRENT.SRC]VI.TPU;2 X 813 vi$in_global := 0; X 814 IF (save_buffer AND (NOT old_global)) THEN X 815 vi$save_for_undo (CURRENT_BUFFER, VI$LINE_MODE, 1); X 816 vi$in_global := 1; X 817 ELSE X 818 IF old_global THEN X 819 vi$in_global := 1; X 820 ENDIF; X 821 ENDIF; X************ X************ XFile VI$ROOT:[000000]VI.OUT;635 X 3034 ENDIF; X****** XFile VI$ROOT:[V5_CURRENT.SRC]VI.TPU;2 X 3038 MESSAGE (""); X 3039 ENDIF; X************ X************ XFile VI$ROOT:[000000]VI.OUT;635 X 3073 vi$info ("Search wrapped past buffer boundry!"); V 3074 where := SEARCH (vi$_find_pat, CURRENT_DIRECTION, vi$ignor Xe_case); X****** XFile VI$ROOT:[V5_CURRENT.SRC]VI.TPU;2 V 3078 where := SEARCH (vi$_find_pat, CURRENT_DIRECTION, vi$ignor Xe_case); X************ X************ XFile VI$ROOT:[000000]VI.OUT;635 X 3194 cur_pat, ! The current pattern to be extracted X 3195 cur_char, ! The current character in the regular X 3196 ! expression being examined X****** XFile VI$ROOT:[V5_CURRENT.SRC]VI.TPU;2 X 3198 cur_pat, ! The current pattern to be extracted X 3199 cur_char, ! The current character in the regular X 3200 ! expression being examined X************ X************ XFile VI$ROOT:[000000]VI.OUT;635 X 3230 IF (cur_char = "$") AND (pos = LENGTH (pat)) THEN X 3231 cur_pat := "line_end"; X 3232 ELSE X****** XFile VI$ROOT:[V5_CURRENT.SRC]VI.TPU;2 X 3234 IF (cur_char = "^") THEN V 3235 vi$info ("^ found in the middle of a line, use \ to escape X it!"); X 3236 RETURN (0); X 3237 ENDIF; X 3239 IF (cur_char = "$") THEN X 3240 IF (pos >= LENGTH (pat)) THEN X 3241 cur_pat := "line_end"; X 3242 ELSE X 3243 vi$info ("$ found before end of string"); X 3244 RETURN (0); X 3245 ENDIF; X 3246 ELSE X************ X************ XFile VI$ROOT:[000000]VI.OUT;635 X 3317 EXITIF (cur_char = "[") OR V 3318 ((cur_char = "$") AND (pos = LENGTH (pat)) X); X 3319 EXITIF (pos > LENGTH (pat)); X****** XFile VI$ROOT:[V5_CURRENT.SRC]VI.TPU;2 X 3331 EXITIF (cur_char = "^") OR (cur_char = "[") OR X 3332 (cur_char = "$"); X 3333 EXITIF (pos > LENGTH (pat)); X************ X************ XFile VI$ROOT:[000000]VI.OUT;635 X 3556 ELSE X 3557 MOVE_HORIZONTAL (-1); X 3558 ENDIF; X****** XFile VI$ROOT:[V5_CURRENT.SRC]VI.TPU;2 X 3570 ENDIF; X************ X************ XFile VI$ROOT:[000000]VI.OUT;635 X 3600 ELSE X 3601 MOVE_HORIZONTAL (-1); X 3602 ENDIF; X****** XFile VI$ROOT:[V5_CURRENT.SRC]VI.TPU;2 X 3612 ENDIF; X************ X************ XFile VI$ROOT:[000000]VI.OUT;635 X 4466 learn_seq, X 4467 key, X****** XFile VI$ROOT:[V5_CURRENT.SRC]VI.TPU;2 X 4476 key, X************ X************ XFile VI$ROOT:[000000]VI.OUT;635 X 4479 learn_seq := LEARN_END; X 4480 vi$info ("Press key to bind sequence to: "); X****** XFile VI$ROOT:[V5_CURRENT.SRC]VI.TPU;2 X 4488 vi$info ("Press key to bind sequence to: "); X************ X************ XFile VI$ROOT:[000000]VI.OUT;635 X 4497 vi$global_var := learn_seq; X 4498 EXECUTE (COMPILE (key+":=vi$global_var")); X 4499 vi$in_learn := 0; V 4500 DEFINE_KEY ("vi$play_back("+key+")", keyn, "learn_sequence", vi$cm Xd_keys); X 4501 vi$info ("Sequence bound to key"); X 4502 RETURN (1); X 4503 ENDPROCEDURE; X 4505 ! X 4506 ! Play back the program sequence for a learned set of keystrokes. X 4507 ! X 4508 PROCEDURE vi$play_back (prog) X 4509 LOCAL X 4510 cnt, X 4511 old_play_back, X 4512 old_global; X 4514 IF (vi$m_level > 30) THEN V 4515 vi$info ("Infinite loop in key macro sequence (repeated > 30)! X"); X 4516 RETURN; X 4517 ENDIF; X 4518 vi$m_level := vi$m_level + 1; V 4520 MESSAGE ("undomap: "+str(vi$undo_map)+", global: "+str(vi$in_globa Xl)); X 4521 IF vi$undo_map THEN X 4522 old_global := vi$in_global; X 4523 IF (NOT old_global) THEN X 4524 vi$save_for_undo (CURRENT_BUFFER, VI$LINE_MODE, 1); X 4525 vi$in_global := 1; V 4526 MESSAGE ("saved changes "+str(old_global)+" "+str (vi$in_ Xglobal)); X 4527 ENDIF; X 4528 ENDIF; X 4530 cnt := vi$cur_active_count; X 4532 old_play_back := vi$playing_back; X 4533 vi$playing_back := 1; X 4535 LOOP X 4536 EXITIF (cnt = 0); X 4537 EXECUTE (prog); X 4538 cnt := cnt - 1; X 4539 ENDLOOP; X 4540 vi$playing_back := old_play_back; X 4541 vi$m_level := vi$m_level - 1; X 4543 vi$in_global := old_global; X 4544 IF (NOT vi$in_global) THEN X 4545 vi$undo_start := BEGINNING_OF (CURRENT_BUFFER); X 4546 vi$undo_end := END_OF (CURRENT_BUFFER); X 4547 ENDIF; X 4548 ENDPROCEDURE; X****** XFile VI$ROOT:[V5_CURRENT.SRC]VI.TPU;2 X 4505 EXECUTE (COMPILE (key+":=LEARN_END")); X 4506 vi$in_learn := 0; V 4507 DEFINE_KEY ("vi$play_back("+key+")", keyn, "learn_sequence", vi$cm Xd_keys); X 4508 vi$info ("Sequence bound to key"); X 4509 RETURN (1); X 4510 ENDPROCEDURE; X 4512 ! X 4513 ! X 4514 ! X 4515 PROCEDURE vi$play_back (prog) X 4516 LOCAL X 4517 old_play_back, X 4518 old_global; X 4520 IF (vi$m_level > 30) THEN X 4521 vi$info ("Infinite loop detected in key macro sequence!"); X 4522 RETURN; X 4523 ENDIF; X 4524 vi$m_level := vi$m_level + 1; X 4526 IF vi$undo_map THEN X 4527 old_global := vi$in_global; X 4528 vi$in_global := 0; X 4529 IF (NOT old_global) THEN X 4530 vi$save_for_undo (CURRENT_BUFFER, VI$LINE_MODE, 1); X 4531 vi$in_global := 1; X 4532 ENDIF; X 4533 ENDIF; X 4535 old_play_back := vi$playing_back; X 4536 vi$playing_back := 1; X 4537 EXECUTE (prog); X 4538 vi$playing_back := old_play_back; X 4539 vi$m_level := vi$m_level - 1; X 4541 vi$in_global := old_global; X 4542 ENDPROCEDURE; X************ X************ XFile VI$ROOT:[000000]VI.OUT;635 X 6613 RETURN (SUBSTR(FAO("!XL", k),1,6)); X 6614 ENDPROCEDURE; X****** XFile VI$ROOT:[V5_CURRENT.SRC]VI.TPU;2 X 6607 RETURN (SUBSTR(FAO("!XL", key),1,6)); X 6608 ENDPROCEDURE; X************ X************ XFile VI$ROOT:[000000]VI.OUT;635 X 8333 IF vi$active_count = 0 THEN X 8334 vi$active_count := INT (ASCII (KEY_NAME (vi$last_key))); X****** XFile VI$ROOT:[V5_CURRENT.SRC]VI.TPU;2 X 8324 IF VI$ACTIVE_COUNT = 0 THEN X 8325 vi$active_count := INT (ASCII (KEY_NAME (vi$last_key))); X************ X XNumber of difference sections found: 14 XNumber of difference records found: 78 X XDIFFERENCES /IGNORE=(BLANK_LINES)/MATCH=7/MERGED=1- X VI$ROOT:[000000]VI.OUT;635- X VI$ROOT:[V5_CURRENT.SRC]VI.TPU;2 $ GoSub Convert_File $ File_is="CHANGES." $ Check_Sum_is=571025676 $ Copy SYS$Input VMS_SHAR_DUMMY.DUMMY Xo Fixed % bracket matching to to change in SEARCH () in REVERSE behavior. Xo Fixed learn sequences so that they can be recursive and are repeatable. Xo Added 'Search wrapped past buffer boundry' message. Xo Changed RE pattern generation so that '$' in middle of line is allowed. Xo Fixed bug in key name to string routine (key => k). $ GoSub Convert_File $ Exit