From cc6a75f67d6f48f5160e46c4ca4a802c7a19895f Mon Sep 17 00:00:00 2001 From: rmkaplan Date: Thu, 30 Jan 2025 10:08:30 -0800 Subject: [PATCH] Change ARGLIST to SMARTARGLIST, improve Tedit interface --- lispusers/DOCUMENT.LCOM | Bin 8951 -> 8863 bytes lispusers/document | 682 ++++++++++++++++++---------------------- 2 files changed, 299 insertions(+), 383 deletions(-) diff --git a/lispusers/DOCUMENT.LCOM b/lispusers/DOCUMENT.LCOM index 704e8aa590a634e0420c7a92edba9bbe02e51104..c6f3c68ce29f876865e9790c372d101214002574 100644 GIT binary patch literal 8863 zcmd5?OK%(36_%(ph?y9$8x%!0=_#8cq!AGuQhdp-t06g*#^K8|BgaNsptLx$81dnf zR8lu6P-Kx!(OrNpTC_lcZVNk&7hQSNb$0=>C<=7bZ680N?RUyBkMJhRqXDXy8W zMMf@@Os2VoI;weAgHlFr^G1KNna|~mWEk5+V zy7QB3qv8Di$=sjKuMegNCu4uI$X+!n8A_(88n=`;wsYleBbTDPGe2s||Iz)~{M*~q z2*0e){QknHA-ZVpw_2n(ky>`r5|=X5=*?p>iC8PuB&Ckuau`y9CotmBw$zUBJ$mSuMK zdz;O!({`^=lk(JrEj#_OpP{u;VtsA>XfR#FznA&v^5u1BFUfa%7x?%1i#x&d>g684 zmY-Mn&e>Zj*t1nLLF-cK(puWc6$xOoJ*wv8m23_t!}$?aigA&5G@RUk*QsA$AR zxB9bT|L(}2)7Dm8+B}&YEQZs`oC;;F6!Wf6$BffC<;%2dc~-aC^Bl@+E!O;dz@TAJ zw`XB1-S%7$`=bqj0T~VeJR4BCNRCzSIt`af1#0&XW>YFwsBPAru8W%3Tscbb*{;`h z?ohXrp_2C4Y*Mq^@hIKyHY}%u%G7q8Oy(2-lb-80gb)xR<|~5aWr(<>w`S{p5`o*Dvh|Hl!x3SIm>; zI9-PdB^iW_K|zuV27Rx63#0HTUy4^X7;p{QrH!+jMjwv(PF$V#v1?(%2m>;GU zwQf%ir?YXNaYXs*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?03h7yd0G3)bN6zkdVSgj$LK diff --git a/lispusers/document b/lispusers/document index 746cee903..5b83014be 100644 --- a/lispusers/document +++ b/lispusers/document @@ -1,441 +1,357 @@ -(FILECREATED "29-Aug-86 11:35:58" {DANTE}LISP>DOCUMENT.;8 16000 - - changes to: (FNS Document.Title Document.Format Document.Create - Document.Begin Document.FileComments - Document.Functions Document.Variables - Document.Things Document.Information - Document.SectionHead - Document.FunctionCommentedP Document.Finish - Document.RunningHead) - (VARS DOCUMENTCOMS) - - previous date: "26-Aug-86 18:18:51" {DSK}DOCUMENT.;1 -) +(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10) + +(FILECREATED "10-Jan-2025 11:19:15" {WMEDLEY}document.;18 18780 + + :EDIT-BY rmk + + :CHANGES-TO (FNS Document.Create) + + :PREVIOUS-DATE " 9-Jan-2025 17:00:59" {WMEDLEY}document.;16) (PRETTYCOMPRINT DOCUMENTCOMS) -(RPAQQ DOCUMENTCOMS ((* * This program creates documentation for any - Lisp package in the style of the Lisp Users - documentation. It requires that the code for - the package be loaded. It does not completely - format the document, but it minimizes the - amount of work that the documenter must do. - To make most effective use of these - functions, each function in the package being - documented must have a comment as the first - expression in the function after the - timestamp. Similarly, the COMS variable of - the file should contain a comment - (like this one) - as the first item in the list. This package - was documented using itself.) - (FNS Document.Create Document.Begin Document.FileComments - Document.Functions Document.Variables Document.Things - Document.Finish Document.RunningHead Document.Title - Document.Information Document.SectionHead Document.Format - Document.FunctionCommentedP))) - (* * This program creates documentation for any Lisp package in the style of the Lisp Users -documentation. It requires that the code for the package be loaded. It does not completely -format the document, but it minimizes the amount of work that the documenter must do. To make -most effective use of these functions, each function in the package being documented must have -a comment as the first expression in the function after the timestamp. Similarly, the COMS -variable of the file should contain a comment (like this one) as the first item in the list. -This package was documented using itself.) +(RPAQQ DOCUMENTCOMS ( + +(* ;;; "This program creates documentation for any Lisp package in the style of the Lisp Users documentation. It requires that the code for the package be loaded. It does not completely format the document, but it minimizes the amount of work that the documenter must do. To make most effective use of these functions, each function in the package being documented must have a comment as the first expression in the function after the timestamp. Similarly, the COMS variable of the file should contain a comment (like this one) as the first item in the list. This package was documented using itself.") + + (FNS Document.Create Document.Begin Document.FileComments Document.Functions + Document.Variables Document.Things Document.Finish Document.RunningHead + Document.Title Document.Information Document.SectionHead Document.Format + Document.FunctionCommentedP Document.Insert.Comment))) + + + +(* ;;; +"This program creates documentation for any Lisp package in the style of the Lisp Users documentation. It requires that the code for the package be loaded. It does not completely format the document, but it minimizes the amount of work that the documenter must do. To make most effective use of these functions, each function in the package being documented must have a comment as the first expression in the function after the timestamp. Similarly, the COMS variable of the file should contain a comment (like this one) as the first item in the list. This package was documented using itself." +) (DEFINEQ (Document.Create - [LAMBDA (FileName) (* Newman "29-Aug-86 10:07") - - (* * This function builds a document for a loaded file. The document is in the style of the Lisp Library package  - documentation. The function collects comments from the COMS variable of the file and from the functions in the  - file. It also collects some information from the Interlisp-D file package. This is the top-level function in the  - ODCUMENT package.) - - - (if (MEMBER FileName FILELST) - then (RESETLST (RESETSAVE (CURSOR WAITINGCURSOR)) - (LET ((Stream (OPENTEXTSTREAM)) - Pointer) - (Document.Begin FileName Stream) - (SETQ Pointer (ADD1 (GETEOFPTR - Stream))) - (Document.FileComments FileName - Stream) - (Document.Functions FileName Stream) - (Document.Variables FileName Stream) - (Document.Things FileName Stream - (QUOTE MACROS) - (QUOTE Macro)) - (Document.Things FileName Stream - (QUOTE RECORDS) - (QUOTE Record)) - (Document.Finish Stream Pointer))) - else (ERROR FileName " not a loaded file."]) + [LAMBDA (FileName) (* ; "Edited 10-Jan-2025 11:19 by rmk") + (* Newman "29-Aug-86 10:07") + +(* ;;; "This function builds a document for a loaded file. The document is in the style of the Lisp Library package documentation. The function collects comments from the COMS variable of the file and from the functions in the file. It also collects some information from the Interlisp-D file package. This is the top-level function in the DOCUMENT package.") + + (if (MEMBER FileName FILELST) + then (RESETLST + [LET ([Stream (OPENTEXTSTREAM NIL NIL '(HISTORY OFF FONT (MODERN 10 MRR] + Pointer) + (Document.Begin FileName Stream) + (SETQ Pointer (ADD1 (GETEOFPTR Stream))) + (Document.FileComments FileName Stream) + (Document.Functions FileName Stream) + (Document.Variables FileName Stream) + (Document.Things FileName Stream 'MACROS 'Macro) + (Document.Things FileName Stream 'RECORDS 'Record) + (Document.Finish Stream Pointer) + (TEDIT Stream NIL NIL '(HISTORY ON]) + else (ERROR FileName " not a loaded file."]) (Document.Begin - [LAMBDA (FileName Stream) (* Newman "29-Aug-86 10:23") - - (* * This function initializes the begining of the document stream.) + [LAMBDA (FileName Stream) (* Newman "29-Aug-86 10:23") + (* * This function initializes the begining of the document stream.) (Document.RunningHead FileName Stream) - (Document.Title FileName Stream (ADD1 (GETEOFPTR Stream))) - (Document.Information FileName Stream (ADD1 (GETEOFPTR Stream] -) + (Document.Title FileName Stream (ADD1 (GETEOFPTR Stream))) + (Document.Information FileName Stream (ADD1 (GETEOFPTR Stream]) (Document.FileComments - [LAMBDA (FileName Stream) (* Newman "29-Aug-86 10:17") - - (* * This function places all comments found in the COMS variable of FileName into Stream. It is intended for use  - in documenting a Lisp code file. Ideally, these commends would be distributed through the documentation as they are - distributed through the COMS variable.) + [LAMBDA (FileName Stream) (* ; "Edited 8-Jan-2025 23:49 by rmk") + (* Newman "29-Aug-86 10:17") + (* * This function places all comments found in the COMS variable of FileName + into Stream. It is intended for use in documenting a Lisp code file. + Ideally, these commends would be distributed through the documentation as they + are distributed through the COMS variable.) (Document.SectionHead Stream "INTRODUCTION") - (PROMPTPRINT "Collecting File Comments ...") - (for Descriptor in (FILECOMSLST FileName (QUOTE *)) - do (printout Stream .PPFTL (REMOVE (QUOTE *) - Descriptor) - T]) + (PROMPTPRINT "Collecting File Comments ...") + (for Comment in (FILECOMSLST FileName '*) do (Document.Insert.Comment Stream Comment]) (Document.Functions - [LAMBDA (FileName Stream) (* Newman "29-Aug-86 10:25") - - (* * This function documents the Functions on FileName into Stream. It does this by obtaining the function names  - from the file package, using the ARGLIST function to obtain the argument list, and obtainin the initial comment in  - the function if it exists.) + [LAMBDA (FileName Stream) (* ; "Edited 8-Jan-2025 14:16 by rmk") + (* ; "Edited 6-Jan-2025 12:15 by rmk") + (* Newman "29-Aug-86 10:25") + (* * This function documents the Functions on FileName into Stream. + It does this by obtaining the function names from the file package, using the + ARGLIST function to obtain the argument list, and obtainin the initial comment in + the function if it exists.) (Document.SectionHead Stream "FUNCTIONS") - (PROMPTPRINT "Collecting Function Comments ... ") - (for Function in (FILEFNSLST FileName) - do (TEDIT.INSERT Stream (CONCAT "(" Function " ") - (ADD1 (GETEOFPTR Stream)) - (FONTCREATE (QUOTE MODERN) - 10 - (QUOTE MRR))) - (TEDIT.INSERT Stream (SUBSTRING (MKSTRING - (ARGLIST Function)) - 2 -2) - (ADD1 (GETEOFPTR Stream)) - (FONTCREATE (QUOTE MODERN) - 10 - (QUOTE ITALIC))) - (TEDIT.INSERT Stream (CONCAT ") [Function]" - (CHARACTER 13)) - (ADD1 (GETEOFPTR Stream)) - (FONTCREATE (QUOTE MODERN) - 10 - (QUOTE MRR))) - - (* * This SETFILEPTR is here because someone leaves the FILEPTR in the wrong place.) - - - (SETFILEPTR Stream (GETEOFPTR Stream)) - (if (Document.FunctionCommentedP Function) - then (printout - Stream .PPVTL - [REMOVE (QUOTE *) - (CADDDR - (OR (GETPROP Function - (QUOTE EXPR)) - (GETD Function] - T]) + (PROMPTPRINT "Collecting Function Comments ... ") + (for Function in (FILEFNSLST FileName) do (TEDIT.INSERT Stream (CONCAT "(" Function " ") + (ADD1 (GETEOFPTR Stream)) + (FONTCREATE 'MODERN 10 'MRR)) + (TEDIT.INSERT Stream (SUBSTRING (MKSTRING (SMARTARGLIST + Function T)) + 2 -2) + (ADD1 (GETEOFPTR Stream)) + (FONTCREATE 'MODERN 10 'ITALIC)) + (TEDIT.INSERT Stream (CONCAT ") [Function]" + (CHARACTER 13)) + (ADD1 (GETEOFPTR Stream)) + (FONTCREATE 'MODERN 10 'MRR)) + + (* * This SETFILEPTR is here because someone leaves the FILEPTR in the wrong + place.) + + (SETFILEPTR Stream (GETEOFPTR Stream)) + (Document.Insert.Comment Stream ( + Document.FunctionCommentedP + Function]) (Document.Variables - [LAMBDA (FileName Stream) (* Newman "29-Aug-86 10:28") - - (* This function is intended for use while documenting Lisp code. It collects a list of the variables from  - FileName, and places them in Stream in the format of the Lisp Library Documentation.) + [LAMBDA (FileName Stream) (* ; "Edited 9-Jan-2025 11:49 by rmk") + (* Newman "29-Aug-86 10:28") + (* This function is intended for use while documenting Lisp code. + It collects a list of the variables from FileName, and places them in Stream in + the format of the Lisp Library Documentation.) (Document.SectionHead Stream "VARIABLES") - (PROMPTPRINT "Collecting Variables ...") - (for Variable in (FILECOMSLST FileName (QUOTE VARS)) - do (if (MEMBER Variable (FILECOMSLST FileName - (QUOTE GLOBALVARS) - )) - then (printout Stream Variable , " [GlobalVar]" T) - elseif (MEMBER Variable (FILECOMSLST FileName - (QUOTE - SPECVARS))) - then (printout Stream Variable , " [SpecialVar]" T) - else (printout Stream Variable , " [Variable]" T]) + (PROMPTPRINT "Collecting Variables ...") + (DSPFONT '(MODERN 10 MRR) + Stream) + (for Variable in (FILECOMSLST FileName 'VARS) + do (if (MEMBER Variable (FILECOMSLST FileName 'GLOBALVARS)) + then (printout Stream Variable %, " [GlobalVar]" T) + elseif (MEMBER Variable (FILECOMSLST FileName 'SPECVARS)) + then (printout Stream Variable %, " [SpecialVar]" T) + else (printout Stream Variable %, " [Variable]" T]) (Document.Things - [LAMBDA (FileName Stream FilePkgType TypeName) - (* Newman "29-Aug-86 10:32") - - (* This function is intended for use while documenting Lisp code. It collects a list of items of type TypeName,  - that are written using the FilePkgType file package command, from FileName, and places them in Stream in the format - of the Lisp Library Documentation.) - - - (if (AND FilePkgType (MEMBER FilePkgType FILEPKGTYPES)) - then (if (FILECOMSLST FileName FilePkgType) - then (Document.SectionHead - Stream - (CONCAT (U-CASE (SETQ TypeName - (OR TypeName - FilePkgType))) - "S")) - (PROMPTPRINT (CONCAT "Collecting " - TypeName " ...")) - (for Thing in (FILECOMSLST FileName - FilePkgType) - do (printout Stream Thing , - (CONCAT (CHARACTER - 9) - "[" TypeName "]") - T))) - else (ERROR FilePkgType "Bad file package type: "]) + [LAMBDA (FileName Stream FilePkgType TypeName) (* ; "Edited 9-Jan-2025 11:50 by rmk") + (* Newman "29-Aug-86 10:32") + + (* This function is intended for use while documenting Lisp code. + It collects a list of items of type TypeName, that are written using the + FilePkgType file package command, from FileName, and places them in Stream in the + format of the Lisp Library Documentation.) + + (if (AND FilePkgType (MEMBER FilePkgType FILEPKGTYPES)) + then (if (FILECOMSLST FileName FilePkgType) + then (Document.SectionHead Stream (CONCAT (U-CASE (SETQ TypeName (OR TypeName + FilePkgType))) + "S")) + (PROMPTPRINT (CONCAT "Collecting " TypeName " ...")) + (DSPFONT '(MODERN 10 MRR) + Stream) + (for Thing in (FILECOMSLST FileName FilePkgType) + do (printout Stream Thing %, (CONCAT (CHARACTER 9) + "[" TypeName "]") + T))) + else (ERROR FilePkgType "Bad file package type: "]) (Document.Finish - [LAMBDA (Stream Pointer) (* Newman "28-Aug-86 15:22") - - (* * This function performs formatting and the like to make the document pretty, and to make the format correct as  - specified.) - - - - (* * Set the selection to cover the non-header portions of the file.) - - - (TEDIT.SETSEL Stream Pointer (DIFFERENCE (GETEOFPTR Stream) - Pointer) - (QUOTE LEFT)) - - (* * Eliminate extra spaces) - - - (bind (Num _ 1) repeatuntil (ZEROP Num) - do (SETQ Num (TEDIT.SUBSTITUTE Stream " " " "))) - - (* * Eliminate carriage returns that I think are introduced by printout) + [LAMBDA (Stream Pointer) (* ; "Edited 9-Jan-2025 17:00 by rmk") + (* Newman "28-Aug-86 15:22") +(* ;;; "This function performs formatting and the like to make the document pretty, and to make the format correct as specified.") - (TEDIT.SUBSTITUTE Stream (CONCAT (CHARACTER 13) - " ") - " ") +(* ;;; "Set the selection to cover the non-header portions of the file.") - (* * For some reason, the paragraph breaks don't work unless this line is here.) - - - (TEDIT.SUBSTITUTE Stream (MKSTRING (CHARACTER 13)) - (MKSTRING (CHARACTER 13))) - - (* * Set the page, paragraph, and character looks of the non-header portions of the document.) + (TEDIT.SETSEL Stream Pointer (DIFFERENCE (GETEOFPTR Stream) + Pointer)) +(* ;;; "Set the page, paragraph, and character looks of the non-header portions of the document.") (Document.Format Stream) - (* * TEdit the stream so the user can finish the job by hand.) +(* ;;; "TEdit the stream so the user can finish the job by hand.") - - (TEDIT Stream]) + (TEDIT.SETSEL Stream 1 0 'LEFT) + (TEDIT Stream]) (Document.RunningHead - [LAMBDA (FileName Stream) (* Newman "28-Aug-86 15:57") - - (* * This function creates the running header for the document.) - - - (TEDIT.INSERT Stream "XEROX" 0 (FONTCREATE (QUOTE LOGO) - 24)) - (TEDIT.INSERT Stream (CONCAT " " (CHARACTER 9) - FileName - (CHARACTER 13) - (CHARACTER 13)) - NIL - (FONTCREATE (QUOTE MODERN) - 10)) - (TEDIT.INSERT.OBJECT (HRULE.CREATE (QUOTE 2)) - Stream - (GETEOFPTR Stream)) - (TEDIT.PARALOOKS (TEXTOBJ Stream) - (QUOTE (TYPE PAGEHEADING SUBTYPE RUNNINGHEAD - RIGHTMARGIN 456 LEFTMARGIN 0 TABS - (NIL (456 . RIGHT)) - QUAD JUSTIFIED)) - 0 - (ADD1 (GETEOFPTR Stream))) - - (* * we set the file ptr to be kind to others, as TEDIT.PARALOOKS moves it from the end of the file.) - - - (SETFILEPTR Stream (GETFILEPTR Stream]) + [LAMBDA (FileName Stream) (* ; "Edited 9-Jan-2025 16:58 by rmk") + (* Newman "28-Aug-86 15:57") + + (* * This function creates the running header for the document.) + + (TEDIT.INSERT Stream "Medley" 0 (FONTCREATE 'TIMESROMAN 36 'BOLD)) + (TEDIT.INSERT Stream (CONCAT " " (CHARACTER 9) + FileName + (CHARACTER 13) + (CHARACTER 13)) + NIL + (FONTCREATE 'MODERN 10)) + (TEDIT.INSERT.OBJECT (HRULE.CREATE '2) + Stream + (GETEOFPTR Stream)) + (TEDIT.PARALOOKS (TEXTOBJ Stream) + '(TYPE PAGEHEADING SUBTYPE RUNNINGHEAD RIGHTMARGIN 456 LEFTMARGIN 0 TABS + (NIL (456 . RIGHT)) + QUAD JUSTIFIED) + 0 + (ADD1 (GETEOFPTR Stream))) + + (* * we set the file ptr to be kind to others, as TEDIT.PARALOOKS moves it from + the end of the file.) + + (SETFILEPTR Stream (GETFILEPTR Stream]) (Document.Title - [LAMBDA (FileName Stream Pointer) (* Newman "29-Aug-86 11:35") - - (* * This function creates the title area of the document consisting of the name of the package being documented in - between two lines.) - - - (TERPRI Stream) - - (* This TERPRI is here because otherwise the first HRULE in the title becomes a part of the running header. - This happens for no apparent reason, and is a mystery to me.) - - - (TEDIT.INSERT.OBJECT (HRULE.CREATE (QUOTE (5 4 1))) - Stream - (ADD1 (GETEOFPTR Stream))) - (TEDIT.INSERT Stream (CONCAT (CHARACTER 13) - FileName - (CHARACTER 13) - (CHARACTER 13)) - (ADD1 (GETEOFPTR Stream)) - (FONTCREATE (QUOTE MODERN) - 12 - (QUOTE BRR))) - (TEDIT.INSERT.OBJECT (HRULE.CREATE (QUOTE (1 4 5))) - Stream - (GETEOFPTR Stream)) - (TEDIT.PARALOOKS (TEXTOBJ Stream) - (QUOTE (TYPE NIL PARALEADING 6 LINELEADING 4 - RIGHTMARGIN 312 LEFTMARGIN 138 - 1STLEFTMARGIN 138 QUAD CENTERED)) - Pointer - (DIFFERENCE (ADD1 (GETEOFPTR Stream)) - Pointer)) - - (* * This call to SETFILEPTR is here because I believe TEDIT.PARALOOKS does not leave the file pointer at the end  - of the stream as the printout function requires. I believe that if I eliminate all calls to printout, I can  - eliminate all calls to SETFILEPTR. I also believe that PRINTOUT can always be replaced by TEDIT.INSERT.) - - - (SETFILEPTR Stream (GETEOFPTR Stream]) + [LAMBDA (FileName Stream Pointer) (* Newman "29-Aug-86 11:35") + + (* * This function creates the title area of the document consisting of the name + of the package being documented in between two lines.) + + (TERPRI Stream) + + (* This TERPRI is here because otherwise the first HRULE in the title becomes a + part of the running header. This happens for no apparent reason, and is a mystery + to me.) + + (TEDIT.INSERT.OBJECT (HRULE.CREATE '(5 4 1)) + Stream + (ADD1 (GETEOFPTR Stream))) + (TEDIT.INSERT Stream (CONCAT (CHARACTER 13) + FileName + (CHARACTER 13) + (CHARACTER 13)) + (ADD1 (GETEOFPTR Stream)) + (FONTCREATE 'MODERN 12 'BRR)) + (TEDIT.INSERT.OBJECT (HRULE.CREATE '(1 4 5)) + Stream + (GETEOFPTR Stream)) + (TEDIT.PARALOOKS (TEXTOBJ Stream) + '(TYPE NIL PARALEADING 6 LINELEADING 4 RIGHTMARGIN 312 LEFTMARGIN 138 1STLEFTMARGIN 138 + QUAD CENTERED) + Pointer + (DIFFERENCE (ADD1 (GETEOFPTR Stream)) + Pointer)) + + (* * This call to SETFILEPTR is here because I believe TEDIT.PARALOOKS does not + leave the file pointer at the end of the stream as the printout function + requires. I believe that if I eliminate all calls to printout, I can eliminate + all calls to SETFILEPTR. I also believe that PRINTOUT can always be replaced by + TEDIT.INSERT.) + + (SETFILEPTR Stream (GETEOFPTR Stream]) (Document.Information - [LAMBDA (FileName Stream Pointer) (* Newman "29-Aug-86 10:37") - - (* * This function creates the information at the top of the document, including the form for the author's name and - a list of other packages necessary to run this package.) - - - (TEDIT.INSERT Stream (CONCAT - " By: >>Author's Name<< (>>Net Address<<)" - (CHARACTER 13) - " " - (SUBSTRING (DATE) - 1 9) - (CHARACTER 13)) - (ADD1 (GETEOFPTR Stream)) - (FONTCREATE (QUOTE MODERN) - 10) - T) - (if (FILECOMSLST FileName (QUOTE FILES)) - then (TEDIT.INSERT - Stream - (CONCAT "The following packages are loaded by " - FileName ": " - (SUBSTRING (MKSTRING - (FILECOMSLST FileName - (QUOTE - FILES))) - 2 -2) - (CHARACTER 13) - " ") - (ADD1 (GETEOFPTR Stream)) - (FONTCREATE (QUOTE MODERN) - 10) - T)) - (TEDIT.PARALOOKS (TEXTOBJ Stream) - (QUOTE (RIGHTMARGIN 456 LEFTMARGIN 0 - 1STLEFTMARGIN 0 QUAD - CENTERED PARALEADING 17)) - Pointer - (ADD1 (GETEOFPTR Stream))) - - (* The following SETFILEPTR exists because TEDIT.PARALOOKS does not leave the file pointer at the end of the file.) - - - (SETFILEPTR Stream (GETEOFPTR Stream]) + [LAMBDA (FileName Stream Pointer) (* Newman "29-Aug-86 10:37") + + (* * This function creates the information at the top of the document, including + the form for the author's name and a list of other packages necessary to run this + package.) + + (TEDIT.INSERT Stream (CONCAT " By: >>Author's Name<< (>>Net Address<<)" (CHARACTER 13) + " " + (SUBSTRING (DATE) + 1 9) + (CHARACTER 13)) + (ADD1 (GETEOFPTR Stream)) + (FONTCREATE 'MODERN 10) + T) + (if (FILECOMSLST FileName 'FILES) + then (TEDIT.INSERT Stream (CONCAT "The following packages are loaded by " FileName ": " + (SUBSTRING (MKSTRING (FILECOMSLST FileName 'FILES)) + 2 -2) + (CHARACTER 13) + " ") + (ADD1 (GETEOFPTR Stream)) + (FONTCREATE 'MODERN 10) + T)) + (TEDIT.PARALOOKS (TEXTOBJ Stream) + '(RIGHTMARGIN 456 LEFTMARGIN 0 1STLEFTMARGIN 0 QUAD CENTERED PARALEADING 17) + Pointer + (ADD1 (GETEOFPTR Stream))) + + (* The following SETFILEPTR exists because TEDIT.PARALOOKS does not leave the + file pointer at the end of the file.) + + (SETFILEPTR Stream (GETEOFPTR Stream]) (Document.SectionHead - [LAMBDA (Stream String) (* Newman "29-Aug-86 10:39") - - (* * This function is intended to create the bold section headings in Stream that are needed for the Lisp Users  - document style.) - + [LAMBDA (Stream String) (* Newman "29-Aug-86 10:39") - (TEDIT.INSERT Stream (CONCAT String (CHARACTER 13)) - (ADD1 (GETEOFPTR Stream)) - (FONTCREATE (QUOTE MODERN) - 10 - (QUOTE BRR))) - (SETFILEPTR Stream (GETEOFPTR Stream)) + (* * This function is intended to create the bold section headings in Stream that + are needed for the Lisp Users document style.) - (* * The following TEDIT.CARETLOOKS prevents the bolding from continuing past the section heading in some cases.) + (TEDIT.INSERT Stream (CONCAT String (CHARACTER 13)) + (ADD1 (GETEOFPTR Stream)) + (FONTCREATE 'MODERN 10 'BRR)) + (SETFILEPTR Stream (GETEOFPTR Stream)) + (* * The following TEDIT.CARETLOOKS prevents the bolding from continuing past the + section heading in some cases.) - (TEDIT.CARETLOOKS Stream (FONTCREATE (QUOTE MODERN) - 10 - (QUOTE MRR]) + (TEDIT.CARETLOOKS Stream (FONTCREATE 'MODERN 10 'MRR]) (Document.Format - [LAMBDA (Stream) (* Newman "29-Aug-86 10:54") - - (* * This function formats the document. It sets the page layout, font looks, and paragraph formatting for all  - selected text.) - - - (TEDIT.SUBLOOKS Stream (QUOTE (FAMILY GACHA)) - (QUOTE (FAMILY MODERN SIZE 10))) - (TEDIT.PARALOOKS (TEXTOBJ Stream) - (QUOTE (TABS (NIL (0 . RIGHT) - (456 . RIGHT)) - LINELEADING 4 PARALEADING 11 - RIGHTMARGIN 456 LEFTMARGIN 0 - 1STLEFTMARGIN 0 QUAD JUSTIFIED)) - (TEDIT.GETSEL Stream)) - (TEDIT.PAGEFORMAT Stream (TEDIT.COMPOUND.PAGEFORMAT - (TEDIT.SINGLE.PAGEFORMAT - T 26.5 3.0 (QUOTE (MODERN 10)) - (QUOTE CENTERED) - 7.0 6.0 8.0 8.0 1 38.0 0 - (QUOTE ((RUNNINGHEAD 7.0 62.0))) - (QUOTE PICAS) - (QUOTE (STARTINGPAGE# 1)) - (QUOTE LETTER)) - (TEDIT.SINGLE.PAGEFORMAT - T 26.5 3.5 (QUOTE (MODERN 10)) - (QUOTE CENTERED) - 7.0 6.0 8.0 8.0 1 38.0 0 - (QUOTE ((RUNNINGHEAD 7.0 62.0))) - (QUOTE PICAS) - (QUOTE (STARTINGPAGE# 1)) - (QUOTE LETTER)) - (TEDIT.SINGLE.PAGEFORMAT - T 26.5 3.0 (QUOTE (MODERN 10)) - (QUOTE CENTERED) - 7.0 6.0 8.0 8.0 1 38.0 0 - (QUOTE ((RUNNINGHEAD 7.0 62.0))) - (QUOTE PICAS) - (QUOTE (STARTINGPAGE# 1)) - (QUOTE LETTER]) + [LAMBDA (Stream) (* ; "Edited 9-Jan-2025 16:57 by rmk") + (* Newman "29-Aug-86 10:54") + + (* * This function formats the document. It sets the page layout, font looks, and + paragraph formatting for all selected text.) + + (TEDIT.SETSEL Stream Pointer (DIFFERENCE (GETEOFPTR Stream) + Pointer)) + (TEDIT.PARALOOKS Stream '(TABS (NIL (0 . RIGHT) + (456 . RIGHT)) + LINELEADING 4 PARALEADING 11 RIGHTMARGIN 456 LEFTMARGIN 0 + 1STLEFTMARGIN 0 QUAD JUSTIFIED) + (TEDIT.GETSEL Stream)) + (TEDIT.PAGEFORMAT Stream (TEDIT.COMPOUND.PAGEFORMAT (TEDIT.SINGLE.PAGEFORMAT + T 26.5 3.0 '(MODERN 10) + 'CENTERED 7.0 6.0 8.0 8.0 1 38.0 0 + '((RUNNINGHEAD 7.0 62.0)) + 'PICAS + '(STARTINGPAGE# 1) + 'LETTER) + (TEDIT.SINGLE.PAGEFORMAT T 26.5 3.5 '(MODERN 10) + 'CENTERED 7.0 6.0 8.0 8.0 1 38.0 0 + '((RUNNINGHEAD 7.0 62.0)) + 'PICAS + '(STARTINGPAGE# 1) + 'LETTER) + (TEDIT.SINGLE.PAGEFORMAT T 26.5 3.0 '(MODERN 10) + 'CENTERED 7.0 6.0 8.0 8.0 1 38.0 0 + '((RUNNINGHEAD 7.0 62.0)) + 'PICAS + '(STARTINGPAGE# 1) + 'LETTER]) (Document.FunctionCommentedP - [LAMBDA (Function) (* Newman "29-Aug-86 10:42") - - (* * This function is intended to tell if a function has an initial comment or not.) - - - (EQUAL (QUOTE *) - (CAR (CADDDR (OR (GETPROP Function (QUOTE EXPR)) - (GETD Function) - (ERROR Function - "Not a function: "]) + [LAMBDA (Function) (* ; "Edited 8-Jan-2025 21:06 by rmk") + (* Newman "29-Aug-86 10:42") + + (* ;; "Hack for old format dates, like Newman here.") + + (for X in [CDDR (GETDEF Function NIL NIL '(NOERROR] + unless [OR (EDITDATE? X) + (AND (EQ '* (CAR X)) + (IDATE (CADDR X] do (RETURN (CL:IF (EQ '* (CAR X)) + X]) + +(Document.Insert.Comment + [LAMBDA (Stream Comment) (* ; "Edited 9-Jan-2025 16:56 by rmk") + (CL:WHEN (EQ '* (CAR (LISTP Comment))) + (DSPFONT '(MODERN 10 MRR) + Stream) + [if (AND (MEMB (CADR Comment) + '(; ;; ;;;)) + (STRINGP (CADDR Comment))) + then (PRIN3 (CADDR Comment) + Stream) + else [SETQ Comment (find TAIL on Comment suchthat (NEQ (CAR TAIL) + '*] + (for TAIL on Comment do (PRIN3 (CAR TAIL) + Stream) + (CL:WHEN (CDR TAIL) + (PRIN3 " " Stream] + (TERPRI Stream))]) ) -(DECLARE: DONTCOPY - (FILEMAP (NIL (2105 15978 (Document.Create 2115 . 3381) (Document.Begin -3383 . 3767) (Document.FileComments 3769 . 4450) (Document.Functions -4452 . 6022) (Document.Variables 6024 . 6914) (Document.Things 6916 . -8000) (Document.Finish 8002 . 9249) (Document.RunningHead 9251 . 10257) -(Document.Title 10259 . 11911) (Document.Information 11913 . 13348) ( -Document.SectionHead 13350 . 14077) (Document.Format 14079 . 15572) ( -Document.FunctionCommentedP 15574 . 15976))))) +(DECLARE%: DONTCOPY + (FILEMAP (NIL (1966 18757 (Document.Create 1976 . 3395) (Document.Begin 3397 . 3780) ( +Document.FileComments 3782 . 4546) (Document.Functions 4548 . 6841) (Document.Variables 6843 . 7867) ( +Document.Things 7869 . 9305) (Document.Finish 9307 . 10127) (Document.RunningHead 10129 . 11258) ( +Document.Title 11260 . 12944) (Document.Information 12946 . 14512) (Document.SectionHead 14514 . 15170 +) (Document.Format 15172 . 17303) (Document.FunctionCommentedP 17305 . 17883) (Document.Insert.Comment + 17885 . 18755))))) STOP