1
0
mirror of https://github.com/PDP-10/its.git synced 2026-01-31 22:12:14 +00:00

RUNOFF - Emacs library for :R etc.

This commit is contained in:
Lars Brinkhoff
2019-06-14 21:49:46 +02:00
parent a2aa6299ce
commit ec94f3dd8b
3 changed files with 127 additions and 0 deletions

92
src/emacs1/runoff.2 Executable file
View File

@@ -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 !
<Q1-Z; !* Iterate until end of buffer !
Q1FS WORD:F6 U2 !* SNAME !
Q1+5U1 Q1FS WORD:F6 U3 !* DEV !
Q1+5U1 Q1FS WORD:F6 U4 !* FN1 !
Q1+5U1 Q1FS WORD:F6 U5 !* FN2 !
Q1+5U1 !* bump Q1 past FN2 !
<Q1FS WORD+1 @; !* Iterate through subentries !
Q1FS WORD-12."E !* Creation Date subentry !
!<! ER 2; 3: 4_> !* 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 !