lispusers/DOCUMENT cleaned up and working with current Tedit (#2023)
Cleaned up lispusers/DOCUMENT
This commit is contained in:
Binary file not shown.
@@ -1,441 +1,290 @@
|
|||||||
(FILECREATED "29-Aug-86 11:35:58" {DANTE}<NEWMAN>LISP>DOCUMENT.;8 16000
|
(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10)
|
||||||
|
|
||||||
changes to: (FNS Document.Title Document.Format Document.Create
|
(FILECREATED " 1-Feb-2025 08:25:02" {WMEDLEY}<lispusers>document.;27 16813
|
||||||
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}<LISPFILES>DOCUMENT.;1
|
:EDIT-BY rmk
|
||||||
)
|
|
||||||
|
:CHANGES-TO (FNS Document.FileComments Document.Functions Document.Variables Document.Things
|
||||||
|
Document.Create Document.Information Document.Format Document.Begin
|
||||||
|
Document.Title Document.RunningHead Document.SectionHead
|
||||||
|
Document.FunctionCommentedP)
|
||||||
|
|
||||||
|
:PREVIOUS-DATE "30-Jan-2025 11:55:23" {WMEDLEY}<lispusers>document.;19)
|
||||||
|
|
||||||
|
|
||||||
(PRETTYCOMPRINT DOCUMENTCOMS)
|
(PRETTYCOMPRINT DOCUMENTCOMS)
|
||||||
|
|
||||||
(RPAQQ DOCUMENTCOMS ((* * This program creates documentation for any
|
(RPAQQ DOCUMENTCOMS (
|
||||||
Lisp package in the style of the Lisp Users
|
|
||||||
documentation. It requires that the code for
|
(* ;;; "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.")
|
||||||
the package be loaded. It does not completely
|
|
||||||
format the document, but it minimizes the
|
(FNS Document.Create Document.Begin Document.FileComments Document.Functions
|
||||||
amount of work that the documenter must do.
|
Document.Variables Document.Things Document.RunningHead Document.Title
|
||||||
To make most effective use of these
|
Document.Information Document.SectionHead Document.Format
|
||||||
functions, each function in the package being
|
Document.FunctionCommentedP Document.Insert.Comment)))
|
||||||
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)
|
"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."
|
||||||
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.)
|
|
||||||
|
|
||||||
(DEFINEQ
|
(DEFINEQ
|
||||||
|
|
||||||
(Document.Create
|
(Document.Create
|
||||||
[LAMBDA (FileName) (* Newman "29-Aug-86 10:07")
|
[LAMBDA (FileName) (* ; "Edited 31-Jan-2025 15:06 by rmk")
|
||||||
|
(* ; "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
|
(* ;;; "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.")
|
||||||
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)
|
||||||
(if (MEMBER FileName FILELST)
|
then (RESETLST
|
||||||
then (RESETLST (RESETSAVE (CURSOR WAITINGCURSOR))
|
[LET ([Stream (OPENTEXTSTREAM NIL NIL '(HISTORY OFF FONT (MODERN 10 MRR]
|
||||||
(LET ((Stream (OPENTEXTSTREAM))
|
Pointer)
|
||||||
Pointer)
|
(SETQ Pointer (Document.Begin FileName Stream))
|
||||||
(Document.Begin FileName Stream)
|
(Document.FileComments FileName Stream)
|
||||||
(SETQ Pointer (ADD1 (GETEOFPTR
|
(Document.Functions FileName Stream)
|
||||||
Stream)))
|
(Document.Variables FileName Stream)
|
||||||
(Document.FileComments FileName
|
(Document.Things FileName Stream 'MACROS 'Macro)
|
||||||
Stream)
|
(Document.Things FileName Stream 'RECORDS 'Record)
|
||||||
(Document.Functions FileName Stream)
|
(Document.Format Stream Pointer)
|
||||||
(Document.Variables FileName Stream)
|
(TEDIT.SETSEL Stream 1 0 'LEFT)
|
||||||
(Document.Things FileName Stream
|
(TEXTSTREAM (TEDIT Stream NIL NIL '(HISTORY ON])
|
||||||
(QUOTE MACROS)
|
else (ERROR FileName " not a loaded file."])
|
||||||
(QUOTE Macro))
|
|
||||||
(Document.Things FileName Stream
|
|
||||||
(QUOTE RECORDS)
|
|
||||||
(QUOTE Record))
|
|
||||||
(Document.Finish Stream Pointer)))
|
|
||||||
else (ERROR FileName " not a loaded file."])
|
|
||||||
|
|
||||||
(Document.Begin
|
(Document.Begin
|
||||||
[LAMBDA (FileName Stream) (* Newman "29-Aug-86 10:23")
|
[LAMBDA (FileName Stream) (* ; "Edited 31-Jan-2025 14:56 by rmk")
|
||||||
|
(* Newman "29-Aug-86 10:23")
|
||||||
(* * This function initializes the begining of the document stream.)
|
|
||||||
|
|
||||||
|
(* ;; "This function initializes the begining of the document stream.")
|
||||||
|
|
||||||
(Document.RunningHead FileName Stream)
|
(Document.RunningHead FileName Stream)
|
||||||
(Document.Title FileName Stream (ADD1 (GETEOFPTR Stream)))
|
(Document.Title FileName Stream (ADD1 (GETEOFPTR Stream)))
|
||||||
(Document.Information FileName Stream (ADD1 (GETEOFPTR Stream]
|
(Document.Information FileName Stream (ADD1 (GETEOFPTR Stream])
|
||||||
)
|
|
||||||
|
|
||||||
(Document.FileComments
|
(Document.FileComments
|
||||||
[LAMBDA (FileName Stream) (* Newman "29-Aug-86 10:17")
|
[LAMBDA (FileName Stream) (* ; "Edited 1-Feb-2025 08:24 by rmk")
|
||||||
|
(* ; "Edited 8-Jan-2025 23:49 by rmk")
|
||||||
(* * This function places all comments found in the COMS variable of FileName into Stream. It is intended for use
|
(* Newman "29-Aug-86 10:17")
|
||||||
in documenting a Lisp code file. Ideally, these commends would be distributed through the documentation as they are
|
|
||||||
distributed through the COMS variable.)
|
|
||||||
|
|
||||||
|
(* ;; "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")
|
(Document.SectionHead Stream "INTRODUCTION")
|
||||||
(PROMPTPRINT "Collecting File Comments ...")
|
(for Comment in (FILECOMSLST FileName '*) do (Document.Insert.Comment Stream Comment])
|
||||||
(for Descriptor in (FILECOMSLST FileName (QUOTE *))
|
|
||||||
do (printout Stream .PPFTL (REMOVE (QUOTE *)
|
|
||||||
Descriptor)
|
|
||||||
T])
|
|
||||||
|
|
||||||
(Document.Functions
|
(Document.Functions
|
||||||
[LAMBDA (FileName Stream) (* Newman "29-Aug-86 10:25")
|
[LAMBDA (FileName Stream) (* ; "Edited 1-Feb-2025 08:24 by rmk")
|
||||||
|
(* ; "Edited 8-Jan-2025 14:16 by rmk")
|
||||||
(* * This function documents the Functions on FileName into Stream. It does this by obtaining the function names
|
(* ; "Edited 6-Jan-2025 12:15 by rmk")
|
||||||
from the file package, using the ARGLIST function to obtain the argument list, and obtainin the initial comment in
|
(* Newman "29-Aug-86 10:25")
|
||||||
the function if it exists.)
|
|
||||||
|
|
||||||
|
(* ;;; "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")
|
(Document.SectionHead Stream "FUNCTIONS")
|
||||||
(PROMPTPRINT "Collecting Function Comments ... ")
|
(for Function in (FILEFNSLST FileName) do (PRINTOUT Stream .FONT '(MODERN 10 MRR)
|
||||||
(for Function in (FILEFNSLST FileName)
|
"(" Function " " .FONT '(MODERN 10 ITALIC)
|
||||||
do (TEDIT.INSERT Stream (CONCAT "(" Function " ")
|
(SUBSTRING (MKSTRING (SMARTARGLIST Function T))
|
||||||
(ADD1 (GETEOFPTR Stream))
|
2 -2)
|
||||||
(FONTCREATE (QUOTE MODERN)
|
.FONT
|
||||||
10
|
'(MODERN 10 MRR)
|
||||||
(QUOTE MRR)))
|
")"
|
||||||
(TEDIT.INSERT Stream (SUBSTRING (MKSTRING
|
(CHARACTER 9)
|
||||||
(ARGLIST Function))
|
"[Function]" T)
|
||||||
2 -2)
|
(Document.Insert.Comment Stream (
|
||||||
(ADD1 (GETEOFPTR Stream))
|
Document.FunctionCommentedP
|
||||||
(FONTCREATE (QUOTE MODERN)
|
Function])
|
||||||
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])
|
|
||||||
|
|
||||||
(Document.Variables
|
(Document.Variables
|
||||||
[LAMBDA (FileName Stream) (* Newman "29-Aug-86 10:28")
|
[LAMBDA (FileName Stream) (* ; "Edited 1-Feb-2025 08:24 by rmk")
|
||||||
|
(* ; "Edited 9-Jan-2025 11:49 by rmk")
|
||||||
(* This function is intended for use while documenting Lisp code. It collects a list of the variables from
|
(* Newman "29-Aug-86 10:28")
|
||||||
FileName, and places them in Stream in the format of the Lisp Library Documentation.)
|
|
||||||
|
|
||||||
|
(* ;; "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")
|
(Document.SectionHead Stream "VARIABLES")
|
||||||
(PROMPTPRINT "Collecting Variables ...")
|
(DSPFONT '(MODERN 10 MRR)
|
||||||
(for Variable in (FILECOMSLST FileName (QUOTE VARS))
|
Stream)
|
||||||
do (if (MEMBER Variable (FILECOMSLST FileName
|
(for Variable in (FILECOMSLST FileName 'VARS)
|
||||||
(QUOTE GLOBALVARS)
|
do (PRINTOUT Stream Variable " " (CHARACTER 9)
|
||||||
))
|
"["
|
||||||
then (printout Stream Variable , " [GlobalVar]" T)
|
(if (MEMB Variable (FILECOMSLST FileName 'GLOBALVARS))
|
||||||
elseif (MEMBER Variable (FILECOMSLST FileName
|
then "GlobalVar"
|
||||||
(QUOTE
|
elseif (MEMB Variable (FILECOMSLST FileName 'SPECVARS))
|
||||||
SPECVARS)))
|
then "SpecialVar"
|
||||||
then (printout Stream Variable , " [SpecialVar]" T)
|
else "Variable")
|
||||||
else (printout Stream Variable , " [Variable]" T])
|
"]" T])
|
||||||
|
|
||||||
(Document.Things
|
(Document.Things
|
||||||
[LAMBDA (FileName Stream FilePkgType TypeName)
|
[LAMBDA (FileName Stream FilePkgType TypeName) (* ; "Edited 1-Feb-2025 08:24 by rmk")
|
||||||
(* Newman "29-Aug-86 10:32")
|
(* ; "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,
|
(* ;; "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.")
|
||||||
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))
|
||||||
(if (AND FilePkgType (MEMBER FilePkgType FILEPKGTYPES))
|
then (if (FILECOMSLST FileName FilePkgType)
|
||||||
then (if (FILECOMSLST FileName FilePkgType)
|
then (CL:UNLESS TypeName (SETQ TypeName FilePkgType))
|
||||||
then (Document.SectionHead
|
(Document.SectionHead Stream (CONCAT (U-CASE TypeName)
|
||||||
Stream
|
"S"))
|
||||||
(CONCAT (U-CASE (SETQ TypeName
|
(DSPFONT '(MODERN 10 MRR)
|
||||||
(OR TypeName
|
Stream)
|
||||||
FilePkgType)))
|
(for Thing in (FILECOMSLST FileName FilePkgType)
|
||||||
"S"))
|
do (PRINTOUT Stream Thing " " (CHARACTER 9)
|
||||||
(PROMPTPRINT (CONCAT "Collecting "
|
"[" TypeName "]" T)))
|
||||||
TypeName " ..."))
|
else (ERROR FilePkgType "Bad file package type: "])
|
||||||
(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)
|
|
||||||
|
|
||||||
|
|
||||||
(TEDIT.SUBSTITUTE Stream (CONCAT (CHARACTER 13)
|
|
||||||
" ")
|
|
||||||
" ")
|
|
||||||
|
|
||||||
(* * 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.)
|
|
||||||
|
|
||||||
|
|
||||||
(Document.Format Stream)
|
|
||||||
|
|
||||||
(* * TEdit the stream so the user can finish the job by hand.)
|
|
||||||
|
|
||||||
|
|
||||||
(TEDIT Stream])
|
|
||||||
|
|
||||||
(Document.RunningHead
|
(Document.RunningHead
|
||||||
[LAMBDA (FileName Stream) (* Newman "28-Aug-86 15:57")
|
[LAMBDA (FileName Stream) (* ; "Edited 31-Jan-2025 10:41 by rmk")
|
||||||
|
(* ; "Edited 9-Jan-2025 16:58 by rmk")
|
||||||
|
(* Newman "28-Aug-86 15:57")
|
||||||
|
|
||||||
(* * This function creates the running header for the document.)
|
(* ;; "This function creates the running header for the document.")
|
||||||
|
|
||||||
|
(PRINTOUT Stream .FONT '(TIMESROMAN 36 BOLD)
|
||||||
(TEDIT.INSERT Stream "XEROX" 0 (FONTCREATE (QUOTE LOGO)
|
"Medley " .FONT '(MODERN 10)
|
||||||
24))
|
(CHARACTER 9)
|
||||||
(TEDIT.INSERT Stream (CONCAT " " (CHARACTER 9)
|
FileName T T)
|
||||||
FileName
|
(TEDIT.INSERT.OBJECT (HRULE.CREATE '2)
|
||||||
(CHARACTER 13)
|
Stream
|
||||||
(CHARACTER 13))
|
(GETEOFPTR Stream))
|
||||||
NIL
|
(TEDIT.PARALOOKS Stream '(TYPE PAGEHEADING SUBTYPE RUNNINGHEAD RIGHTMARGIN 456 LEFTMARGIN 0 TABS
|
||||||
(FONTCREATE (QUOTE MODERN)
|
(NIL (456 . RIGHT))
|
||||||
10))
|
QUAD JUSTIFIED)
|
||||||
(TEDIT.INSERT.OBJECT (HRULE.CREATE (QUOTE 2))
|
0
|
||||||
Stream
|
(TEDIT.NCHARS 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])
|
|
||||||
|
|
||||||
(Document.Title
|
(Document.Title
|
||||||
[LAMBDA (FileName Stream Pointer) (* Newman "29-Aug-86 11:35")
|
[LAMBDA (FileName Stream Pointer) (* ; "Edited 31-Jan-2025 14:44 by rmk")
|
||||||
|
(* 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
|
(* ;;; "This function creates the title area of the document consisting of the name of the package being documented in between two lines.")
|
||||||
between two lines.)
|
|
||||||
|
|
||||||
|
(TERPRI Stream)
|
||||||
|
|
||||||
(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.")
|
||||||
|
|
||||||
(* This TERPRI is here because otherwise the first HRULE in the title becomes a part of the running header.
|
(TEDIT.INSERT.OBJECT (HRULE.CREATE '(5 4 1))
|
||||||
This happens for no apparent reason, and is a mystery to me.)
|
Stream
|
||||||
|
(ADD1 (TEDIT.NCHARS Stream)))
|
||||||
|
(SETFILEPTR Stream -1)
|
||||||
(TEDIT.INSERT.OBJECT (HRULE.CREATE (QUOTE (5 4 1)))
|
(PRINTOUT Stream .FONT '(MODERN 12 BRR)
|
||||||
Stream
|
T FileName T T)
|
||||||
(ADD1 (GETEOFPTR Stream)))
|
(TEDIT.INSERT.OBJECT (HRULE.CREATE '(1 4 5))
|
||||||
(TEDIT.INSERT Stream (CONCAT (CHARACTER 13)
|
Stream
|
||||||
FileName
|
(GETEOFPTR Stream))
|
||||||
(CHARACTER 13)
|
(TEDIT.PARALOOKS Stream
|
||||||
(CHARACTER 13))
|
'(TYPE NIL PARALEADING 6 LINELEADING 4 RIGHTMARGIN 312 LEFTMARGIN 138 1STLEFTMARGIN 138
|
||||||
(ADD1 (GETEOFPTR Stream))
|
QUAD CENTERED)
|
||||||
(FONTCREATE (QUOTE MODERN)
|
Pointer
|
||||||
12
|
(TEDIT.NCHARS Stream])
|
||||||
(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])
|
|
||||||
|
|
||||||
(Document.Information
|
(Document.Information
|
||||||
[LAMBDA (FileName Stream Pointer) (* Newman "29-Aug-86 10:37")
|
[LAMBDA (FileName Stream) (* ; "Edited 31-Jan-2025 15:10 by rmk")
|
||||||
|
(* 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
|
(* ;;; "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.")
|
||||||
a list of other packages necessary to run this package.)
|
|
||||||
|
|
||||||
|
(LET [(Pointer (ADD1 (TEDIT.NCHARS Stream]
|
||||||
|
(PRINTOUT Stream .FONT '(MODERN 10)
|
||||||
|
" By: >>Author's Name<< (>>Net Address<<)" T "Documentation created "
|
||||||
|
(DATE (DATEFORMAT NO.TIME YEAR.LONG SPACES NO.LEADING.SPACES))
|
||||||
|
T)
|
||||||
|
|
||||||
(TEDIT.INSERT Stream (CONCAT
|
(* ;; "LEN of TEDIT.NCHARS is certainly long enough")
|
||||||
" 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.)
|
(TEDIT.PARALOOKS Stream '(RIGHTMARGIN 456 LEFTMARGIN 0 1STLEFTMARGIN 0 QUAD CENTERED
|
||||||
|
PARALEADING 17)
|
||||||
|
Pointer
|
||||||
(SETFILEPTR Stream (GETEOFPTR Stream])
|
(TEDIT.NCHARS Stream))
|
||||||
|
(SETQ Pointer (ADD1 (TEDIT.NCHARS Stream)))
|
||||||
|
(CL:WHEN (FILECOMSLST FileName 'FILES)
|
||||||
|
(PRINTOUT Stream "The following files are loaded by " FileName ": "
|
||||||
|
(SUBSTRING (MKSTRING (FILECOMSLST FileName 'FILES))
|
||||||
|
2 -2)
|
||||||
|
T)
|
||||||
|
(TEDIT.PARALOOKS Stream '(QUAD LEFT PARALEADING 12)
|
||||||
|
Pointer
|
||||||
|
(TEDIT.NCHARS Stream)))
|
||||||
|
(ADD1 (TEDIT.NCHARS Stream])
|
||||||
|
|
||||||
(Document.SectionHead
|
(Document.SectionHead
|
||||||
[LAMBDA (Stream String) (* Newman "29-Aug-86 10:39")
|
[LAMBDA (Stream String) (* ; "Edited 31-Jan-2025 10:52 by rmk")
|
||||||
|
(* 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
|
(* ;;; "This function is intended to create the bold section headings in Stream that are needed for the Lisp Users document style.")
|
||||||
document style.)
|
|
||||||
|
|
||||||
|
(PRINTOUT Stream .FONT '(MODERN 10 BRR)
|
||||||
(TEDIT.INSERT Stream (CONCAT String (CHARACTER 13))
|
String T .FONT '(MODERN 10])
|
||||||
(ADD1 (GETEOFPTR Stream))
|
|
||||||
(FONTCREATE (QUOTE MODERN)
|
|
||||||
10
|
|
||||||
(QUOTE 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])
|
|
||||||
|
|
||||||
(Document.Format
|
(Document.Format
|
||||||
[LAMBDA (Stream) (* Newman "29-Aug-86 10:54")
|
[LAMBDA (Stream Pointer) (* ; "Edited 31-Jan-2025 12:24 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
|
(* ;;; "This function formats the document. It sets the page layout, font looks, and paragraph formatting for the non-heading part of the stream.")
|
||||||
selected text.)
|
|
||||||
|
|
||||||
|
(TEDIT.PARALOOKS Stream '(TABS (NIL (0 . RIGHT)
|
||||||
(TEDIT.SUBLOOKS Stream (QUOTE (FAMILY GACHA))
|
(456 . RIGHT))
|
||||||
(QUOTE (FAMILY MODERN SIZE 10)))
|
LINELEADING 4 PARALEADING 11 RIGHTMARGIN 456 LEFTMARGIN 0
|
||||||
(TEDIT.PARALOOKS (TEXTOBJ Stream)
|
1STLEFTMARGIN 0 QUAD JUSTIFIED)
|
||||||
(QUOTE (TABS (NIL (0 . RIGHT)
|
(ADD1 Pointer)
|
||||||
(456 . RIGHT))
|
(SUB1 (DIFFERENCE (TEDIT.NCHARS Stream)
|
||||||
LINELEADING 4 PARALEADING 11
|
Pointer)))
|
||||||
RIGHTMARGIN 456 LEFTMARGIN 0
|
(TEDIT.PAGEFORMAT Stream (TEDIT.COMPOUND.PAGEFORMAT (TEDIT.SINGLE.PAGEFORMAT
|
||||||
1STLEFTMARGIN 0 QUAD JUSTIFIED))
|
T 26.5 3.0 '(MODERN 10)
|
||||||
(TEDIT.GETSEL Stream))
|
'CENTERED 7.0 6.0 8.0 8.0 1 38.0 0
|
||||||
(TEDIT.PAGEFORMAT Stream (TEDIT.COMPOUND.PAGEFORMAT
|
'((RUNNINGHEAD 7.0 62.0))
|
||||||
(TEDIT.SINGLE.PAGEFORMAT
|
'PICAS
|
||||||
T 26.5 3.0 (QUOTE (MODERN 10))
|
'(STARTINGPAGE# 1)
|
||||||
(QUOTE CENTERED)
|
'LETTER)
|
||||||
7.0 6.0 8.0 8.0 1 38.0 0
|
(TEDIT.SINGLE.PAGEFORMAT T 26.5 3.5 '(MODERN 10)
|
||||||
(QUOTE ((RUNNINGHEAD 7.0 62.0)))
|
'CENTERED 7.0 6.0 8.0 8.0 1 38.0 0
|
||||||
(QUOTE PICAS)
|
'((RUNNINGHEAD 7.0 62.0))
|
||||||
(QUOTE (STARTINGPAGE# 1))
|
'PICAS
|
||||||
(QUOTE LETTER))
|
'(STARTINGPAGE# 1)
|
||||||
(TEDIT.SINGLE.PAGEFORMAT
|
'LETTER)
|
||||||
T 26.5 3.5 (QUOTE (MODERN 10))
|
(TEDIT.SINGLE.PAGEFORMAT T 26.5 3.0 '(MODERN 10)
|
||||||
(QUOTE CENTERED)
|
'CENTERED 7.0 6.0 8.0 8.0 1 38.0 0
|
||||||
7.0 6.0 8.0 8.0 1 38.0 0
|
'((RUNNINGHEAD 7.0 62.0))
|
||||||
(QUOTE ((RUNNINGHEAD 7.0 62.0)))
|
'PICAS
|
||||||
(QUOTE PICAS)
|
'(STARTINGPAGE# 1)
|
||||||
(QUOTE (STARTINGPAGE# 1))
|
'LETTER])
|
||||||
(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])
|
|
||||||
|
|
||||||
(Document.FunctionCommentedP
|
(Document.FunctionCommentedP
|
||||||
[LAMBDA (Function) (* Newman "29-Aug-86 10:42")
|
[LAMBDA (Function) (* ; "Edited 31-Jan-2025 11:08 by rmk")
|
||||||
|
(* ; "Edited 8-Jan-2025 21:06 by rmk")
|
||||||
|
(* Newman "29-Aug-86 10:42")
|
||||||
|
|
||||||
(* * This function is intended to tell if a function has an initial comment or not.)
|
(* ;; "Finds first comment in a function, skipping old and new format dates.")
|
||||||
|
|
||||||
|
(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])
|
||||||
|
|
||||||
(EQUAL (QUOTE *)
|
(Document.Insert.Comment
|
||||||
(CAR (CADDDR (OR (GETPROP Function (QUOTE EXPR))
|
[LAMBDA (Stream Comment) (* ; "Edited 9-Jan-2025 16:56 by rmk")
|
||||||
(GETD Function)
|
(CL:WHEN (EQ '* (CAR (LISTP Comment)))
|
||||||
(ERROR Function
|
(DSPFONT '(MODERN 10 MRR)
|
||||||
"Not a function: "])
|
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
|
(DECLARE%: DONTCOPY
|
||||||
(FILEMAP (NIL (2105 15978 (Document.Create 2115 . 3381) (Document.Begin
|
(FILEMAP (NIL (2235 16790 (Document.Create 2245 . 3791) (Document.Begin 3793 . 4283) (
|
||||||
3383 . 3767) (Document.FileComments 3769 . 4450) (Document.Functions
|
Document.FileComments 4285 . 5068) (Document.Functions 5070 . 6798) (Document.Variables 6800 . 7885) (
|
||||||
4452 . 6022) (Document.Variables 6024 . 6914) (Document.Things 6916 .
|
Document.Things 7887 . 9199) (Document.RunningHead 9201 . 10101) (Document.Title 10103 . 11195) (
|
||||||
8000) (Document.Finish 8002 . 9249) (Document.RunningHead 9251 . 10257)
|
Document.Information 11197 . 12653) (Document.SectionHead 12655 . 13106) (Document.Format 13108 .
|
||||||
(Document.Title 10259 . 11911) (Document.Information 11913 . 13348) (
|
15202) (Document.FunctionCommentedP 15204 . 15916) (Document.Insert.Comment 15918 . 16788)))))
|
||||||
Document.SectionHead 13350 . 14077) (Document.Format 14079 . 15572) (
|
|
||||||
Document.FunctionCommentedP 15574 . 15976)))))
|
|
||||||
STOP
|
STOP
|
||||||
|
|||||||
Reference in New Issue
Block a user