From ec94f3dd8b4792dff80bd9124b41b48559f0da76 Mon Sep 17 00:00:00 2001 From: Lars Brinkhoff Date: Fri, 14 Jun 2019 21:49:46 +0200 Subject: [PATCH] RUNOFF - Emacs library for :R etc. --- build/emacs.tcl | 1 + doc/info/runoff.2 | 34 +++++++++++++++++ src/emacs1/runoff.2 | 92 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 127 insertions(+) create mode 100755 doc/info/runoff.2 create mode 100755 src/emacs1/runoff.2 diff --git a/build/emacs.tcl b/build/emacs.tcl index 5526651a..d933471b 100644 --- a/build/emacs.tcl +++ b/build/emacs.tcl @@ -69,6 +69,7 @@ respond ":EJ" "\033xgenerate\033emacs;page\033emacs1;page\r" respond ":EJ" "\033xgenerate\033emacs;pictur\033emacs1;pictur\r" respond ":EJ" "\033xgenerate\033emacs;qsend\033ejs;qsend\r" respond ":EJ" "\033xgenerate\033emacs;\[rmai\]\033emacs1;rmailx\033rmailz\r" +respond ":EJ" "\033xgenerate\033emacs;runoff\033emacs1;runoff\r" respond ":EJ" "\033xgenerate\033emacs;scribe\033emacs1;scribe\r" respond ":EJ" "\033xgenerate\033emacs;scrlin\033emacs1;scrlin\r" respond ":EJ" "\033xgenerate\033emacs;slowly\033emacs1;slowly\r" diff --git a/doc/info/runoff.2 b/doc/info/runoff.2 new file mode 100755 index 00000000..0fdbe775 --- /dev/null +++ b/doc/info/runoff.2 @@ -0,0 +1,34 @@ + RUNOFF is an EMACS macro +which facilitates managing text processing of large +text documents with multiple files. It is built +upon the /TEXT option of the @ program (see INFO). +If you have an lrec file for your large text +document then + +MM Runoff luser;thesis lrec + +will run through all the files in the lrec and for +each compare the creation date of the XGP version +(which need no longer be online) with the current +">" version. A list of :R commands will be accumulated +for all files that have changed since the last +time they were R'ed. You will then be asked whether +you want to XXFILE the commands to re-R the +appropriate files and then @ the whole mess to +get update pages on the XGP. The TTY record +from XXFILE (containing e.g. error messages from R) +will be found in the file "LUSER;THESIS XXXOUT". + +To obtain this macro MM LoadAI:EMACS;RUNOFF . + +P.S. If you use TJ6 or PUB, you can use this macro +too! The variable Runoff Command Template +holds the :R command into which the file names +are substituted. You can make your own for other +text processors. + +Comments and questions to RICH@AI. + +Self-documentation available through MM Describe MacroRunoff +and MM View QRunoff Command Template + diff --git a/src/emacs1/runoff.2 b/src/emacs1/runoff.2 new file mode 100755 index 00000000..4fbc8a49 --- /dev/null +++ b/src/emacs1/runoff.2 @@ -0,0 +1,92 @@ +!* -*-TECO-*- ! + +!~FILENAME~:! !Runoff Macro! +RUNOFF + +!& Setup RUNOFF Library:! !Set up default variables for Runoff Macro! + + :FO..Q Runoff_Start"L + :I* M.C Runoff_StartText_inserted_at_start_of_command_file' + + :FO..Q Runoff_Command_Template"L + :I* :R_ 2; 3: 4 + M.C Runoff_Command_TemplateTemplate_for_command_to_call_text_processor:_ + Assume_SNAME_in_Q2,_DEV_in_Q3,_FN1_in_Q4,_FN2_in_Q5' + + :FO..Q Runoff_@_Template"L + :I* :@_6/G/X[NO]/O[7] + :XGP_7/D + M.C Runoff_@_TemplateTemplate_for_command_to_call_@:_ + Assume_LREC_Filename_in_Q6,_Output_Filename_in_Q7' + +!Runoff:! !C Run off update pages for text files. +String argument specifies LREC file for text. For all files in LREC group, +compare creation dates and output file with FN2 'XXXOUT', which reprocesses +those that have changed and then runs @.! + + M(M.M Save_All_Files) !* In case you forgot to save some! + QRunoff_Start[0 !* Q0 will hold accumulated string ! + 5[1 !* Q1 will hold char pointer ! + [2 [3 [4 [5 !* SNAME in Q2, DEV in Q3, FN1 in Q4, FN2 in Q5 ! + 1F[FNAM SYNTAX !* lone filename used as FN1 ! + F[D FILE E[ !* Bind default file name and input file ! + F[B BIND !* Make temporary buffer for LREC file ! + ET DSK:_LREC ET ERFY EC !* Read in LREC file string arg defaulting FN2 to LREC! + FS I FILE[6 !* Q6 holds name of LREC file ! + QRunoff_Command_Template[7 !* Q7 holds command template ! + [8 !* temporary ! + 0[9 !* Q9 is flag turned on when good XGP but lrec not current! + F6 LREC-(0FS WORD-1)"N !* Verify Header word ! + :I*NLR _6_Not_Lrec_file FS ERR' !* Error if not lrec ! +  !* Open most recent version of source file ! + FS IF CDATEU8 EC !* Creation date of most recent source into Q8 ! + Q1+10FS WORD-Q8"L !* If source creation date newer than lrec ! + E? 2; 3: 4_5"N !* and no XGP online ! + :I0 0 7' !* then add current filename to be processed ! + "# ER 2; 3: 4_5 !* XGP is online, so open it ! + FS IF CDATE-Q8"L !* If source creation date newer than XGP ! + :I0 0 7' !* then add current filename to be processed ! + "# 1U9' !* good XGP already exists, but lrec not up to date ! + EC''' !* close XGP file ! + Q1-(Q1+5FS WORD&777777000000./1000000.*5)+10 U1 !* bump Q1 past subentry ! + > + Q1+5U1 !* bump Q1 past -1 entry terminator ! + > + FQ0+Q9"E FT Everything_up_to_date.' !* Everything may be up to date ! + "# QRunoff_@_TemplateU8 !* Otherwise, @ Template into Q8 ! + ET 6 ET DSK: _@XGP !* Make output file default ! + FS DFILEU7 !* Output file name into Q7 ! + :I0 0 8 !* Add on command to call @ and XGP ! + FT0 !* Display commands ! + FT_(Y_or_N_or_^R)? !* Query user ! + FI:FCU1 !* Get answer in Q1 ! + Q1-YF"E'"#WQ1-'"E !* If answer is Y or ^R then go on ! + HK G0 0J !* Clear buffer and insert Q0 ! + Q1-"E 0[..F !* If answer is ^R, enter recursive ^R mode ! + [..J :I..J Edit_Runoff_Commands + 0U..H  ]..J ]..F' !* Abort by ctl-] ! + ET 6 ET DSK: _EEEOUT !* Make command file default ! + 0J I E DEVICE_FULL, SYSTEM_FULL, ?U? + !* Insert error strings for XXFILE ! + ZJ I :DELETE_ !* Insert command to delete command file ! + G(FS DFILE) + I + + EIEE !* Write out file of commands ! + FS O FILEU6 !* Get name of command file in Q6 ! + ET 6 ET DSK: _XXXOUT !* Make XXFILE output file default ! + FS DFILEU7 !* Get name of XXFILE output file in Q7 ! + FS JNAME:F6 U8 !* Get job name in Q8 ! + @  :XXFILE_7_6/E/S + :DISOWN + 8$J$P' !* Quietly valret XXFILE of command file ! + 0U..H' !* Don't wait for char before redisplay ! +