!* -*-Teco-*- *! !~Filename~:! !Phil's EMACS init! INIT !& Setup INIT library:! !S Set up initial defaults! !* C-C-T Time, date, and load av., since I don't use MODLIN & KMPTIME! m.m^R_Display_Load_AverageU. !* C-^T ! !* The VT220 is so screwed I am tempted to put M-> on M-. and visa versa; same for M-< and M-, ! !* M-, (per FINE) move point to top of screen (M-0 M-R)! @:I..,/0MM ^R_Move_to_Screen_Edge/ !* M-. (per FINE) move point to screen bottom (M-minus M-R + C-E)! @:I.../-1MM ^R_Move_to_Screen_Edge 1:L / !* M-. ! !* M- (per FINE) move current line to top (M-0 C-L)! @:I ..!/3FS ^R ARGP 0MM ^R_New_Window/ !* C-X (my FINE extension) Move line to bottom (M-minus C-L)! @:I :.X(!)/3FS ^R ARGP -1MM ^R_New_Window/ !* C-X C-E (per FINE) Save file, and Execute Most useful if you use a Multi-forking exec, and KEEP your Emacs.! @:I :.X()/2,MM ^R_Save_and_Execute/ :i*+1 m.v Comment_Rounding !* reasonable comment alignment! :i*^& m.v Underline_Begin !* Start underlining for RUNOFF! :i*\& m.v Underline_End !* End underlining for RUNOFF! FS TTY NBR-65."E !* IF ON TTY65 (cty)! m.m^R_Save_FileU:.X(S) !* Save file on C-X S! 0 FS TTY PAGE MODE !* Disable page mode! 1 m.v Leave_Search_Alone !* Don't frob ^S/^Q! !* Since ^\ will not work for search! !* When the CTY is redirected! ' !* ON TTY65 ! !* Other kustom variables ! 1 m.v Display_Load_Average_And_Date !* Show both ! 1 m.v inhibit_help_message !* don't type "type help for help"! 0 m.v Auto_Push_Point_Option !* never push points without me asking! 1 m.v No_Auto_BLISS_mode !* edit bliss files in fundamental mode! 2 m.v Echo_Area_Height !* Only 2 echo lines please! fs tty init !* Force reset of FS ECHO LINES! fs os teco"n !* On Twenex... setup auto-loss! fs xuname:f6[0 !* User name ! fs msname:f6[1 !* Connected directory (not-used)! fs uindex:\[2 !* Job number! :i*AUTO-SAVE:AUTO-SAVE-0-J2. M.V Auto_Save_Filenames ]2]1]0 -1 m.v Auto_Save_Default !* Enable autosave! 500 m.v Auto_Save_Interval' !* every 500 characters! fs os teco"n !* If TWENEX ! m(m.m load_library)pcap !* Load Process capablilty hacker! ' !* end TWENEX! !* Set up BABYL stuff! :i*Me:Out-Mail.txt m.v Babyl_Fcc_To !* file a copy! :i*Phil_Budne m.v Babyl_Personal_Name !* me! 1 m.v Babyl_Day_of_Week_Flag !* put DOW in outgoing! -1 m.v Babyl_N_After_D !* next after a delete! 1 m.v Babyl_Require_Subjects !* Insist on a re: ! fs o speed-(1200 fo..q SLOWLY_Maximum_Speed+1)"L !* slow terminal?! m(m.m load_library)slowly' !* load slowly! er emacs;emacs_init @y :m(hfx*) !* Execute standard init file! !^R Save and Execute:! !Pass args to ^R Save file, then do M-X Compile! F m(m.m ^R_Save_File) !* save buffer automagically ! m(m.m Compile) !* Try to recompile !  !& SNO mode:! !S for snobol programs! :m(m.m SNOBOL_mode) !SNOBOL mode:! !C Mode for SNOBOL editing! M(M.M &_Init_Buffer_Locals) 1,48M.L Comment_Column 1,(:I*:)M.L Comment_Start 1,(:I*:)M.L Comment_Begin 1,(:I*)M.L Paragraph_Delimiter 1M(M.M &_Set_Mode_Line)SNOBOL  !& FOR mode:! !& FTP mode:! !S for fortran tests! :m(m.m FORTRAN_mode) !FORTRAN mode:! !C FORTRAN editing! M(M.M &_Init_Buffer_Locals) 1,40M.LComment_Column 1,(:I*!)M.LComment_Start 1,(:I*!)M.LComment_Begin 1,1M.LSpace Indent Flag 1,(:I*)M.LParagraph_Delimiter m.m ^R_Kill_Terminated_Wordm.q...D m.m ^R_Go_to_next_labelm.q...N m.m ^R_Go_to_previous_labelm.q...P 1M(M.M &_Set_Mode_Line)FORTRAN  !& RAT mode:! !S for RATFOR! :m(m.m ratfor_mode) !RATMAC mode:! !RATFOR mode:! !C RATFOR editing! M(M.M &_Init_Buffer_Locals) 1,32M.LComment_Column 1,(:I*#)M.LComment_Start 1,(:I*#_)M.LComment_Begin 1,(:I*)M.LParagraph_Delimiter 1,m.m ^R_Kill_Terminated_Wordm.q...D 1,m.m ^R_Indent_Nestedm.qI 1,3M.LIndent_Increment 1,q.m.q 1M(M.M &_Set_Mode_Line)RATFOR  !& C mode:! !& H mode:! !& Y mode:! !& LXI mode:! !S for C! :m(m.m C_Mode) !C Mode:! !C C editing! M(M.M &_Init_Buffer_Locals) 1,32M.LComment_Column 1,(:I*/*)M.LComment_Start 1,(:I*/*_)M.LComment_Begin 1,(:I*_*/)M.LComment_End 1,(:I*)M.LParagraph_Delimiter 1M(M.M &_Set_Mode_Line)C  !& BLI mode:! !& R36 mode:! !& L36 mode:! !& B11 mode:! !& B36 mode:! !& B16 mode:! !& REQ mode:! !S for BLISS! :m(m.m BLISS?_mode) !BLISS? mode:! !C BLISS editing! M(M.M &_Init_Buffer_Locals) 1,32M.LComment_Column 1,(:I*!)M.LComment_Start 1,(:I*!)M.LComment_Begin 1,(:I*)M.LComment_End 1,(:I*)M.LParagraph_Delimiter 1M(M.M &_Set_Mode_Line)BLISS?  !& P11 mode:! !& M11 mode:! !& PALX mode:! !S for Pdp-11 code! :m(m.m MIDAS_mode) !Resequence:! !C Renumber local PALX/PAL-11/MACRO-11 labels around point. Numeric arg is amount to increment new numbers by.! f[ vz [0[2 fs b cons[3 !* build up search string in 3! -( f"e w 1fo..qResequencing_Increment' )[1 !* step 1 when resequenced! < -l 1a:f"c !' u0 fwl 1a-:"e !* Look at lines with : ! q0:"d 0;'' > c .f[ vb !* Until one that isnt a number! < .-z; l 3,1a:f"c !' u0 fwl 1a-:"e !* Now look forward! q0"d 0l \u2 2f=$:"e !* If it is $: ! q3[..o z"n i' !* Separate by ^O's! i q2\ i$ ]..o''"# 0;'' > !* Build ^Bnn$^B^Omm$^B^O...! 0l b,.fs bound j < :s3f"l ( r fk+2d )*q1\ $i'"# 0;' > !* Replace with new number!  !Phase of Moon Edit:! !POM edit:! !C Write edit message at start of file. Inserts name of presumed output file, POM and date of edit and user. If given non-zero argument, includes site.! j 0FO..QComment_Start"e i!' !* Start comment, if none set, use a bang! "#gcomment_start' .[2 qbuffer_filenames f"e w' f[ dfile !* Save filename as applicable! fs d versi"e !* If visited version is >,! 0[0 1:< er fs if versu0 ec> !* find most recent version number (or 0)! q0+1 fs d vers' !* and add 1.! ff"n g(fs machine)i::' !* give Node if asked! g(fs d file) 32i !* insert filename + ! Fs ddev[1 f=1 PS f"n * (f=1 DSK)' "e !* If device not interesting! .-z( q2j fq1+1d )+zj' 400000000.,(fs date)fs fd conv !* insert date, no time! 32i g(m(m.m &_Phase_of_Moon)) !* space + POM! fs xunam@f6[0 i,_by_0 !* plus user name! gComment_End i  !* insert end of comment, then crlf! 0FO..QComment_Start"e i!' !* Start comment, if none set, use a bang! "#gComment_Start' i_  !* and a space + crlf for a comment! 2r !* backup over crlf!  !& Phase of Moon:! !S Return Phase of Moon Reeturns current Phase of Moon as a string.! f[ b bind !* get a buffer! eg !* get strange date stuff! 2r !* go back 2 chars! .[1 !* save point! 0l !* go to start of line! .,q1x*  !* return from there to here! !& Set Editor Name:! !S Set the editor name in the mode line. Takes a string argument that is placed into the Q register ..J and variable Editor Name. Also forces a redisplay of the mode line.! :I*[0 !* Save and set Q-reg 0 to the string arg ! Q0UEditor_Name !* Put the string into Editor Name ! :I..J0_ !* Append a space to the string ! !* and store it in ..J ! 1FS Mode_Change !* Wake up the mode line constructor !  !* Return ! !^R Display Load Average:! !^R Show the load average, maybe date. If you want to see the date too, put the following line in your init: 1m.vDisplay Load Average And Datew! !* This should work on any release 4 (3 too?) TWENEX. * The load average shown is the group (class?) load average. * There is now no way (I think -- ECC) to get the system load average.! !* It may work on a TENEX, showing group and system load averages.! [0[2 45f[BBind !* Temporary buffer, 45/5=9 words long, so! !* we can stuff machine code in it.! fsOSTeco-2"e !* TENEX.! 330000000000.u:..o(0) !* SKIP! 474040000000.u:..o(1) !* SETO 1,! 104000000337.u:..o(2) !* JSYS 337 ???! 263740000000.u:..o(3) !* POPJ 17,! 561045000011.u:..o(4) !* HRROI 1,1(5)! 201140020200.u:..o(5) !* MOVEI 3,20200! 104000000233.u:..o(6) !* FLOUT! 263740000000.u:..o(7) !* POPJ 17,! 263740000000.u:..o(8) !* POPJ 17,! zj 30,32i j 1f? fsRealAddress/5u0 m0 !* Execute the machine code.! 45j s 45,.-1x0 !* 0: Group load average.! fsLoadAverageu2 !* 2: System load average.! hk iGroup_load_is_ .(g0)j @f_k zj !* Only one space before l.a.! i,_System_load_is_ .(g2)j @f_k' !* Buffer now has the TENEX load! !* average message.! "# !* TWENEX.! fsLoadAverageu0 !* 0: load average, as a stringified! !* number, e.g. 12.43, with a possible! !* leading space.! hk !* Kill initial buffer nulls put in in! !* case we had to do TENEX machine code! iLoad_average_is_ .(g0)j @f_k' !* Get load average, remove! !* leading spaces.! !* Buffer has load average message, for TENEX or TWENEX.! 0fo..qDisplay_Load_Average_And_Date"n !* User wants date too.! j .-z( m(m.mInsert_Date)w )+zj i.__' !* ...! j iC zj i  q..o fsEchoDisplay !* Clear the echo area and type out! !* the message.! 0fsEchoActivew 1  !* Keep it around after we exit.! !VT102 Mode:! !C Set mode for VT102/VT132.! 52 fstty init fsWindow(f+)fsWindoww !* blast into vt132 mode!  !VT220 Mode:! !C Screw over things for lusing VT220 Try to use ` as the escape key: Bind ` to meta prefix Makes ` terminate searchs Have M-` invoke a minibuffer However, minibuffer code is lusing, ^[ or ^3 must be used.! !* Make VT220 workable! 52 fstty initw fsWindow(f+)fsWindoww !* blast into vt132 mode! m.m^R_Prefix_MetaU` !* Make ` do meta for lusing vt220 ! !* Quoted insert will still insert `! m.m^R_Execute_MinibufferU..` !* M-`! !* expected behavior for ``! ` m.v Search_Exit_Char !* make ` exit searches!  !SLOW Mode:! !C Force SLOWLY to load and run All B.U. LAN lines run at 9600, so we cannot tell when we are really slow.! 600 fs ospeed !* Make us look slow! 0 fo..qSLOWLY_Maximum_Speed"E 1200 m.v SLOWLY_Maximum_Speed' 0fo..q MM_&_Slow_Old_Minibuffer"e m(m.m load_library)slowly ' !* Load if not done already! fs tty init !* Force re-init of stuff! -1 fs d wait !* Force input pause!  !Compile:! !C Recompile the file you are visiting. We first offere to write out each file, unless there is a numeric arg. A string arg is used to specify extra switches -- it may be null. Just how depends on the major mode, or can be overridden by defining the variable Compile Command to be a TECO macro which should do the work. Files can define that variable locally. Major modes not built in can also set it. Compile Command can find the visited file name in Q1 and also as the default filenames. It MUST end in a ^\, as there will be things on the stack.! FF"E M(M.M Save_All_Files)' QBuffer_Filenames[1 q1f[dfile 0FO..Q Compile_Command[2 Q2"N :M2' QModeU2 F~2 TECO"E ET_:EJ !* This kludgery needed cause generate library smashes! FS D FILEU2 !* q regs before doing 's.! @:I*| M(M.M Generate_Library)21| [2 M2 ' ]2 f] dfile ]1 !* Restore q-regs for default handling.! :fr !* Clear mode line.! :i*Z fs echodis !* Put cursor at bottom of screen.! 0fsecho char !* dont echo when continued.! ex !* Exit and repeat CCL command.! !@ List TECO:! !C Make line-printer listing of a TECO file. Converts Ctrl- to {^}, and produces a table of contents Example: 60 MM@ List TECOUSRCOM 60 is the number of lines/page and is the default. Actually runs @ List TECO from the library EMACS:PURIFY.:EJ.! f:m(m.a EMACS:PURIFY@_List_TECO)