!* -*- Teco -*- Library created and maintained by KMP@MC ! !* Notes on bugs, misfeatures, etc... ! !* ! !* This doesn't seem to interact very well with ! !* TWENEX logical devices because it does only ! !* textual resolution of device names ! !* If you use M-X Define System, you should use ! !* fully expanded pathnames, not logical devices, or ! !* you may accidentally get two copies of the same file ! !* in buffer. Note this is really a bug in how Teco ET ! !* is handled on Twenex, and is non-trivial to fix ! !* ! !* Currently this is set up to handle Lisp histories. I ! !* haven't really figured out yet what it would take to ! !* make it be more general. ! !~Filename~:! !Library to keep track of file edit histories! HISTORY !& Setup HISTORY Library:! !& Set up for using history editor! m.mEdit_System_Historyu...~ !* C-M-~ edits history ! !Edit System History:! !S Edit a system's history! m(m.m &_Get_File_Property)Systemf"n[7' "#w :i*NAS File_has_no_associated_systemfserr ' qMode[4 !* q4 gets current file mode! f[dfile !* Bind default file info ! [5 !* Bind q5 ! qBuffer_Filenamesf"nu5 et5w !* Make buffer filenames be Teco defaults! fsdfileu5' "# 0u5' 1:"e fsifileu5 ' !* Get file truename in q5 ! 0fo..QSystem_7_History_Filef"n[8' "#w fsosteco"e !"e :i*Cfsechodisplay @ftHistory_file_reverted.î ' "# @ft_(failed)' 0fsechoactive'' "# !"! :i*C fsechodisplay @ftDon't_forget_to_save_history_file_8!î  0fsechoactive '  zj fsmodified"n m(m.m^R_Save_File)' 0,0a- "n iî ' iî ###_ fsdatefsfdconv i_by_ g(fsxuname:f6) i,_re:_ q5"n q5 fsdfile fsosteco"e g(fsdsname:f6) i; g(fsdfn1:f6) i_ g(fsdfn2:f6)' "# fsosteco-1"e i< g(fsdsname) i> g(fsdfn1) i. g(fsdfn2) i. g(fsdversion) ' "# g(fsdfile)'' :l q9"n i_(in_module_ g9 i) '' "# q9"n imodule_ g9 '"# i_??_'' i_###î  0fsmodified :i*(Editing_System_7_History)__8_[..J 1fsmodech !* Say new mode line !  !* Allow editing ! q2-q..O"e fsmodified"n m(m.m^R_Save_File)''  !* Return ! !& Get File Property:! !& Get property from file property list ! !* WARNING: Explicit qreg popping ! qmode[0 !* Get mode in q0 ! 1,m.m&_0_Get_File_Propertyu0 !* Get mode hook maybe ! q0"n :m(q0(]0)) ' !* Run mode hook or default accessor! "# ]0w :m(m.m&_Default_Get_File_Property) ' !& SCHEME Get File Property:! !& Scheme Hook for file properties ! :i*[2[1 !* Get string arg in q2, bind q1 ! .:\u1 fn1j !* Save the cursor ! f[vb f[vz 0,(fsz) fsbound !* Bind virtual buffers open ! j :s (:"l oPunt' !* Find first form ! 6f~HERALD"n oPunt' !* Assure this is a HERALD ! 6c 0,1a:"b oPunt' !* ditto ! 1:< .,( 0l fll r .)fsbound !* Bind buffer bounds narrow ! >"n oPunt' !* ditto ! j :< !Top! !* Loop over properties ! :@fll !* Find start of next expression ! 0,1a-;"e l oTop ' !* Ignore comments ! 0,1a-("n @fll ' !* Ignore atoms ! c @flf~2"e oWin' !* Check for success ! r fll !* Skip s-exp ! > f~2MODULE"e j 1:< :@fll 0,1a-("n 0,1a-;"n 0,1a"n @flx*''' >' 0 !* No such property found ! !Punt! m(m.m&_Default_Get_File_Property)2 !* Try default handler ! !Win! 1:< 2:@fll @flx* >"n 0' !* Return found expression ! !& Default Get File Property:! !& Default way to get value of file property String arg is the property name. The return value is a string if such a property was found, or 0 if no such property found. ! :i*[2[1 !* Get string arg in q2, bind q1 ! .:\u1 fn1j !* Save the cursor ! f[vb f[vz 0,(fsz) fsbound !* Bind virtual buffers open ! j 1:fb-*-:"l 0' !* Exit if no file property list ! .,(1:fb-*-:"l 0'fkc.)fsboundwj !* Narrow bounds to prop list ! :s2::"l 0' !* Find property name if there ! .,(:s;:"l zj'"# r' -s_ c .)x* !* Return property value as string ! !Define System:! !S Define a system for the Edit System History macro String args are system name and system history file! 1,f System:_( !* Get system in q1 ! 5,f Filename[2)[1 !* Get system file in q2 ! q2 m.vSystem_1_History_File !* Make the variable ! 0 !* Return !