!* -*-teco-*- This library implements EMACS PL1 MODE. The source resides in MC:ECC;PL1LIB >, compiled version in EMACS;PL1 :EJ on all machines. Note that the source assumes the use of EMACS;IVORY, not EMACS;PURIFY.! !* Initially designed by Charles R. Davis and Eugene C. Ciccarelli, in the * fall of 1977 (I think), and implemented by the latter (ECC).! !~FILENAME~:! !Package for editing PL1 code (PL1 MODE).! PL1 !PL1 Mode:! !C Set up for editing PL1 code. "/* " and " */" become comment delimiters. $PL1IND ..D$ is set up for use by PL1 indent macros. (E.g. no special Lisp characters, and _ is not a break.) Calls user-providable macro, INIT PL1 MODE, which can put pl1 macros into desired qregs. If no macro exits, calls & Default Init PL1 Mode. See the description of that subr for more details on what it does and how to construct your own.! m(m.m & Init Buffer Locals) !* Discard locals of old mode, and set: *! !* .Q: Make Local Q-Reg. *! !* .0: old value of $Switch Mode Process *! !* Options$ *! !* Standard stuff to set up: *! 1,:i*/* m.LComment Startw !* Comment start... *! 1,:i*/* m.LComment Beginw !* begin... *! 1,:I* */M.LComment Endw !* And comment end. *! 1,m.m& Indent Without Tabsm.LMM & Indentw !* Dont use tabs. *! 1,m.m& XIndent Without Tabsm.LMM & XIndentw !* ... *! 1,36m.LCOMMENT COLUMNw !* Set comment column. *! !* Now either personal or standard init: *! !* They can use .0, .Q. *! 1:"N !* User has no init, *! m(m.m& Default Init PL1 Mode)' !* ...so use default one. *! m.vPL1IND ..Dw !* Create a var for our dispatch table. *! ^:iPL1IND ..D| A A AA A AA AA A A ( ) A A A AA A AA AA AA AA AA AA AA AA AA AA A A A A A A A AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA A A A A AA A AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA A A A A | !* And set up the dispatch table. *! q.0,1M(M.M& Set Mode Line)PL1 !* Set, display mode. *!  !Cref PL1 Labels:! !C Crefs label references in a PL1 listing in the buffer. The buffer should be a compilation listing. If you just want a listing, not an object segment, try compiling with options -sb -ck. If a statement on a line references more than one label then whichever label is highest alphabetically will be creffed. If you want to cref a source, not a listing, use MM Cruf PL1 Entries.! [7[9 f[sstring !* save! fsruntimeu7 .u9 fn q9j  !* 7: Start time.! !* 9: Original point, auto-restored.! zj -s NAMES DECLARED BY EXPLICIT CONTEXT. fkc [1 .u1 !* 1: start cref.! [2 :s "N .u2 '"# zu2 ' !* 2: end cref.! [0 q..ou0 q1j !* 0: list buffer.! [..o !* be sure to restore that! !* buffer.! fsbcreatew [3 q..ou3 !* 3: table buffer.! [4 !* 4: dcl line#.! [5 !* 5: ref line#.! q0u..o !* to list buffer.! < !* Do next dcl.! .,q2:fb dcl ; \u4 !* 4: dcl! :sref; !* Get its refs.! f> !* done ref processing! > !* done dcl processing! q3u..o   fwl  l  !* Now sort ref-dcl table, ordering by ref.! !* MUST REMOVE DUPLICATES! !* Now search for each ref line and put cref in place of blanks.! q0u..o bj q3u..o bj !* to top in both buffers.! < !* next ref/dcl! q3u..o :s ; .-5,.-1x5 !* 5: ref! 4x4 !* 4: dcl! q0u..o :s  5; !* find ref line! 0l f4 !* put in dcl! -l !* back so can handle duplicates -- hier alph wins! > !* done ref/dcl processing.! q3u..o !* to table buffer???! !* misguided, probably --! !* should bbind up where set 3?! .,((fsruntime)-q7\).fx1 !* Tell user how long it took.! ^ftîDone. 1 ms.  !* ...!  !Cruf PL1 Entries:! !C Hacky creffer for subrs and functions. Does not need a listing, only source. Crefs PROC's, ENTRY's, and PROCEDURE's. They must be of the form: