diff --git a/library/TEDITDCL b/library/TEDITDCL
index 2b6b8f47..4805d484 100644
--- a/library/TEDITDCL
+++ b/library/TEDITDCL
@@ -1,17 +1,163 @@
 (DEFINE-FILE-INFO READTABLE "INTERLISP" PACKAGE "INTERLISP")
-(FILECREATED "25-Aug-94 10:53:00" {DSK}<king>export>lispcore>library>TEDITDCL.;2 49062  
+(FILECREATED "30-Apr-2021 17:26:17" 
+{DSK}<Users>kaplan>Local>medley3.5>git-medley>library>TEDITDCL.;2 86155  
 
-      previous date%: "25-Aug-94 10:38:37" {DSK}<king>export>lispcore>library>TEDITDCL.;1)
+      previous date%: "25-Aug-94 10:53:00" 
+{DSK}<Users>kaplan>Local>medley3.5>git-medley>library>TEDITDCL.;1)
 
 
 (* ; "
-Copyright (c) 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1994 by Venue.  All rights reserved.
+Copyright (c) 1986-1991, 1993-1994, 2021 by Venue.
 ")
 
 (PRETTYCOMPRINT TEDITDCLCOMS)
 
-(RPAQQ TEDITDCLCOMS ((* ;;; "This file is the collected record declarations and compile-time necessities for TEDIT.") (* ;; "FROM TEDIT") (DECLARE%: EVAL@COMPILE DONTCOPY (CONSTANTS (\SCRATCHLEN 64))) (* ;; "FROM TEDITSELECTION") (RECORDS SELECTION) (DECLARE%: EVAL@COMPILE DONTCOPY (CONSTANTS (COPYSELSHADE 30583) (COPYLOOKSSELSHADE 30583) (EDITMOVESHADE -1) (EDITGRAY 32800))) (VARS TEDITFILES) (* ;; "FROM TEDITSCREEN") (RECORDS THISLINE LINEDESCRIPTOR LINECACHE) (DECLARE%: EVAL@COMPILE DONTCOPY (CONSTANTS (LMInvisibleRun 401) (LMLooksChange 400))) (* ;; "FROM TEXTOFD") (RECORDS EDITMARK) (RECORDS PIECE TEXTOBJ TEXTIMAGEDATA TEXTSTREAM) (OPTIMIZERS TEXTPROP) (COMS (* ;; "Private data structures and constants FROM TEXTOFD") (DECLARE%: EVAL@COMPILE DONTCOPY (CONSTANTS (\PCTBFreePieces 0) (\PCTBLastPieceOffset 1) (\FirstPieceOffset 2) (\SecondPieceOffset 4) (\EltsPerPiece 2)) (MACROS \EDITELT \GETCH \GETCHB \EDITSETA \WORDSETA) (GLOBALVARS \TEXTIMAGEOPS \TEXTOFD \TEXTFDEV))) (* ;;; "FROM TEDITPAGE") (RECORDS PAGEFORMATTINGSTATE PAGEREGION) (DECLARE%: EVAL@COMPILE DONTCOPY (RECORDS TEDITPAPERSIZE) (FUNCTIONS \NEW-COLUMN-START \FIRST-COLUMN-START)) (* ;; "FROM TEDITFIND") (DECLARE%: EVAL@COMPILE DONTCOPY (CONSTANTS (\AlphaNumericFlag 256) (\AlphaFlag 512) (\OneCharPattern 1024) (\AnyStringPattern 1025) (\OneAlphaPattern 1026) (\AnyAlphaPattern 1027) (\OneNonAlphaPattern 1028) (\AnyNonAlphaPattern 1029) (\LeftBracketPattern 1030) (\RightBracketPattern 1031) (\SpecialPattern 1024))) (* ;; " FROM TEDITLOOKS") (RECORDS CHARLOOKS FMTSPEC PENDINGTAB) (DECLARE%: EVAL@COMPILE DONTCOPY (MACROS \SMALLPIN \SMALLPOUT ONOFF)) (* ;; "FROM TEDITMENU") (DECLARE%: EVAL@COMPILE DONTCOPY (RECORDS MBUTTON)) (INITRECORDS MBUTTON) (DECLARE%: EVAL@COMPILE DONTCOPY (RECORDS NWAYBUTTON)) (INITRECORDS NWAYBUTTON) (DECLARE%: EVAL@COMPILE DONTCOPY (RECORDS MARGINBAR)) (INITRECORDS MARGINBAR) (DECLARE%: EVAL@COMPILE DONTCOPY (RECORDS TAB)) (RECORDS MB.3STATE MB.BUTTON MB.INSERT MB.MARGINBAR MB.NWAY MB.TEXT MB.TOGGLE) (FUNCTIONS WITHOUT-UPDATES) (* ;; "FROM TEDITHISTORY") (RECORDS TEDITHISTORYEVENT) (* ;; "FROM TEDITFILE") (DECLARE%: EVAL@COMPILE DONTCOPY (CONSTANTS (\PieceDescriptorLOOKS 0) (\PieceDescriptorOBJECT 1) (\PieceDescriptorPARA 2) (\PieceDescriptorPAGEFRAME 3) (\PieceDescriptorCHARLOOKSLIST 4) (\PieceDescriptorPARALOOKSLIST 5) (\PieceDescriptorSAFEOBJECT 6))) (* ;; "FROM TEDITCOMMAND") (DECLARE%: EVAL@COMPILE DONTCOPY (MACROS \INSERT\TTY\BUFFER \TEDIT.MOUSESTATE \TEDIT.CHECK)) (DECLARE%: EVAL@COMPILE DONTCOPY (RECORDS TEDITTERMCODE)) (DECLARE%: EVAL@COMPILE DONTCOPY (CONSTANTS (NONE.TTC 0) (CHARDELETE.TTC 1) (WORDDELETE.TTC 2) (DELETE.TTC 3) (FUNCTIONCALL.TTC 4) (REDO.TTC 5) (UNDO.TTC 6) (CMD.TTC 7) (NEXT.TTC 8) (EXPAND.TTC 9) (PUNCT.TTC 20) (TEXT.TTC 21) (WHITESPACE.TTC 22))) (DECLARE%: EVAL@COMPILE DONTCOPY (CONSTANTS (MSPACE 153) (NSPACE 152) (THINSPACE 159) (FIGSPACE 154))) (* ;; "FROM TEDITWINDOW") (DECLARE%: EVAL@COMPILE DONTCOPY (RECORDS TEDITCARET)) (INITRECORDS TEDITCARET) (* ;; "FROM PCTREE added by Nakamura") (RECORDS PCTNODE) (* ;;; "THE END") (COMS (* ;; "Bits in the CHARTABLE that control line breaking, and what happens when a line is broken on this character ") (DECLARE%: EVAL@COMPILE DONTCOPY (CONSTANTS (NOTBEFORE.LB 1) (* ; "Must not break before this character (e.g. Japanese right-paren)") (NOTAFTER.LB 2) (* ; "Must not break after this character (e.g. Japanese open-quote)") (BEFORE.LB 4) (* ; "OK to break before this character, provided it's OK to break after the prior char (true of most non-white-space)") (AFTER.LB 8) (* ; "OK to break after this char, if it's OK to break before the next one (true of most white space)") (DISAPPEAR-IF-NOT-SPLIT.LB 16) (* ; "This character shouldn't be rendered if it isn't the last char on the line (non-breaking hyphen has this)") (NEWCHAR-IF-SPLIT.LB 32) (* ; "Look this char up in *TEDIT-SPLITCHAR-HASH* if this IS the last character on a line, and render it as the char we found.")))))
-)
+(RPAQQ TEDITDCLCOMS
+       [
+
+(* ;;; "This file is the collected record declarations and compile-time necessities for TEDIT.")
+
+        
+        (* ;; "FROM TEDIT")
+
+        (DECLARE%: EVAL@COMPILE DONTCOPY (CONSTANTS (\SCRATCHLEN 64)))
+        
+        (* ;; "FROM TEDITSELECTION")
+
+        (RECORDS SELECTION)
+        (DECLARE%: EVAL@COMPILE DONTCOPY (CONSTANTS (COPYSELSHADE 30583)
+                                                (COPYLOOKSSELSHADE 30583)
+                                                (EDITMOVESHADE -1)
+                                                (EDITGRAY 32800)))
+        (VARS TEDITFILES)
+        
+        (* ;; "FROM TEDITSCREEN")
+
+        (RECORDS THISLINE LINEDESCRIPTOR LINECACHE)
+        (DECLARE%: EVAL@COMPILE DONTCOPY (CONSTANTS (LMInvisibleRun 401)
+                                                (LMLooksChange 400)))
+        
+        (* ;; "FROM TEXTOFD")
+
+        (RECORDS EDITMARK)
+        (RECORDS PIECE TEXTOBJ TEXTIMAGEDATA TEXTSTREAM)
+        (OPTIMIZERS TEXTPROP)
+        (COMS 
+              (* ;; "Private data structures and constants FROM TEXTOFD")
+
+              (DECLARE%: EVAL@COMPILE DONTCOPY (CONSTANTS (\PCTBFreePieces 0)
+                                                      (\PCTBLastPieceOffset 1)
+                                                      (\FirstPieceOffset 2)
+                                                      (\SecondPieceOffset 4)
+                                                      (\EltsPerPiece 2))
+                     (MACROS \EDITELT \GETCH \GETCHB \EDITSETA \WORDSETA)
+                     (GLOBALVARS \TEXTIMAGEOPS \TEXTOFD \TEXTFDEV)))
+        
+
+(* ;;; "FROM TEDITPAGE")
+
+        (RECORDS PAGEFORMATTINGSTATE PAGEREGION)
+        (DECLARE%: EVAL@COMPILE DONTCOPY (RECORDS TEDITPAPERSIZE)
+               (FUNCTIONS \NEW-COLUMN-START \FIRST-COLUMN-START))
+        
+        (* ;; "FROM TEDITFIND")
+
+        (DECLARE%: EVAL@COMPILE DONTCOPY (CONSTANTS (\AlphaNumericFlag 256)
+                                                (\AlphaFlag 512)
+                                                (\OneCharPattern 1024)
+                                                (\AnyStringPattern 1025)
+                                                (\OneAlphaPattern 1026)
+                                                (\AnyAlphaPattern 1027)
+                                                (\OneNonAlphaPattern 1028)
+                                                (\AnyNonAlphaPattern 1029)
+                                                (\LeftBracketPattern 1030)
+                                                (\RightBracketPattern 1031)
+                                                (\SpecialPattern 1024)))
+        
+        (* ;; " FROM TEDITLOOKS")
+
+        (RECORDS CHARLOOKS FMTSPEC PENDINGTAB)
+        (DECLARE%: EVAL@COMPILE DONTCOPY (MACROS \SMALLPIN \SMALLPOUT ONOFF))
+        
+        (* ;; "FROM TEDITMENU")
+
+        (DECLARE%: EVAL@COMPILE DONTCOPY (RECORDS MBUTTON))
+        (INITRECORDS MBUTTON)
+        (DECLARE%: EVAL@COMPILE DONTCOPY (RECORDS NWAYBUTTON))
+        (INITRECORDS NWAYBUTTON)
+        (DECLARE%: EVAL@COMPILE DONTCOPY (RECORDS MARGINBAR))
+        (INITRECORDS MARGINBAR)
+        (DECLARE%: EVAL@COMPILE DONTCOPY (RECORDS TAB))
+        (RECORDS MB.3STATE MB.BUTTON MB.INSERT MB.MARGINBAR MB.NWAY MB.TEXT MB.TOGGLE)
+        (FUNCTIONS WITHOUT-UPDATES)
+        
+        (* ;; "FROM TEDITHISTORY")
+
+        (RECORDS TEDITHISTORYEVENT)
+        
+        (* ;; "FROM TEDITFILE")
+
+        (DECLARE%: EVAL@COMPILE DONTCOPY (CONSTANTS (\PieceDescriptorLOOKS 0)
+                                                (\PieceDescriptorOBJECT 1)
+                                                (\PieceDescriptorPARA 2)
+                                                (\PieceDescriptorPAGEFRAME 3)
+                                                (\PieceDescriptorCHARLOOKSLIST 4)
+                                                (\PieceDescriptorPARALOOKSLIST 5)
+                                                (\PieceDescriptorSAFEOBJECT 6)))
+        
+        (* ;; "FROM TEDITCOMMAND")
+
+        (DECLARE%: EVAL@COMPILE DONTCOPY (MACROS \INSERT\TTY\BUFFER \TEDIT.MOUSESTATE \TEDIT.CHECK))
+        (DECLARE%: EVAL@COMPILE DONTCOPY (RECORDS TEDITTERMCODE))
+        (DECLARE%: EVAL@COMPILE DONTCOPY (CONSTANTS (NONE.TTC 0)
+                                                (CHARDELETE.TTC 1)
+                                                (WORDDELETE.TTC 2)
+                                                (DELETE.TTC 3)
+                                                (FUNCTIONCALL.TTC 4)
+                                                (REDO.TTC 5)
+                                                (UNDO.TTC 6)
+                                                (CMD.TTC 7)
+                                                (NEXT.TTC 8)
+                                                (EXPAND.TTC 9)
+                                                (PUNCT.TTC 20)
+                                                (TEXT.TTC 21)
+                                                (WHITESPACE.TTC 22)))
+        (DECLARE%: EVAL@COMPILE DONTCOPY (CONSTANTS (MSPACE 153)
+                                                (NSPACE 152)
+                                                (THINSPACE 159)
+                                                (FIGSPACE 154)))
+        
+        (* ;; "FROM TEDITWINDOW")
+
+        (DECLARE%: EVAL@COMPILE DONTCOPY (RECORDS TEDITCARET))
+        (INITRECORDS TEDITCARET)
+        
+        (* ;; "FROM PCTREE added by Nakamura")
+
+        (RECORDS PCTNODE)
+        
+
+(* ;;; "THE END")
+
+        (COMS 
+              (* ;; "Bits in the CHARTABLE that control line breaking, and what happens when a line is broken on this character ")
+
+              (DECLARE%: EVAL@COMPILE DONTCOPY (CONSTANTS (NOTBEFORE.LB 1)
+                                                             (* ; 
+                                 "Must not break before this character (e.g. Japanese right-paren)")
+                                                      (NOTAFTER.LB 2)
+                                                             (* ; 
+                                   "Must not break after this character (e.g. Japanese open-quote)")
+                                                      (BEFORE.LB 4)
+                                                             (* ; "OK to break before this character, provided it's OK to break after the prior char (true of most non-white-space)")
+                                                      (AFTER.LB 8)
+                                                             (* ; 
+  "OK to break after this char, if it's OK to break before the next one (true of most white space)")
+                                                      (DISAPPEAR-IF-NOT-SPLIT.LB 16)
+                                                             (* ; "This character shouldn't be rendered if it isn't the last char on the line (non-breaking hyphen has this)")
+                                                      (NEWCHAR-IF-SPLIT.LB 32)
+                                                             (* ; "Look this char up in *TEDIT-SPLITCHAR-HASH* if this IS the last character on a line, and render it as the char we found.")
+                                                      ])
 
 
 
@@ -38,12 +184,80 @@ Copyright (c) 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1994 by Venue.  All righ
 
 (DECLARE%: EVAL@COMPILE
 
-(DATATYPE SELECTION ((* ;; "Description of a piece of selected text for TEdit.  Text has to be selected before it can be operated on by the user.") Y0 (* ; "Y value of topmost line of selection") X0 (* ; "X value of left edge of selection") DX (* ; "Width of the selection, if it's on one line.") CH# (* ; "CH# of the first selected character") XLIM (* ; "X value of right edge of last selected character") CHLIM (* ; "CH# of the last character in the selection") DCH (* ; "# of characters selected (can be zero, for point selection.)") L1 (* ; "-> line descriptor for the line where the first selected character is") LN (* ; "-> line descriptor for the line which contains the end of the selection") YLIM (* ; "Y value of the bottom of the line that ends the selection") POINT (* ; "Which end should the caret appear at?  (LEFT or RIGHT)") (SET FLAG) (* ; "T if this selection is real;  NIL if not") (\TEXTOBJ FULLXPOINTER) (* ; "TEXTOBJ that describes the selected text") SELKIND (* ; "What kind of selection?  CHAR or WORD or LINE or PARA") HOW (* ; "SHADE used to highlight this selection") HOWHEIGHT (* ; "Height of the highlight (1 usually, full line for delete selection...)") (HASCARET FLAG) (* ; "T if there should be a caret for this selection") SELOBJ (* ; "If this selection is inside an object, which object?") (ONFLG FLAG) (* ; "T if the selection is highlighted on the screen, else NIL") SELOBJINFO (* ; "A Place for the selected object to put info about selection inside itself."))
- SET _ NIL HOW _ BLACKSHADE HOWHEIGHT _ 1 HASCARET _ T Y0 _ 0 X0 _ 0 POINT _ (QUOTE LEFT) L1 _ (LIST NIL)
- LN _ (LIST NIL))
+(DATATYPE SELECTION 
+          (
+           (* ;; "Description of a piece of selected text for TEdit.  Text has to be selected before it can be operated on by the user.")
+
+           Y0                                                (* ; 
+                                                           "Y value of topmost line of selection")
+           X0                                                (* ; 
+                                                           "X value of left edge of selection")
+           DX                                                (* ; 
+                                                     "Width of the selection, if it's on one line.")
+           CH#                                               (* ; 
+                                                           "CH# of the first selected character")
+           XLIM                                              (* ; 
+                                                 "X value of right edge of last selected character")
+           CHLIM                                             (* ; 
+                                                       "CH# of the last character in the selection")
+           DCH                                               (* ; 
+                                     "# of characters selected (can be zero, for point selection.)")
+           L1                                                (* ; 
+                            "-> line descriptor for the line where the first selected character is")
+           LN                                                (* ; 
+                          "-> line descriptor for the line which contains the end of the selection")
+           YLIM                                              (* ; 
+                                        "Y value of the bottom of the line that ends the selection")
+           POINT                                             (* ; 
+                                           "Which end should the caret appear at?  (LEFT or RIGHT)")
+           (SET FLAG)                                        (* ; 
+                                                         "T if this selection is real;  NIL if not")
+           (\TEXTOBJ FULLXPOINTER)                           (* ; 
+                                                         "TEXTOBJ that describes the selected text")
+           SELKIND                                           (* ; 
+                                            "What kind of selection?  CHAR or WORD or LINE or PARA")
+           HOW                                               (* ; 
+                                                           "SHADE used to highlight this selection")
+           HOWHEIGHT                                         (* ; 
+                           "Height of the highlight (1 usually, full line for delete selection...)")
+           (HASCARET FLAG)                                   (* ; 
+                                                  "T if there should be a caret for this selection")
+           SELOBJ                                            (* ; 
+                                             "If this selection is inside an object, which object?")
+           (ONFLG FLAG)                                      (* ; 
+                                        "T if the selection is highlighted on the screen, else NIL")
+           SELOBJINFO                                        (* ; 
+                       "A Place for the selected object to put info about selection inside itself.")
+           )
+          SET _ NIL HOW _ BLACKSHADE HOWHEIGHT _ 1 HASCARET _ T Y0 _ 0 X0 _ 0 POINT _ 'LEFT L1 _
+          (LIST NIL)
+          LN _ (LIST NIL))
 )
 
-(/DECLAREDATATYPE (QUOTE SELECTION) (QUOTE (POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER FLAG FULLXPOINTER POINTER POINTER POINTER FLAG POINTER FLAG POINTER)) (QUOTE ((SELECTION 0 POINTER) (SELECTION 2 POINTER) (SELECTION 4 POINTER) (SELECTION 6 POINTER) (SELECTION 8 POINTER) (SELECTION 10 POINTER) (SELECTION 12 POINTER) (SELECTION 14 POINTER) (SELECTION 16 POINTER) (SELECTION 18 POINTER) (SELECTION 20 POINTER) (SELECTION 20 (FLAGBITS . 0)) (SELECTION 22 FULLXPOINTER) (SELECTION 24 POINTER) (SELECTION 26 POINTER) (SELECTION 28 POINTER) (SELECTION 28 (FLAGBITS . 0)) (SELECTION 30 POINTER) (SELECTION 30 (FLAGBITS . 0)) (SELECTION 32 POINTER))) (QUOTE 34))
+(/DECLAREDATATYPE 'SELECTION
+       '(POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER FLAG
+               FULLXPOINTER POINTER POINTER POINTER FLAG POINTER FLAG POINTER)
+       '((SELECTION 0 POINTER)
+         (SELECTION 2 POINTER)
+         (SELECTION 4 POINTER)
+         (SELECTION 6 POINTER)
+         (SELECTION 8 POINTER)
+         (SELECTION 10 POINTER)
+         (SELECTION 12 POINTER)
+         (SELECTION 14 POINTER)
+         (SELECTION 16 POINTER)
+         (SELECTION 18 POINTER)
+         (SELECTION 20 POINTER)
+         (SELECTION 20 (FLAGBITS . 0))
+         (SELECTION 22 FULLXPOINTER)
+         (SELECTION 24 POINTER)
+         (SELECTION 26 POINTER)
+         (SELECTION 28 POINTER)
+         (SELECTION 28 (FLAGBITS . 0))
+         (SELECTION 30 POINTER)
+         (SELECTION 30 (FLAGBITS . 0))
+         (SELECTION 32 POINTER))
+       '34)
 (DECLARE%: EVAL@COMPILE DONTCOPY 
 (DECLARE%: EVAL@COMPILE 
 
@@ -56,12 +270,16 @@ Copyright (c) 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1994 by Venue.  All righ
 (RPAQQ EDITGRAY 32800)
 
 
-(CONSTANTS (COPYSELSHADE 30583) (COPYLOOKSSELSHADE 30583) (EDITMOVESHADE -1) (EDITGRAY 32800))
+(CONSTANTS (COPYSELSHADE 30583)
+       (COPYLOOKSSELSHADE 30583)
+       (EDITMOVESHADE -1)
+       (EDITGRAY 32800))
 )
 )
 
-(RPAQQ TEDITFILES (PCTREE TEXTOFD TEDIT TEDITABBREV TEDITCOMMAND TEDITDCL TEDITFILE TEDITFIND TEDITFNKEYS TEDITHCPY TEDITHISTORY TEDITLOOKS TEDITMENU TEDITPAGE TEDITSCREEN TEDITSELECTION TEDITWINDOW)
-)
+(RPAQQ TEDITFILES (PCTREE TEXTOFD TEDIT TEDITABBREV TEDITCOMMAND TEDITDCL TEDITFILE TEDITFIND 
+                             TEDITFNKEYS TEDITHCPY TEDITHISTORY TEDITLOOKS TEDITMENU TEDITPAGE 
+                             TEDITSCREEN TEDITSELECTION TEDITWINDOW))
 
 
 
@@ -69,23 +287,142 @@ Copyright (c) 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1994 by Venue.  All righ
 
 (DECLARE%: EVAL@COMPILE
 
-(DATATYPE THISLINE ((* ;; "Cache for line-related character location info, for selection and line-display code to use.") (DESC FULLXPOINTER) (* ; "Line descriptor for the line this describes now") LEN (* ; "Length of the line in characters") CHARS (* ;; "Array of character codes (or objects) on the line (charcode of 400 => dummy entry for looks change--go get next entry in LOOKS)") WIDTHS (* ; "Array of each character's width in points") LOOKS (* ; "Array of any looks changes within the line.  LOOKS (0) = starting character looks for the line") TLSPACEFACTOR (* ; "The SPACEFACTOR to be used in printing this line") TLFIRSTSPACE (* ; "The first space to which SPACEFACTOR is to apply.  This is used so that spaces to the left of a TAB have their default width."))
- LEN _ 0 CHARS _ (ARRAY 512 (QUOTE POINTER) 0 0) WIDTHS _ (ARRAY 512 (QUOTE POINTER) 0 0) LOOKS _ (ARRAY 512 (QUOTE POINTER) NIL 0)
- TLFIRSTSPACE _ 0)
+(DATATYPE THISLINE (
+                        (* ;; 
+      "Cache for line-related character location info, for selection and line-display code to use.")
 
-(DATATYPE LINEDESCRIPTOR ((* ;; "Description of a single line of formatted text, either on the display or for a printed page.") YBOT (* ; "Y value for the bottom of the line (below the descent)") YBASE (* ; "Yvalue for the base line the characters sit on") LEFTMARGIN (* ; "Left margin, in screen points") RIGHTMARGIN (* ; "Right margin, in screen points") LXLIM (* ; "X value of right edge of rightmost character on the line (may exceed right margin, if char is a space.)") SPACELEFT (* ; "Space left on the line, ignoring trailing blanks & CRs.") LHEIGHT (* ; "Total height of hte line, Ascent+Descent.") ASCENT (* ; "Ascent of the line above YBASE") DESCENT (* ; "How far line descends below YBASE") LTRUEDESCENT (* ; "The TRUE DESCENT for this line, unadjusted for line leading.") LTRUEASCENT (* ; "The TRUE ASCENT for this line, unadjusted for pre-paragraph leading.") CHAR1 (* ; "CH# of the first character on the line.") CHARLIM (* ; "CH# of the last character on the line") CHARTOP (* ; "CH# of the character which forced the line break (may exceed CHARLIM)") NEXTLINE (* ; "Next line chain pointer") (PREVLINE FULLXPOINTER) (* ; "Previous line chain pointer") LMARK (* ; "One of SOLID, GREY, NIL.  Tells what kind of special-line marker should be put in the left margin for this paragraph.  (For hardcopy, can also be an indicator for special processing?)") LTEXTOBJ (* ; "A cached TEXTOBJ that this line took its text from.  Used in hardcopy to disambiguate when chno's should be updated...") CACHE (* ; "A cached THISLINE, for keeping hardcopy info around while we crunch with the line descriptors to make things fit.") LDOBJ (* ; "The object which lies behind this line of text, for updating, etc.") LFMTSPEC (* ; "The format spec for this line's paragraph (eventually)") (DIRTY FLAG) (* ; "T if this line has changed since it was last formatted.") (CR\END FLAG) (* ; "T if this line ends with a CR.") (DELETED FLAG) (* ; "T if this line has been completely deleted since it was last formatted or displayed.  (Used by deletion routines to detect garbage lines)") (LHASPROT FLAG) (* ; "This line contains protected text.") (LHASTABS FLAG) (* ; "If this line has a tab in it, this is the line-relative ch# of the final tab.  This is to let us punt properly with tabs in a line.") (1STLN FLAG) (* ; "This line is the first line in a paragraph") (LSTLN FLAG) (* ; "This is the last line in a paragraph"))
- CHARLIM _ 1000000 NEXTLINE _ NIL PREVLINE _ NIL DIRTY _ NIL YBOT _ 0 YBASE _ 0 LEFTMARGIN _ 0 DELETED
- _ NIL)
+                        (DESC FULLXPOINTER)                  (* ; 
+                                                  "Line descriptor for the line this describes now")
+                        LEN                                  (* ; 
+                                                           "Length of the line in characters")
+                        CHARS
 
-(DATATYPE LINECACHE ((* ;; "Image cache for display lines.") LCBITMAP (* ; "The bitmap that will be used by this instance of the cache") (LCNEXTCACHE FULLXPOINTER) (* ; "The next cache in the chain, for screen updates."))
-)
+                        (* ;; "Array of character codes (or objects) on the line (charcode of 400 => dummy entry for looks change--go get next entry in LOOKS)")
+
+                        WIDTHS                               (* ; 
+                                                        "Array of each character's width in points")
+                        LOOKS                                (* ; 
+   "Array of any looks changes within the line.  LOOKS (0) = starting character looks for the line")
+                        TLSPACEFACTOR                        (* ; 
+                                                 "The SPACEFACTOR to be used in printing this line")
+                        TLFIRSTSPACE                         (* ; "The first space to which SPACEFACTOR is to apply.  This is used so that spaces to the left of a TAB have their default width.")
+                        )
+                       LEN _ 0 CHARS _ (ARRAY 512 'POINTER 0 0)
+                       WIDTHS _ (ARRAY 512 'POINTER 0 0)
+                       LOOKS _ (ARRAY 512 'POINTER NIL 0)
+                       TLFIRSTSPACE _ 0)
+
+(DATATYPE LINEDESCRIPTOR 
+          (
+           (* ;; 
+     "Description of a single line of formatted text, either on the display or for a printed page.")
+
+           YBOT                                              (* ; 
+                                           "Y value for the bottom of the line (below the descent)")
+           YBASE                                             (* ; 
+                                                   "Yvalue for the base line the characters sit on")
+           LEFTMARGIN                                        (* ; "Left margin, in screen points")
+           RIGHTMARGIN                                       (* ; "Right margin, in screen points")
+           LXLIM                                             (* ; "X value of right edge of rightmost character on the line (may exceed right margin, if char is a space.)")
+           SPACELEFT                                         (* ; 
+                                          "Space left on the line, ignoring trailing blanks & CRs.")
+           LHEIGHT                                           (* ; 
+                                                        "Total height of hte line, Ascent+Descent.")
+           ASCENT                                            (* ; "Ascent of the line above YBASE")
+           DESCENT                                           (* ; 
+                                                           "How far line descends below YBASE")
+           LTRUEDESCENT                                      (* ; 
+                                     "The TRUE DESCENT for this line, unadjusted for line leading.")
+           LTRUEASCENT                                       (* ; 
+                             "The TRUE ASCENT for this line, unadjusted for pre-paragraph leading.")
+           CHAR1                                             (* ; 
+                                                          "CH# of the first character on the line.")
+           CHARLIM                                           (* ; 
+                                                           "CH# of the last character on the line")
+           CHARTOP                                           (* ; 
+                            "CH# of the character which forced the line break (may exceed CHARLIM)")
+           NEXTLINE                                          (* ; "Next line chain pointer")
+           (PREVLINE FULLXPOINTER)                           (* ; "Previous line chain pointer")
+           LMARK                                             (* ; "One of SOLID, GREY, NIL.  Tells what kind of special-line marker should be put in the left margin for this paragraph.  (For hardcopy, can also be an indicator for special processing?)")
+           LTEXTOBJ                                          (* ; "A cached TEXTOBJ that this line took its text from.  Used in hardcopy to disambiguate when chno's should be updated...")
+           CACHE                                             (* ; "A cached THISLINE, for keeping hardcopy info around while we crunch with the line descriptors to make things fit.")
+           LDOBJ                                             (* ; 
+                               "The object which lies behind this line of text, for updating, etc.")
+           LFMTSPEC                                          (* ; 
+                                           "The format spec for this line's paragraph (eventually)")
+           (DIRTY FLAG)                                      (* ; 
+                                          "T if this line has changed since it was last formatted.")
+           (CR\END FLAG)                                     (* ; "T if this line ends with a CR.")
+           (DELETED FLAG)                                    (* ; "T if this line has been completely deleted since it was last formatted or displayed.  (Used by deletion routines to detect garbage lines)")
+           (LHASPROT FLAG)                                   (* ; 
+                                                           "This line contains protected text.")
+           (LHASTABS FLAG)                                   (* ; "If this line has a tab in it, this is the line-relative ch# of the final tab.  This is to let us punt properly with tabs in a line.")
+           (1STLN FLAG)                                      (* ; 
+                                                       "This line is the first line in a paragraph")
+           (LSTLN FLAG)                                      (* ; 
+                                                           "This is the last line in a paragraph")
+           )
+          CHARLIM _ 1000000 NEXTLINE _ NIL PREVLINE _ NIL DIRTY _ NIL YBOT _ 0 YBASE _ 0 LEFTMARGIN _
+          0 DELETED _ NIL)
+
+(DATATYPE LINECACHE (
+                         (* ;; "Image cache for display lines.")
+
+                         LCBITMAP                            (* ; 
+                                       "The bitmap that will be used by this instance of the cache")
+                         (LCNEXTCACHE FULLXPOINTER)          (* ; 
+                                                 "The next cache in the chain, for screen updates.")
+                         ))
 )
 
-(/DECLAREDATATYPE (QUOTE THISLINE) (QUOTE (FULLXPOINTER POINTER POINTER POINTER POINTER POINTER POINTER)) (QUOTE ((THISLINE 0 FULLXPOINTER) (THISLINE 2 POINTER) (THISLINE 4 POINTER) (THISLINE 6 POINTER) (THISLINE 8 POINTER) (THISLINE 10 POINTER) (THISLINE 12 POINTER))) (QUOTE 14))
+(/DECLAREDATATYPE 'THISLINE '(FULLXPOINTER POINTER POINTER POINTER POINTER POINTER POINTER)
+       '((THISLINE 0 FULLXPOINTER)
+         (THISLINE 2 POINTER)
+         (THISLINE 4 POINTER)
+         (THISLINE 6 POINTER)
+         (THISLINE 8 POINTER)
+         (THISLINE 10 POINTER)
+         (THISLINE 12 POINTER))
+       '14)
 
-(/DECLAREDATATYPE (QUOTE LINEDESCRIPTOR) (QUOTE (POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER FULLXPOINTER POINTER POINTER POINTER POINTER POINTER FLAG FLAG FLAG FLAG FLAG FLAG FLAG)) (QUOTE ((LINEDESCRIPTOR 0 POINTER) (LINEDESCRIPTOR 2 POINTER) (LINEDESCRIPTOR 4 POINTER) (LINEDESCRIPTOR 6 POINTER) (LINEDESCRIPTOR 8 POINTER) (LINEDESCRIPTOR 10 POINTER) (LINEDESCRIPTOR 12 POINTER) (LINEDESCRIPTOR 14 POINTER) (LINEDESCRIPTOR 16 POINTER) (LINEDESCRIPTOR 18 POINTER) (LINEDESCRIPTOR 20 POINTER) (LINEDESCRIPTOR 22 POINTER) (LINEDESCRIPTOR 24 POINTER) (LINEDESCRIPTOR 26 POINTER) (LINEDESCRIPTOR 28 POINTER) (LINEDESCRIPTOR 30 FULLXPOINTER) (LINEDESCRIPTOR 32 POINTER) (LINEDESCRIPTOR 34 POINTER) (LINEDESCRIPTOR 36 POINTER) (LINEDESCRIPTOR 38 POINTER) (LINEDESCRIPTOR 40 POINTER) (LINEDESCRIPTOR 40 (FLAGBITS . 0)) (LINEDESCRIPTOR 40 (FLAGBITS . 16)) (LINEDESCRIPTOR 40 (FLAGBITS . 32)) (LINEDESCRIPTOR 40 (FLAGBITS . 48)) (LINEDESCRIPTOR 38 (FLAGBITS . 0)) (LINEDESCRIPTOR 38 (FLAGBITS . 16)) (LINEDESCRIPTOR 38 (FLAGBITS . 32)))) (QUOTE 42))
+(/DECLAREDATATYPE 'LINEDESCRIPTOR
+       '(POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER 
+               POINTER POINTER POINTER POINTER FULLXPOINTER POINTER POINTER POINTER POINTER POINTER 
+               FLAG FLAG FLAG FLAG FLAG FLAG FLAG)
+       '((LINEDESCRIPTOR 0 POINTER)
+         (LINEDESCRIPTOR 2 POINTER)
+         (LINEDESCRIPTOR 4 POINTER)
+         (LINEDESCRIPTOR 6 POINTER)
+         (LINEDESCRIPTOR 8 POINTER)
+         (LINEDESCRIPTOR 10 POINTER)
+         (LINEDESCRIPTOR 12 POINTER)
+         (LINEDESCRIPTOR 14 POINTER)
+         (LINEDESCRIPTOR 16 POINTER)
+         (LINEDESCRIPTOR 18 POINTER)
+         (LINEDESCRIPTOR 20 POINTER)
+         (LINEDESCRIPTOR 22 POINTER)
+         (LINEDESCRIPTOR 24 POINTER)
+         (LINEDESCRIPTOR 26 POINTER)
+         (LINEDESCRIPTOR 28 POINTER)
+         (LINEDESCRIPTOR 30 FULLXPOINTER)
+         (LINEDESCRIPTOR 32 POINTER)
+         (LINEDESCRIPTOR 34 POINTER)
+         (LINEDESCRIPTOR 36 POINTER)
+         (LINEDESCRIPTOR 38 POINTER)
+         (LINEDESCRIPTOR 40 POINTER)
+         (LINEDESCRIPTOR 40 (FLAGBITS . 0))
+         (LINEDESCRIPTOR 40 (FLAGBITS . 16))
+         (LINEDESCRIPTOR 40 (FLAGBITS . 32))
+         (LINEDESCRIPTOR 40 (FLAGBITS . 48))
+         (LINEDESCRIPTOR 38 (FLAGBITS . 0))
+         (LINEDESCRIPTOR 38 (FLAGBITS . 16))
+         (LINEDESCRIPTOR 38 (FLAGBITS . 32)))
+       '42)
 
-(/DECLAREDATATYPE (QUOTE LINECACHE) (QUOTE (POINTER FULLXPOINTER)) (QUOTE ((LINECACHE 0 POINTER) (LINECACHE 2 FULLXPOINTER))) (QUOTE 4))
+(/DECLAREDATATYPE 'LINECACHE '(POINTER FULLXPOINTER)
+       '((LINECACHE 0 POINTER)
+         (LINECACHE 2 FULLXPOINTER))
+       '4)
 (DECLARE%: EVAL@COMPILE DONTCOPY 
 (DECLARE%: EVAL@COMPILE 
 
@@ -94,7 +431,8 @@ Copyright (c) 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1994 by Venue.  All righ
 (RPAQQ LMLooksChange 400)
 
 
-(CONSTANTS (LMInvisibleRun 401) (LMLooksChange 400))
+(CONSTANTS (LMInvisibleRun 401)
+       (LMLooksChange 400))
 )
 )
 
@@ -104,37 +442,388 @@ Copyright (c) 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1994 by Venue.  All righ
 
 (DECLARE%: EVAL@COMPILE
 
-(RECORD EDITMARK ((* ;; "Used for fast access to a given place in the text--a %"Marker%".   It consists of the piece, and the offset within the piece, and the piece number within the piece table.  That's everything that's needed to set a text stream up quickly to start reading from a given place.") PC PCOFF . PCNO)
-)
+(RECORD EDITMARK (
+                      (* ;; "Used for fast access to a given place in the text--a %"Marker%".   It consists of the piece, and the offset within the piece, and the piece number within the piece table.  That's everything that's needed to set a text stream up quickly to start reading from a given place.")
+
+                      PC PCOFF . PCNO))
 )
 (DECLARE%: EVAL@COMPILE
 
-(DATATYPE PIECE ((* ; "The piece describes either a string or part of a file.  , or a generalized OBJECT.") PSTR (* ; "The string where this piece's text resides, or NIL") PFILE (* ; "The file which contains this piece's text, or NIL") PFPOS (* ; "The FILEPTR of the start of the piece in the file") PLEN (* ; "Length of the piece, in characters.") NEXTPIECE (* ; "-> Next piece in this textobj.") (PREVPIECE FULLXPOINTER) (* ; "-> Prior piece in this text object.") PLOOKS (* ; "Formatting info and formatting events in this piece") POBJ (* ; "The OBJECT this piece describes") (PPARALAST FLAG) (* ; "This piece contains a paragraph break") PPARALOOKS (* ; "Paragraph looks for this piece") (PNEW FLAG) (* ; "This text is new here;  used by the tentative edit system, and anyone else interested.") (PFATP FLAG) (* ; "T if the characters in this piece are FAT -- i.e., are 16 bits each.") (PTREENODE XPOINTER) (* ; "Points to the PCTB tree-node that contains this piece."))
- PSTR _ NIL PFILE _ NIL PFPOS _ 0 PLEN _ 0 PPARALOOKS _ TEDIT.DEFAULT.FMTSPEC PTREENODE _ NIL)
+(DATATYPE PIECE 
+          (                                                  (* ; 
+               "The piece describes either a string or part of a file.  , or a generalized OBJECT.")
+           PSTR                                              (* ; 
+                                               "The string where this piece's text resides, or NIL")
+           PFILE                                             (* ; 
+                                                "The file which contains this piece's text, or NIL")
+           PFPOS                                             (* ; 
+                                                "The FILEPTR of the start of the piece in the file")
+           PLEN                                              (* ; 
+                                                           "Length of the piece, in characters.")
+           NEXTPIECE                                         (* ; "-> Next piece in this textobj.")
+           (PREVPIECE FULLXPOINTER)                          (* ; 
+                                                           "-> Prior piece in this text object.")
+           PLOOKS                                            (* ; 
+                                              "Formatting info and formatting events in this piece")
+           POBJ                                              (* ; "The OBJECT this piece describes")
+           (PPARALAST FLAG)                                  (* ; 
+                                                           "This piece contains a paragraph break")
+           PPARALOOKS                                        (* ; "Paragraph looks for this piece")
+           (PNEW FLAG)                                       (* ; 
+           "This text is new here;  used by the tentative edit system, and anyone else interested.")
+           (PFATP FLAG)                                      (* ; 
+                             "T if the characters in this piece are FAT -- i.e., are 16 bits each.")
+           (PTREENODE XPOINTER)                              (* ; 
+                                           "Points to the PCTB tree-node that contains this piece.")
+           )
+          PSTR _ NIL PFILE _ NIL PFPOS _ 0 PLEN _ 0 PPARALOOKS _ TEDIT.DEFAULT.FMTSPEC PTREENODE _ 
+          NIL)
 
-(DATATYPE TEXTOBJ ((* ;; "This is where TEdit stores its state information, and internal data about the text being edited.") PCTB (* ; "The piece table") TEXTLEN (* ; "# of chars in the text") \INSERTPC (* ; "Piece to hold type-in") \INSERTPCNO (* ; "Piece # of the input piece") \INSERTNEXTCH (* ; "CH# of next char which is typed into that piece.") \INSERTLEFT (* ; "Space left in the type-in piece") \INSERTLEN (* ; "# of characters already in the piece.") \INSERTSTRING (* ; "The string which the piece describes.") \INSERTFIRSTCH (* ; "CH# of first char in the piece.") (\INSERTPCVALID FLAG) (* ; "T if it's OK to use the cached piece.  Set to NIL by people who require that the next insertion/deletion use a different piece.") \WINDOW (* ; "The window<s> where this textobj is displayed") MOUSEREGION (* ; "Section of the window the mouse is in.") LINES (* ; "-> to top of chain of line descriptors for displayed text") DS (* ; "Display stream where this textobj is displayed") SEL (* ; "The current selection within the text") SCRATCHSEL (* ; "Scratch space for the selection code") MOVESEL (* ; "Source for the next MOVE of text") SHIFTEDSEL (* ; "Source for the next COPY") DELETESEL (* ; "Text to be deleted imminently") WRIGHT (* ; "Right edge of the window (or subregion) where this is displayed") WTOP (* ; "Top of the window/region") WBOTTOM (* ; "Bottom of the window/region") WLEFT (* ; "Left edge of the window/region") TXTFILE (* ; "The original text file we're editing") (\XDIRTY FLAG) (* ; "T => changed since last saved.") (STREAMHINT FULLXPOINTER) (* ; "-> the TEXTOFD stream which gives access to this textobj") EDITFINISHEDFLG (* ; "T => The guy has asked the editor to go way") CARET (* ; "Describes the flashing caret for the editing window") CARETLOOKS (* ; "Font to be used for inserted text.") WINDOWTITLE (* ; "Original title for this window, of there was one.") THISLINE (* ; "Cache of line-related info, to speed up selection &c") (MENUFLG FLAG) (* ; "T if this TEXTOBJ is a tedit-style menu") FMTSPEC (* ; "Default Formatting Spec to be used when formatting paragraphs") (FORMATTEDP FLAG) (* ; "Flag for paragraph formatting.  T if this document is to contain paragraph formatting information.") (TXTREADONLY FLAG) (* ; "This is only available for shift selection.") (TXTEDITING FLAG) (* ; "T => This document is in a window and there is an edit process behind it.  For example, it only makes sense to have a caret show up if you are editing.") (TXTNONSCHARS FLAG) (* ; "T => If TEdit rns into a 255, it won't attempt to convert to NS characters.  Used for REALLY plain-text manipulation.") TXTTERMSA (* ; "Special instructions for displaying characters on the screen") EDITOPACTIVE (* ; "T if there is an editing operation in progress.  Used to interlock the TEdit menu") DEFAULTCHARLOOKS (* ; "The default character looks -- if any -- to be applied to characters coming into the file from outside.") TXTRTBL (* ; "The READTABLE to be used by the command loop for command dispatch") TXTWTBL (* ; "The READTABLE to be used to decide on word breaks") EDITPROPS (* ; "The PROPS that were passed into this edit session") (BLUEPENDINGDELETE FLAG) (* ; "T if the next insertion in this document is to be preceded by a deletion of the then-current selection") TXTHISTORY (* ; "The history list for this edit session.") (SELWINDOW FULLXPOINTER) (* ; "The window in which the last 'real' selection got made for this edit;  used to control caret placement") PROMPTWINDOW (* ; "A window to be used for unscheduled interactions;  normally a small window above the edit window") DISPLAYCACHE (* ; "The bitmap to be used when building the image of a line for display") DISPLAYCACHEDS (* ; "The DISPLAYSTREAM that is used to build line images") DISPLAYHCPYDS (* ; "The DISPLAYSTREAM used to build line images of lines that are displayed in 'hardcopy' simulation mode") TXTPAGEFRAMES (* ; "A tree of page frames, specifying how the document is to be laid out.") TXTCHARLOOKSLIST (* ; "List of all the CHARLOOKSs in the document, so they can be kept unique") TXTPARALOOKSLIST (* ; "List of all the FMTSPECs in the document, so they can be kept unique") (TXTNEEDSUPDATE FLAG) (* ; "T => Screen invalid, need to run updater") (TXTDON'TUPDATE FLAG) (* ; "T if we're holding off on screen updates until later.  Used, e.g., by the menu-SHOW code so that you don't get piecemeal updates, but only one at the end of the SHOW.") TXTRAWINCLUDESTREAM (* ; "NODIRCORE stream used to cache RAW includes (and maybe later, all includes?)") DOCPROPS (* ; "Document properties that are stored with the document (not used yet)") TXTSTYLESHEET (* ; "Style sheet local to this document.  Not currently saved as part of the file."))
- (ACCESSFNS TEXTOBJ ((\DIRTY (ffetch (TEXTOBJ \XDIRTY) of DATUM) (PROGN (IF (NEQ (FETCH (TEXTOBJ \XDIRTY) OF DATUM) NEWVALUE) THEN (* ; "update the title to reflect the change") (\TEDIT.WINDOW.TITLE DATUM (\TEDIT.ORIGINAL.WINDOW.TITLE (ffetch (TEXTOBJ TXTFILE) of DATUM) NEWVALUE))) (freplace \XDIRTY OF DATUM WITH NEWVALUE)))))
- SEL _ (create SELECTION) SCRATCHSEL _ (create SELECTION) MOVESEL _ (create SELECTION HOWHEIGHT _ 32767 HASCARET _ NIL)
- SHIFTEDSEL _ (create SELECTION HASCARET _ NIL) DELETESEL _ (create SELECTION HOWHEIGHT _ 32767 HASCARET _ NIL)
- \INSERTNEXTCH _ -1 \INSERTPC _ NIL \INSERTLEFT _ 0 \INSERTLEN _ 0 \INSERTSTRING _ NIL \INSERTFIRSTCH _
- 1000000 TEXTLEN _ 0 WRIGHT _ 0 WTOP _ 0 WLEFT _ 0 WBOTTOM _ 0 TXTFILE _ NIL \XDIRTY _ NIL MOUSEREGION
- _ (QUOTE TEXT) THISLINE _ (create THISLINE) MENUFLG _ NIL FMTSPEC _ TEDIT.DEFAULT.FMTSPEC FORMATTEDP _
- NIL)
+(DATATYPE TEXTOBJ 
+          (
+           (* ;; 
+ "This is where TEdit stores its state information, and internal data about the text being edited.")
 
-(DATATYPE TEXTIMAGEDATA ((* ;; "Fills the IMAGEDATA field of text streams.") TICURPARALOOKS (* ; "The current paragraph looks") TICURIMAGESTREAM (* ; "The image stream for this hardcopy transduction") TILOOKSUPDATEFN (* ; "The function to call to update looks for this stream") TIPCOFFSET (* ; "The offset into the current piece, as of the last page cross."))
+           PCTB                                              (* ; "The piece table")
+           TEXTLEN                                           (* ; "# of chars in the text")
+           \INSERTPC                                         (* ; "Piece to hold type-in")
+           \INSERTPCNO                                       (* ; "Piece # of the input piece")
+           \INSERTNEXTCH                                     (* ; 
+                                                 "CH# of next char which is typed into that piece.")
+           \INSERTLEFT                                       (* ; "Space left in the type-in piece")
+           \INSERTLEN                                        (* ; 
+                                                           "# of characters already in the piece.")
+           \INSERTSTRING                                     (* ; 
+                                                           "The string which the piece describes.")
+           \INSERTFIRSTCH                                    (* ; "CH# of first char in the piece.")
+           (\INSERTPCVALID FLAG)                             (* ; "T if it's OK to use the cached piece.  Set to NIL by people who require that the next insertion/deletion use a different piece.")
+           \WINDOW                                           (* ; 
+                                                    "The window<s> where this textobj is displayed")
+           MOUSEREGION                                       (* ; 
+                                                           "Section of the window the mouse is in.")
+           LINES                                             (* ; 
+                                        "-> to top of chain of line descriptors for displayed text")
+           DS                                                (* ; 
+                                                   "Display stream where this textobj is displayed")
+           SEL                                               (* ; 
+                                                           "The current selection within the text")
+           SCRATCHSEL                                        (* ; 
+                                                           "Scratch space for the selection code")
+           MOVESEL                                           (* ; 
+                                                           "Source for the next MOVE of text")
+           SHIFTEDSEL                                        (* ; "Source for the next COPY")
+           DELETESEL                                         (* ; "Text to be deleted imminently")
+           WRIGHT                                            (* ; 
+                                  "Right edge of the window (or subregion) where this is displayed")
+           WTOP                                              (* ; "Top of the window/region")
+           WBOTTOM                                           (* ; "Bottom of the window/region")
+           WLEFT                                             (* ; "Left edge of the window/region")
+           TXTFILE                                           (* ; 
+                                                           "The original text file we're editing")
+           (\XDIRTY FLAG)                                    (* ; "T => changed since last saved.")
+           (STREAMHINT FULLXPOINTER)                         (* ; 
+                                         "-> the TEXTOFD stream which gives access to this textobj")
+           EDITFINISHEDFLG                                   (* ; 
+                                                      "T => The guy has asked the editor to go way")
+           CARET                                             (* ; 
+                                              "Describes the flashing caret for the editing window")
+           CARETLOOKS                                        (* ; 
+                                                           "Font to be used for inserted text.")
+           WINDOWTITLE                                       (* ; 
+                                                "Original title for this window, of there was one.")
+           THISLINE                                          (* ; 
+                                             "Cache of line-related info, to speed up selection &c")
+           (MENUFLG FLAG)                                    (* ; 
+                                                          "T if this TEXTOBJ is a tedit-style menu")
+           FMTSPEC                                           (* ; 
+                                    "Default Formatting Spec to be used when formatting paragraphs")
+           (FORMATTEDP FLAG)                                 (* ; 
+"Flag for paragraph formatting.  T if this document is to contain paragraph formatting information.")
+           (TXTREADONLY FLAG)                                (* ; 
+                                                      "This is only available for shift selection.")
+           (TXTEDITING FLAG)                                 (* ; "T => This document is in a window and there is an edit process behind it.  For example, it only makes sense to have a caret show up if you are editing.")
+           (TXTNONSCHARS FLAG)                               (* ; "T => If TEdit rns into a 255, it won't attempt to convert to NS characters.  Used for REALLY plain-text manipulation.")
+           TXTTERMSA                                         (* ; 
+                                     "Special instructions for displaying characters on the screen")
+           EDITOPACTIVE                                      (* ; 
+                "T if there is an editing operation in progress.  Used to interlock the TEdit menu")
+           DEFAULTCHARLOOKS                                  (* ; "The default character looks -- if any -- to be applied to characters coming into the file from outside.")
+           TXTRTBL                                           (* ; 
+                                "The READTABLE to be used by the command loop for command dispatch")
+           TXTWTBL                                           (* ; 
+                                                "The READTABLE to be used to decide on word breaks")
+           EDITPROPS                                         (* ; 
+                                                "The PROPS that were passed into this edit session")
+           (BLUEPENDINGDELETE FLAG)                          (* ; "T if the next insertion in this document is to be preceded by a deletion of the then-current selection")
+           TXTHISTORY                                        (* ; 
+                                                          "The history list for this edit session.")
+           (SELWINDOW FULLXPOINTER)                          (* ; "The window in which the last 'real' selection got made for this edit;  used to control caret placement")
+           PROMPTWINDOW                                      (* ; 
+ "A window to be used for unscheduled interactions;  normally a small window above the edit window")
+           DISPLAYCACHE                                      (* ; 
+                              "The bitmap to be used when building the image of a line for display")
+           DISPLAYCACHEDS                                    (* ; 
+                                              "The DISPLAYSTREAM that is used to build line images")
+           DISPLAYHCPYDS                                     (* ; "The DISPLAYSTREAM used to build line images of lines that are displayed in 'hardcopy' simulation mode")
+           TXTPAGEFRAMES                                     (* ; 
+                            "A tree of page frames, specifying how the document is to be laid out.")
+           TXTCHARLOOKSLIST                                  (* ; 
+                           "List of all the CHARLOOKSs in the document, so they can be kept unique")
+           TXTPARALOOKSLIST                                  (* ; 
+                             "List of all the FMTSPECs in the document, so they can be kept unique")
+           (TXTNEEDSUPDATE FLAG)                             (* ; 
+                                                         "T => Screen invalid, need to run updater")
+           (TXTDON'TUPDATE FLAG)                             (* ; "T if we're holding off on screen updates until later.  Used, e.g., by the menu-SHOW code so that you don't get piecemeal updates, but only one at the end of the SHOW.")
+           TXTRAWINCLUDESTREAM                               (* ; 
+                     "NODIRCORE stream used to cache RAW includes (and maybe later, all includes?)")
+           DOCPROPS                                          (* ; 
+                             "Document properties that are stored with the document (not used yet)")
+           TXTSTYLESHEET                                     (* ; 
+                    "Style sheet local to this document.  Not currently saved as part of the file.")
+           )
+          [ACCESSFNS TEXTOBJ ((\DIRTY (ffetch (TEXTOBJ \XDIRTY) of DATUM)
+                                     (PROGN (IF (NEQ (FETCH (TEXTOBJ \XDIRTY) OF DATUM)
+                                                         NEWVALUE)
+                                                THEN     (* ; 
+                                                           "update the title to reflect the change")
+                                                      (\TEDIT.WINDOW.TITLE DATUM
+                                                             (\TEDIT.ORIGINAL.WINDOW.TITLE
+                                                              (ffetch (TEXTOBJ TXTFILE)
+                                                                 of DATUM)
+                                                              NEWVALUE)))
+                                            (freplace \XDIRTY OF DATUM WITH NEWVALUE]
+          SEL _ (create SELECTION)
+          SCRATCHSEL _ (create SELECTION)
+          MOVESEL _ (create SELECTION
+                           HOWHEIGHT _ 32767
+                           HASCARET _ NIL)
+          SHIFTEDSEL _ (create SELECTION
+                              HASCARET _ NIL)
+          DELETESEL _ (create SELECTION
+                             HOWHEIGHT _ 32767
+                             HASCARET _ NIL)
+          \INSERTNEXTCH _ -1 \INSERTPC _ NIL \INSERTLEFT _ 0 \INSERTLEN _ 0 \INSERTSTRING _ NIL 
+          \INSERTFIRSTCH _ 1000000 TEXTLEN _ 0 WRIGHT _ 0 WTOP _ 0 WLEFT _ 0 WBOTTOM _ 0 TXTFILE _ 
+          NIL \XDIRTY _ NIL MOUSEREGION _ 'TEXT THISLINE _ (create THISLINE)
+          MENUFLG _ NIL FMTSPEC _ TEDIT.DEFAULT.FMTSPEC FORMATTEDP _ NIL)
+
+(DATATYPE TEXTIMAGEDATA (
+                             (* ;; "Fills the IMAGEDATA field of text streams.")
+
+                             TICURPARALOOKS                  (* ; "The current paragraph looks")
+                             TICURIMAGESTREAM                (* ; 
+                                                  "The image stream for this hardcopy transduction")
+                             TILOOKSUPDATEFN                 (* ; 
+                                             "The function to call to update looks for this stream")
+                             TIPCOFFSET                      (* ; 
+                                    "The offset into the current piece, as of the last page cross.")
+                             ))
+
+(ACCESSFNS TEXTSTREAM (
+                           (* ;; 
+        "Overlay for the STREAM record to allow mnemonic access to stream fields for Text streams.")
+
+                           (REALFILE (fetch F1 of DATUM)
+                                  (REPLACE F1 OF DATUM WITH NEWVALUE))
+                                                             (* ; 
+                                               "The real, underlying file behind the current piece")
+                           (CHARSLEFT (fetch F2 of DATUM)
+                                  (REPLACE F2 OF DATUM WITH NEWVALUE))
+
+                           (* ;; "The # of characters that will be left in the current piece the next time its file crosses a page boundary")
+
+                           (TEXTOBJ (fetch F3 of DATUM)
+                                  (REPLACE F3 OF DATUM WITH NEWVALUE))
+                                                             (* ; 
+                                                           "The TEXTOBJ that is editing this text")
+                           (PIECE (fetch F5 of DATUM)
+                                  (REPLACE F5 OF DATUM WITH NEWVALUE))
+                                                             (* ; 
+                                 "The PIECE we're currently fetching chars from/putting chars into")
+                           (PCNO (fetch FW8 of DATUM)
+                                 (REPLACE FW8 OF DATUM WITH NEWVALUE))
+                                                             (* ; 
+                                                    "The position of that piece in the piece table")
+                           (PCSTARTPG (fetch FW6 of DATUM)
+                                  (REPLACE FW6 OF DATUM WITH NEWVALUE))
+                                                             (* ; 
+                                              "The underlying file page# that this piece starts on")
+                           (PCSTARTCH (fetch FW7 of DATUM)
+                                  (REPLACE FW7 OF DATUM WITH NEWVALUE))
+                                                             (* ; 
+        "The char within page of the underlying file that this piece starts on -- for backbin & co")
+                           (PCOFFSET (fetch TIPCOFFSET of (fetch IMAGEDATA of DATUM))
+                                  (REPLACE TIPCOFFSET OF (fetch IMAGEDATA of DATUM)
+                                     with NEWVALUE))     (* ; 
+                                    "The offset into the current piece, as of the last page cross.")
+                           (CURRENTLOOKS (fetch F10 of DATUM)
+                                  (replace F10 of DATUM with NEWVALUE))
+                                                             (* ; 
+           "The CHARLOOKS that are currently applicable to characters being taken from the stream.")
+                           (CURRENTPARALOOKS (fetch TICURPARALOOKS of (fetch IMAGEDATA
+                                                                                 of DATUM))
+                                  (REPLACE TICURPARALOOKS OF (fetch IMAGEDATA
+                                                                        of DATUM) with 
+                                                                                            NEWVALUE)
+                                  )                          (* ; 
+              "The FMTSPEC that is currently applicable to characters being taken from the stream.")
+                           (CURRENTIMAGESTREAM (fetch TICURIMAGESTREAM
+                                                  of (fetch IMAGEDATA of DATUM))
+                                  (REPLACE TICURIMAGESTREAM OF (fetch IMAGEDATA
+                                                                          of DATUM) with
+                                                                                        NEWVALUE)
+                                                             (* ; 
+                   "The image stream that this text is being put onto;  used for scaling decisions")
+                                  )
+                           (LOOKSUPDATEFN (fetch TILOOKSUPDATEFN of (fetch IMAGEDATA
+                                                                               of DATUM))
+                                  (REPLACE TILOOKSUPDATEFN OF (fetch IMAGEDATA
+                                                                         of DATUM) with
+                                                                                       NEWVALUE))
+                                                             (* ; 
+                                          "Function to be called each time character looks change.")
+                           (FATSTREAMP (fetch F4 of DATUM)
+                                  (REPLACE F4 OF DATUM WITH NEWVALUE))
+                                                             (* ; 
+                                                     "T if the current piece is 16 bit characters.")
+                           )
+                          (CREATE (create STREAM using \TEXTOFD IMAGEDATA _ (create
+                                                                                         
+                                                                                        TEXTIMAGEDATA
+                                                                                         ))))
 )
 
-(ACCESSFNS TEXTSTREAM ((* ;; "Overlay for the STREAM record to allow mnemonic access to stream fields for Text streams.") (REALFILE (fetch F1 of DATUM) (REPLACE F1 OF DATUM WITH NEWVALUE)) (* ; "The real, underlying file behind the current piece") (CHARSLEFT (fetch F2 of DATUM) (REPLACE F2 OF DATUM WITH NEWVALUE)) (* ;; "The # of characters that will be left in the current piece the next time its file crosses a page boundary") (TEXTOBJ (fetch F3 of DATUM) (REPLACE F3 OF DATUM WITH NEWVALUE)) (* ; "The TEXTOBJ that is editing this text") (PIECE (fetch F5 of DATUM) (REPLACE F5 OF DATUM WITH NEWVALUE)) (* ; "The PIECE we're currently fetching chars from/putting chars into") (PCNO (fetch FW8 of DATUM) (REPLACE FW8 OF DATUM WITH NEWVALUE)) (* ; "The position of that piece in the piece table") (PCSTARTPG (fetch FW6 of DATUM) (REPLACE FW6 OF DATUM WITH NEWVALUE)) (* ; "The underlying file page# that this piece starts on") (PCSTARTCH (fetch FW7 of DATUM) (REPLACE FW7 OF DATUM WITH NEWVALUE)) (* ; "The char within page of the underlying file that this piece starts on -- for backbin & co") (PCOFFSET (fetch TIPCOFFSET of (fetch IMAGEDATA of DATUM)) (REPLACE TIPCOFFSET OF (fetch IMAGEDATA of DATUM) with NEWVALUE)) (* ; "The offset into the current piece, as of the last page cross.") (CURRENTLOOKS (fetch F10 of DATUM) (replace F10 of DATUM with NEWVALUE)) (* ; "The CHARLOOKS that are currently applicable to characters being taken from the stream.") (CURRENTPARALOOKS (fetch TICURPARALOOKS of (fetch IMAGEDATA of DATUM)) (REPLACE TICURPARALOOKS OF (fetch IMAGEDATA of DATUM) with NEWVALUE)) (* ; "The FMTSPEC that is currently applicable to characters being taken from the stream.") (CURRENTIMAGESTREAM (fetch TICURIMAGESTREAM of (fetch IMAGEDATA of DATUM)) (REPLACE TICURIMAGESTREAM OF (fetch IMAGEDATA of DATUM) with NEWVALUE) (* ; "The image stream that this text is being put onto;  used for scaling decisions")) (LOOKSUPDATEFN (fetch TILOOKSUPDATEFN of (fetch IMAGEDATA of DATUM)) (REPLACE TILOOKSUPDATEFN OF (fetch IMAGEDATA of DATUM) with NEWVALUE)) (* ; "Function to be called each time character looks change.") (FATSTREAMP (fetch F4 of DATUM) (REPLACE F4 OF DATUM WITH NEWVALUE)) (* ; "T if the current piece is 16 bit characters."))
- (CREATE (create STREAM using \TEXTOFD IMAGEDATA _ (create TEXTIMAGEDATA))))
-)
+(/DECLAREDATATYPE 'PIECE '(POINTER POINTER POINTER POINTER POINTER FULLXPOINTER POINTER POINTER FLAG
+                                 POINTER FLAG FLAG XPOINTER)
+       '((PIECE 0 POINTER)
+         (PIECE 2 POINTER)
+         (PIECE 4 POINTER)
+         (PIECE 6 POINTER)
+         (PIECE 8 POINTER)
+         (PIECE 10 FULLXPOINTER)
+         (PIECE 12 POINTER)
+         (PIECE 14 POINTER)
+         (PIECE 14 (FLAGBITS . 0))
+         (PIECE 16 POINTER)
+         (PIECE 16 (FLAGBITS . 0))
+         (PIECE 16 (FLAGBITS . 16))
+         (PIECE 18 XPOINTER))
+       '20)
 
-(/DECLAREDATATYPE (QUOTE PIECE) (QUOTE (POINTER POINTER POINTER POINTER POINTER FULLXPOINTER POINTER POINTER FLAG POINTER FLAG FLAG XPOINTER)) (QUOTE ((PIECE 0 POINTER) (PIECE 2 POINTER) (PIECE 4 POINTER) (PIECE 6 POINTER) (PIECE 8 POINTER) (PIECE 10 FULLXPOINTER) (PIECE 12 POINTER) (PIECE 14 POINTER) (PIECE 14 (FLAGBITS . 0)) (PIECE 16 POINTER) (PIECE 16 (FLAGBITS . 0)) (PIECE 16 (FLAGBITS . 16)) (PIECE 18 XPOINTER))) (QUOTE 20))
+(/DECLAREDATATYPE 'TEXTOBJ
+       '(POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER FLAG POINTER POINTER
+               POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER 
+               POINTER POINTER FLAG FULLXPOINTER POINTER POINTER POINTER POINTER POINTER FLAG POINTER
+               FLAG FLAG FLAG FLAG POINTER POINTER POINTER POINTER POINTER POINTER FLAG POINTER 
+               FULLXPOINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER FLAG FLAG POINTER
+               POINTER POINTER)
+       '((TEXTOBJ 0 POINTER)
+         (TEXTOBJ 2 POINTER)
+         (TEXTOBJ 4 POINTER)
+         (TEXTOBJ 6 POINTER)
+         (TEXTOBJ 8 POINTER)
+         (TEXTOBJ 10 POINTER)
+         (TEXTOBJ 12 POINTER)
+         (TEXTOBJ 14 POINTER)
+         (TEXTOBJ 16 POINTER)
+         (TEXTOBJ 16 (FLAGBITS . 0))
+         (TEXTOBJ 18 POINTER)
+         (TEXTOBJ 20 POINTER)
+         (TEXTOBJ 22 POINTER)
+         (TEXTOBJ 24 POINTER)
+         (TEXTOBJ 26 POINTER)
+         (TEXTOBJ 28 POINTER)
+         (TEXTOBJ 30 POINTER)
+         (TEXTOBJ 32 POINTER)
+         (TEXTOBJ 34 POINTER)
+         (TEXTOBJ 36 POINTER)
+         (TEXTOBJ 38 POINTER)
+         (TEXTOBJ 40 POINTER)
+         (TEXTOBJ 42 POINTER)
+         (TEXTOBJ 44 POINTER)
+         (TEXTOBJ 44 (FLAGBITS . 0))
+         (TEXTOBJ 46 FULLXPOINTER)
+         (TEXTOBJ 48 POINTER)
+         (TEXTOBJ 50 POINTER)
+         (TEXTOBJ 52 POINTER)
+         (TEXTOBJ 54 POINTER)
+         (TEXTOBJ 56 POINTER)
+         (TEXTOBJ 56 (FLAGBITS . 0))
+         (TEXTOBJ 58 POINTER)
+         (TEXTOBJ 58 (FLAGBITS . 0))
+         (TEXTOBJ 58 (FLAGBITS . 16))
+         (TEXTOBJ 58 (FLAGBITS . 32))
+         (TEXTOBJ 58 (FLAGBITS . 48))
+         (TEXTOBJ 60 POINTER)
+         (TEXTOBJ 62 POINTER)
+         (TEXTOBJ 64 POINTER)
+         (TEXTOBJ 66 POINTER)
+         (TEXTOBJ 68 POINTER)
+         (TEXTOBJ 70 POINTER)
+         (TEXTOBJ 70 (FLAGBITS . 0))
+         (TEXTOBJ 72 POINTER)
+         (TEXTOBJ 74 FULLXPOINTER)
+         (TEXTOBJ 76 POINTER)
+         (TEXTOBJ 78 POINTER)
+         (TEXTOBJ 80 POINTER)
+         (TEXTOBJ 82 POINTER)
+         (TEXTOBJ 84 POINTER)
+         (TEXTOBJ 86 POINTER)
+         (TEXTOBJ 88 POINTER)
+         (TEXTOBJ 88 (FLAGBITS . 0))
+         (TEXTOBJ 88 (FLAGBITS . 16))
+         (TEXTOBJ 90 POINTER)
+         (TEXTOBJ 92 POINTER)
+         (TEXTOBJ 94 POINTER))
+       '96)
 
-(/DECLAREDATATYPE (QUOTE TEXTOBJ) (QUOTE (POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER FLAG POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER FLAG FULLXPOINTER POINTER POINTER POINTER POINTER POINTER FLAG POINTER FLAG FLAG FLAG FLAG POINTER POINTER POINTER POINTER POINTER POINTER FLAG POINTER FULLXPOINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER FLAG FLAG POINTER POINTER POINTER)) (QUOTE ((TEXTOBJ 0 POINTER) (TEXTOBJ 2 POINTER) (TEXTOBJ 4 POINTER) (TEXTOBJ 6 POINTER) (TEXTOBJ 8 POINTER) (TEXTOBJ 10 POINTER) (TEXTOBJ 12 POINTER) (TEXTOBJ 14 POINTER) (TEXTOBJ 16 POINTER) (TEXTOBJ 16 (FLAGBITS . 0)) (TEXTOBJ 18 POINTER) (TEXTOBJ 20 POINTER) (TEXTOBJ 22 POINTER) (TEXTOBJ 24 POINTER) (TEXTOBJ 26 POINTER) (TEXTOBJ 28 POINTER) (TEXTOBJ 30 POINTER) (TEXTOBJ 32 POINTER) (TEXTOBJ 34 POINTER) (TEXTOBJ 36 POINTER) (TEXTOBJ 38 POINTER) (TEXTOBJ 40 POINTER) (TEXTOBJ 42 POINTER) (TEXTOBJ 44 POINTER) (TEXTOBJ 44 (FLAGBITS . 0)) (TEXTOBJ 46 FULLXPOINTER) (TEXTOBJ 48 POINTER) (TEXTOBJ 50 POINTER) (TEXTOBJ 52 POINTER) (TEXTOBJ 54 POINTER) (TEXTOBJ 56 POINTER) (TEXTOBJ 56 (FLAGBITS . 0)) (TEXTOBJ 58 POINTER) (TEXTOBJ 58 (FLAGBITS . 0)) (TEXTOBJ 58 (FLAGBITS . 16)) (TEXTOBJ 58 (FLAGBITS . 32)) (TEXTOBJ 58 (FLAGBITS . 48)) (TEXTOBJ 60 POINTER) (TEXTOBJ 62 POINTER) (TEXTOBJ 64 POINTER) (TEXTOBJ 66 POINTER) (TEXTOBJ 68 POINTER) (TEXTOBJ 70 POINTER) (TEXTOBJ 70 (FLAGBITS . 0)) (TEXTOBJ 72 POINTER) (TEXTOBJ 74 FULLXPOINTER) (TEXTOBJ 76 POINTER) (TEXTOBJ 78 POINTER) (TEXTOBJ 80 POINTER) (TEXTOBJ 82 POINTER) (TEXTOBJ 84 POINTER) (TEXTOBJ 86 POINTER) (TEXTOBJ 88 POINTER) (TEXTOBJ 88 (FLAGBITS . 0)) (TEXTOBJ 88 (FLAGBITS . 16)) (TEXTOBJ 90 POINTER) (TEXTOBJ 92 POINTER) (TEXTOBJ 94 POINTER))) (QUOTE 96))
+(/DECLAREDATATYPE 'TEXTIMAGEDATA '(POINTER POINTER POINTER POINTER)
+       '((TEXTIMAGEDATA 0 POINTER)
+         (TEXTIMAGEDATA 2 POINTER)
+         (TEXTIMAGEDATA 4 POINTER)
+         (TEXTIMAGEDATA 6 POINTER))
+       '8)
 
-(/DECLAREDATATYPE (QUOTE TEXTIMAGEDATA) (QUOTE (POINTER POINTER POINTER POINTER)) (QUOTE ((TEXTIMAGEDATA 0 POINTER) (TEXTIMAGEDATA 2 POINTER) (TEXTIMAGEDATA 4 POINTER) (TEXTIMAGEDATA 6 POINTER))) (QUOTE 8))
+(DEFOPTIMIZER TEXTPROP (TEXTOBJ PROP &OPTIONAL (VAL NIL WRITING))
 
-(DEFOPTIMIZER TEXTPROP (TEXTOBJ PROP &OPTIONAL (VAL NIL WRITING)) (* ;; "compiles calls to TEXTPROP") (COND ((NOT (LISTP PROP)) (* ; "property is not quoted.") (QUOTE IGNOREMACRO)) ((NOT (EQ (CAR PROP) (QUOTE QUOTE))) (* ; "property is not quoted.") (QUOTE IGNOREMACRO)) ((NOT WRITING) (* ; "fetching a TEXTPROP property.") (SELECTQ (CADR PROP) ((READONLY READ-ONLY) (BQUOTE (fetch (TEXTOBJ TXTREADONLY) of (TEXTOBJ (\, TEXTOBJ))))) ((BEING-EDITED ACTIVE) (BQUOTE (fetch (TEXTOBJ TXTEDITING) of (TEXTOBJ (\, TEXTOBJ))))) ((NO-NS-CHARS NONSCHARS NO-NSCHARS) (BQUOTE (fetch (TEXTOBJ TXTNONSCHARS) of (TEXTOBJ (\, TEXTOBJ))))) (BQUOTE (LISTGET (fetch (TEXTOBJ EDITPROPS) of (TEXTOBJ (\, TEXTOBJ))) (\, PROP))))) (T (* ; "storing a window property") (SELECTQ (CADR PROP) ((READONLY READ-ONLY) (BQUOTE (REPLACE (TEXTOBJ TXTREADONLY) OF (TEXTOBJ (\, TEXTOBJ)) WITH (\, VAL)))) ((BEING-EDITED ACTIVE) (BQUOTE (REPLACE (TEXTOBJ TXTEDITING) OF (TEXTOBJ (\, TEXTOBJ)) WITH (\, VAL)))) ((NO-NS-CHARS NONSCHARS NO-NSCHARS) (BQUOTE (REPLACE (TEXTOBJ TXTNONSCHARS) OF (TEXTOBJ (\, TEXTOBJ)) WITH (\, VAL)))) (BQUOTE (LET* (($$TEXTOBJ$$ (TEXTOBJ (\, TEXTOBJ))) ($$PROPLST$$ (FETCH EDITPROPS OF $$TEXTOBJ$$))) (COND ($$PROPLST$$ (LISTPUT $$PROPLST$$ (\, PROP) (\, VAL))) (T (REPLACE EDITPROPS OF $$TEXTOBJ$$ WITH (LIST (\, PROP) (\, VAL)))))))))))
+                           (* ;; "compiles calls to TEXTPROP")
+
+                           [COND
+                              ((NOT (LISTP PROP))            (* ; "property is not quoted.")
+                               'IGNOREMACRO)
+                              ((NOT (EQ (CAR PROP)
+                                        'QUOTE))             (* ; "property is not quoted.")
+                               'IGNOREMACRO)
+                              [(NOT WRITING)                 (* ; "fetching a TEXTPROP property.")
+                               (SELECTQ (CADR PROP)
+                                   ((READONLY READ-ONLY) 
+                                        `(fetch (TEXTOBJ TXTREADONLY) of (TEXTOBJ
+                                                                                  ,TEXTOBJ)))
+                                   ((BEING-EDITED ACTIVE) 
+                                        `(fetch (TEXTOBJ TXTEDITING) of (TEXTOBJ ,TEXTOBJ)))
+                                   ((NO-NS-CHARS NONSCHARS NO-NSCHARS) 
+                                        `(fetch (TEXTOBJ TXTNONSCHARS) of (TEXTOBJ
+                                                                                   ,TEXTOBJ)))
+                                   `(LISTGET (fetch (TEXTOBJ EDITPROPS)
+                                                of (TEXTOBJ ,TEXTOBJ))
+                                           ,PROP]
+                              (T                             (* ; "storing a window property")
+                                 (SELECTQ (CADR PROP)
+                                     ((READONLY READ-ONLY) 
+                                          `(REPLACE (TEXTOBJ TXTREADONLY)
+                                              OF (TEXTOBJ ,TEXTOBJ) WITH ,VAL))
+                                     ((BEING-EDITED ACTIVE) 
+                                          `(REPLACE (TEXTOBJ TXTEDITING)
+                                              OF (TEXTOBJ ,TEXTOBJ) WITH ,VAL))
+                                     ((NO-NS-CHARS NONSCHARS NO-NSCHARS) 
+                                          `(REPLACE (TEXTOBJ TXTNONSCHARS)
+                                              OF (TEXTOBJ ,TEXTOBJ) WITH ,VAL))
+                                     `(LET* (($$TEXTOBJ$$ (TEXTOBJ ,TEXTOBJ))
+                                             ($$PROPLST$$ (FETCH EDITPROPS OF $$TEXTOBJ$$)))
+                                            (COND
+                                               ($$PROPLST$$ (LISTPUT $$PROPLST$$ ,PROP ,VAL))
+                                               (T (REPLACE EDITPROPS OF $$TEXTOBJ$$
+                                                     WITH (LIST ,PROP ,VAL])
 
 
 
@@ -154,20 +843,52 @@ Copyright (c) 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1994 by Venue.  All righ
 (RPAQQ \EltsPerPiece 2)
 
 
-(CONSTANTS (\PCTBFreePieces 0) (\PCTBLastPieceOffset 1) (\FirstPieceOffset 2) (\SecondPieceOffset 4) (\EltsPerPiece 2))
+(CONSTANTS (\PCTBFreePieces 0)
+       (\PCTBLastPieceOffset 1)
+       (\FirstPieceOffset 2)
+       (\SecondPieceOffset 4)
+       (\EltsPerPiece 2))
 )
 
 (DECLARE%: EVAL@COMPILE 
 
-(PUTPROPS \EDITELT DMACRO (OPENLAMBDA (ARR NO) (* This is equivalent to ELT, but bypasses the checking, since we "know" that ARR is an array. Hence, much faster.) (GETBASEPTR (\ADDBASE2 (fetch (ARRAYP BASE) of ARR) NO) 0)))
+(PUTPROPS \EDITELT DMACRO (OPENLAMBDA (ARR NO)
 
-(PUTPROPS \GETCH MACRO ((TEXTOBJ) (* jds "23-FEB-82 08:56") (* Get the next available character from the text being edited.) (\BIN (fetch STREAMHINT of TEXTOBJ))))
+         (* This is equivalent to ELT, but bypasses the checking, since we "know" that 
+       ARR is an array. Hence, much faster.)
 
-(PUTPROPS \GETCHB MACRO ((TEXTOBJ) (* Get the next prior character in the text being edited.) (\BACKBIN (fetch STREAMHINT of TEXTOBJ))))
+                                    (GETBASEPTR (\ADDBASE2 (fetch (ARRAYP BASE) of ARR)
+                                                       NO)
+                                           0)))
 
-(PUTPROPS \EDITSETA DMACRO (OPENLAMBDA (ARR N VAL) (* Equivalent to SETA (for pointer-type arrays) %, but bypasses the bounds and type checking. Hence MUCH faster.) (\RPLPTR (\ADDBASE2 (fetch (ARRAYP BASE) of ARR) N) 0 VAL)))
+(PUTPROPS \GETCH MACRO ((TEXTOBJ)                (* jds "23-FEB-82 08:56")
+                                                             (* Get the next available character 
+                                                           from the text being edited.)
+                                (\BIN (fetch STREAMHINT of TEXTOBJ))))
 
-(PUTPROPS \WORDSETA DMACRO (OPENLAMBDA (A J V) (CHECK (AND (ARRAYP A) (ZEROP (fetch (ARRAYP ORIG) of A)) (EQ \ST.POS16 (fetch (ARRAYP TYP) of A)))) (CHECK (IGREATERP (fetch (ARRAYP LENGTH) of A) J)) (\PUTBASE (fetch (ARRAYP BASE) of A) (IPLUS (fetch (ARRAYP OFFST) of A) J) V)))
+(PUTPROPS \GETCHB MACRO ((TEXTOBJ)                   (* Get the next prior character in 
+                                                           the text being edited.)
+                                 (\BACKBIN (fetch STREAMHINT of TEXTOBJ))))
+
+(PUTPROPS \EDITSETA DMACRO (OPENLAMBDA (ARR N VAL)
+
+         (* Equivalent to SETA (for pointer-type arrays)%, but bypasses the bounds and 
+       type checking. Hence MUCH faster.)
+
+                                     (\RPLPTR (\ADDBASE2 (fetch (ARRAYP BASE) of ARR)
+                                                     N)
+                                            0 VAL)))
+
+(PUTPROPS \WORDSETA DMACRO (OPENLAMBDA (A J V)
+                                     [CHECK (AND (ARRAYP A)
+                                                 (ZEROP (fetch (ARRAYP ORIG) of A))
+                                                 (EQ \ST.POS16 (fetch (ARRAYP TYP) of A]
+                                     (CHECK (IGREATERP (fetch (ARRAYP LENGTH) of A)
+                                                   J))
+                                     (\PUTBASE (fetch (ARRAYP BASE) of A)
+                                            (IPLUS (fetch (ARRAYP OFFST) of A)
+                                                   J)
+                                            V)))
 )
 
 (DECLARE%: DOEVAL@COMPILE DONTCOPY
@@ -182,25 +903,91 @@ Copyright (c) 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1994 by Venue.  All righ
 
 (DECLARE%: EVAL@COMPILE
 
-(RECORD PAGEFORMATTINGSTATE ((* ;; "Contains the state for a TEdit page-formatting job.") PAGE# (* ; "The current page number.  Counted from 1") FIRSTPAGE (* ;; "T if the current page is the 'first page' .  Is set initially, and can be set again by the user at will.  Gets reset after each page image is printed.") MINPAGE# (* ; "The page # of the first page to be printed, or NIL") MAXPAGE# (* ; "The page # of the last page to be printed, or NIL") STATE (* ; "One of FORMATTING or SEARCHING.") REQUIREDREGIONTYPE (* ; "If STATE is SEARCHING, the kind of box we're looking for.  If STATE is :SEARCHING-FOR-EQUIVALENT-PAGE, this is the page count for the matching page.") MAINSTREAM (* ; "The principal textobj/stream source") CHNO (* ; "Our position in that stream") PRESSREGION (* ; "The press code's REGION info.") PAGEHEADINGS (* ; "The list of current values to be printed, indexed by heading type") PAGE#GENERATOR (* ; "List of page numbers;  later, maybe, a function to generate page numbers.  Used to fill in PAGE#TEXT, below") PAGE#TEXT (* ; "If special page numbers are in use, this is the place to take them from.  PAGE# is still used for recto/verso decisions &c") PAGEISRECTO (* ; "T if this is a recto page, NIL if it's a VERSO page.") PAGEFOOTNOTELINES (* ; "A list of extant footnote lines that should appear at the next opportunity") PAGEFLOATINGTOPLINES (* ; "A list of lines that should float to the top of the next available place") PAGECOUNT (* ; "The number of pages we've formatted so far.") PAGELINECACHE (* ; "A cache for pre-created LINEDESCRIPTOR/THISLINE sets, to avoid the overhead of re-allocating them all the time") NEWPAGELAYOUT (* ; "If we switch page layouts in mid-document, this is where the new layout gets cached until we get started again."))
- PAGECOUNT _ 0)
+(RECORD PAGEFORMATTINGSTATE (
+                                 (* ;; "Contains the state for a TEdit page-formatting job.")
 
-(DATATYPE PAGEREGION ((* ;; "Describe a part of a page for page formatting.  Can be made into compound descriptions.") REGIONFILLMETHOD (* ; "What kind of a region this is -- TEXT, FOLIO, PAGEHEADING, etc.") REGIONSPEC (* ; "The page-relative region this occupies") REGIONLOCALINFO (* ; "A PLIST for local information") (REGIONPARENT FULLXPOINTER) (* ; "The parent node for this box, for sub-boxes") REGIONSUBBOXES (* ; "The sub-regions of this region") REGIONTYPE (* ; "A user-settable region type"))
-)
+                                 PAGE#                       (* ; 
+                                                         "The current page number.  Counted from 1")
+                                 FIRSTPAGE
+
+                                 (* ;; "T if the current page is the 'first page' .  Is set initially, and can be set again by the user at will.  Gets reset after each page image is printed.")
+
+                                 MINPAGE#                    (* ; 
+                                               "The page # of the first page to be printed, or NIL")
+                                 MAXPAGE#                    (* ; 
+                                                "The page # of the last page to be printed, or NIL")
+                                 STATE                       (* ; "One of FORMATTING or SEARCHING.")
+                                 REQUIREDREGIONTYPE          (* ; "If STATE is SEARCHING, the kind of box we're looking for.  If STATE is :SEARCHING-FOR-EQUIVALENT-PAGE, this is the page count for the matching page.")
+                                 MAINSTREAM                  (* ; 
+                                                           "The principal textobj/stream source")
+                                 CHNO                        (* ; "Our position in that stream")
+                                 PRESSREGION                 (* ; "The press code's REGION info.")
+                                 PAGEHEADINGS                (* ; 
+                                "The list of current values to be printed, indexed by heading type")
+                                 PAGE#GENERATOR              (* ; "List of page numbers;  later, maybe, a function to generate page numbers.  Used to fill in PAGE#TEXT, below")
+                                 PAGE#TEXT                   (* ; "If special page numbers are in use, this is the place to take them from.  PAGE# is still used for recto/verso decisions &c")
+                                 PAGEISRECTO                 (* ; 
+                                             "T if this is a recto page, NIL if it's a VERSO page.")
+                                 PAGEFOOTNOTELINES           (* ; 
+                       "A list of extant footnote lines that should appear at the next opportunity")
+                                 PAGEFLOATINGTOPLINES        (* ; 
+                         "A list of lines that should float to the top of the next available place")
+                                 PAGECOUNT                   (* ; 
+                                                      "The number of pages we've formatted so far.")
+                                 PAGELINECACHE               (* ; "A cache for pre-created LINEDESCRIPTOR/THISLINE sets, to avoid the overhead of re-allocating them all the time")
+                                 NEWPAGELAYOUT               (* ; "If we switch page layouts in mid-document, this is where the new layout gets cached until we get started again.")
+                                 )
+                                PAGECOUNT _ 0)
+
+(DATATYPE PAGEREGION (
+                          (* ;; 
+          "Describe a part of a page for page formatting.  Can be made into compound descriptions.")
+
+                          REGIONFILLMETHOD                   (* ; 
+                                  "What kind of a region this is -- TEXT, FOLIO, PAGEHEADING, etc.")
+                          REGIONSPEC                         (* ; 
+                                                           "The page-relative region this occupies")
+                          REGIONLOCALINFO                    (* ; "A PLIST for local information")
+                          (REGIONPARENT FULLXPOINTER)        (* ; 
+                                                      "The parent node for this box, for sub-boxes")
+                          REGIONSUBBOXES                     (* ; "The sub-regions of this region")
+                          REGIONTYPE                         (* ; "A user-settable region type")
+                          ))
 )
 
-(/DECLAREDATATYPE (QUOTE PAGEREGION) (QUOTE (POINTER POINTER POINTER FULLXPOINTER POINTER POINTER)) (QUOTE ((PAGEREGION 0 POINTER) (PAGEREGION 2 POINTER) (PAGEREGION 4 POINTER) (PAGEREGION 6 FULLXPOINTER) (PAGEREGION 8 POINTER) (PAGEREGION 10 POINTER))) (QUOTE 12))
+(/DECLAREDATATYPE 'PAGEREGION '(POINTER POINTER POINTER FULLXPOINTER POINTER POINTER)
+       '((PAGEREGION 0 POINTER)
+         (PAGEREGION 2 POINTER)
+         (PAGEREGION 4 POINTER)
+         (PAGEREGION 6 FULLXPOINTER)
+         (PAGEREGION 8 POINTER)
+         (PAGEREGION 10 POINTER))
+       '12)
 (DECLARE%: EVAL@COMPILE DONTCOPY 
 (DECLARE%: EVAL@COMPILE
 
-(RECORD TEDITPAPERSIZE ((* ;; "Describe the size of a sheet of paper (in points), given a paper size-name.") TPSNAME (* ; "The name, as a litatom") TPSWIDTH (* ; "Paper width, in points") TPSHEIGHT (* ; "Paper Height, in points") TPSLANDSCAPE? (* ; "T if we have to rotate things to print them on this paper."))
-)
+(RECORD TEDITPAPERSIZE (
+                            (* ;; 
+                      "Describe the size of a sheet of paper (in points), given a paper size-name.")
+
+                            TPSNAME                          (* ; "The name, as a litatom")
+                            TPSWIDTH                         (* ; "Paper width, in points")
+                            TPSHEIGHT                        (* ; "Paper Height, in points")
+                            TPSLANDSCAPE?                    (* ; 
+                                       "T if we have to rotate things to print them on this paper.")
+                            ))
 )
 
 
-(DEFMACRO \NEW-COLUMN-START (LINE FMTSPEC) (BQUOTE (AND (FFETCH (LINEDESCRIPTOR 1STLN) OF (\, LINE)) (EQ (FFETCH (FMTSPEC FMTCOLUMN) OF (\, FMTSPEC)) (QUOTE NEXT)))))
+(DEFMACRO \NEW-COLUMN-START (LINE FMTSPEC)
+   `(AND (FFETCH (LINEDESCRIPTOR 1STLN) OF ,LINE)
+         (EQ (FFETCH (FMTSPEC FMTCOLUMN) OF ,FMTSPEC)
+             'NEXT)))
 
-(DEFMACRO \FIRST-COLUMN-START (LINE FMTSPEC) (BQUOTE (AND (FFETCH (LINEDESCRIPTOR 1STLN) OF (\, LINE)) (EQ (FFETCH (FMTSPEC FMTCOLUMN) OF (\, FMTSPEC)) (QUOTE FIRST)))))
+(DEFMACRO \FIRST-COLUMN-START (LINE FMTSPEC)
+   `(AND (FFETCH (LINEDESCRIPTOR 1STLN) OF ,LINE)
+         (EQ (FFETCH (FMTSPEC FMTCOLUMN) OF ,FMTSPEC)
+             'FIRST)))
 )
 
 
@@ -233,7 +1020,17 @@ Copyright (c) 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1994 by Venue.  All righ
 (RPAQQ \SpecialPattern 1024)
 
 
-(CONSTANTS (\AlphaNumericFlag 256) (\AlphaFlag 512) (\OneCharPattern 1024) (\AnyStringPattern 1025) (\OneAlphaPattern 1026) (\AnyAlphaPattern 1027) (\OneNonAlphaPattern 1028) (\AnyNonAlphaPattern 1029) (\LeftBracketPattern 1030) (\RightBracketPattern 1031) (\SpecialPattern 1024))
+(CONSTANTS (\AlphaNumericFlag 256)
+       (\AlphaFlag 512)
+       (\OneCharPattern 1024)
+       (\AnyStringPattern 1025)
+       (\OneAlphaPattern 1026)
+       (\AnyAlphaPattern 1027)
+       (\OneNonAlphaPattern 1028)
+       (\AnyNonAlphaPattern 1029)
+       (\LeftBracketPattern 1030)
+       (\RightBracketPattern 1031)
+       (\SpecialPattern 1024))
 )
 )
 
@@ -243,29 +1040,210 @@ Copyright (c) 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1994 by Venue.  All righ
 
 (DECLARE%: EVAL@COMPILE
 
-(DATATYPE CHARLOOKS ((* ;; "Describes the appearance (%"Looks%") of characters in a TEdit document.") CLFONT (* ; "The font descriptor for these characters") CLNAME (* ;; "Name of the font (e.g., HELVETICA) THIS FIELD IS A HINT, OR FOR USE IN CHARLOOKS-BUILDING CODE.  USE FONTPROP TO GET THE RIGHT VALUE FROM CLFONT.") CLSIZE (* ; "Font size, in points") (CLITAL FLAG) (* ; "T if the characters are italic, else NIL") (CLBOLD FLAG) (* ; "T if the characters are bold, else NIL") (CLULINE FLAG) (* ; "T if the characters are to be underscored, else NIL") (CLOLINE FLAG) (* ; "T if the characters are to be overscored, else NIL") (CLSTRIKE FLAG) (* ; "T if the characters are to be struck thru, else nil.") CLOFFSET (* ; "A superscripting offset in points (?) else NIL (SUBSCRIPTING IF NEGATIVE.)") (CLSMALLCAP FLAG) (* ; "T if small caps, else NIL") (CLINVERTED FLAG) (* ; "T if the characters are to be shown white-on-black") (CLPROTECTED FLAG) (* ; "T if chars can't be selected, else NIL") (CLINVISIBLE FLAG) (* ; "T if TEDIT is to ignore these chars;  else NIL") (CLSELHERE FLAG) (* ;; "T if TEDIT can put selection after this char (for menu blanks) else NIL;  anything typed after this char will NOT BE PROTECTED.") (CLCANCOPY FLAG) (* ;; "T if this text can be selected for copying, even tho protected (it will become unprotected after the copy;  for Dribble/TTY interface)") CLSTYLE (* ; "The style to be used in marking these characters;  overridden by the other fields") CLUSERINFO (* ; "Any information that an outsider wants to include") CLLEADER (* ; "For creating dotted and other kinds of leader") CLRULES (* ;; "For arbitrarily-places horizontal rules.  List of pairs, of (widthinpts  . offsetfrombaselineinpts).  Should be taken account of in ascent/descent calcs.") (CLMARK FLAG) (* ;; "Used for a mark-&-sweep of looks at PUT time -- T means this set of looks really IS in use in the document"))
- CLOFFSET _ 0)
+(DATATYPE CHARLOOKS (
+                         (* ;; 
+                       "Describes the appearance (%"Looks%") of characters in a TEdit document.")
 
-(DATATYPE FMTSPEC ((* ;; "Describe the paragraph formatting for a paragraph in a TEdit document.") 1STLEFTMAR (* ; "Left margin of the first line of the paragraph") LEFTMAR (* ; "Left margin of the rest of the lines in the paragraph") RIGHTMAR (* ; "Right margin for the paragraph") LEADBEFORE (* ; "Leading above the paragraph's first line, in points") LEADAFTER (* ; "Leading below the paragraph's bottom line, in points.  NOT IMPLEMENTED.") LINELEAD (* ; "Leading between lines, in points.  Actually, this space is added BELOW each line in the para.") FMTBASETOBASE (* ; "The baseline-to-baseline spacing between lines in this paragraph.  THIS OVERRIDES THE LINE LEADING") TABSPEC (* ; "The list of tabs for this paragraph, including CAR for a default tab width") QUAD (* ; "How the para is formatted: one of LEFT, RIGHT, CENTERED, JUSTIFIED") FMTSTYLE (* ; "The STYLE that controls this paragraph's appearance") FMTCHARSTYLES (* ; "The characterstyles that control the appearance of characters in this para (maybe?  may be part of the fmtstyle.)") FMTUSERINFO (* ; "Space for a PLIST of user info") FMTSPECIALX (* ; "A special horizontal location on the printed page for this para.") FMTSPECIALY (* ; "A special vertical location on the page for this para") (FMTHEADINGKEEP FLAG) (* ; "This para should be kept with the top line or so of the next para..") FMTPARATYPE (* ; "What kind of para this is: TEXT, PAGEHEADING, whatever") FMTPARASUBTYPE (* ; "Sub type of the type, e.g., what KIND of page heading this is.") FMTNEWPAGEBEFORE (* ; "Start a new box (if T) or back up the page formatting tree to make a new box of the type named in the value -- by going the least distance back up the tree, then back down until you find that kind of box.") FMTNEWPAGEAFTER (* ; "Similarly") FMTKEEP (* ; "For information about how this paragraph is to be kept with other paragraphs.") FMTCOLUMN (* ; "For setting up side-by-side paragraphs easily ala BravoX") FMTVERTRULES (* ; "For Keeping track of vertical rules in force") (FMTMARK FLAG) (* ; "Used to keep track of which PARALOOKSs are really being used -- a mark & collect is done just before a PUT, so that only 'real' PARALOOKSs make it into the file") (* ; "Used for a mark&sweep of para looks at PUT time -- T means this looks really IS in use in the document, so it makes sense to save it on the file.") (FMTHARDCOPY FLAG) (* ; "T if this paragraph is to be displayed in hardcopy-format.") FMTREVISED (* ; "T (or perhaps a revision level or revision-mark spec??) if this paragraph is to be marked as changed on output."))
- TABSPEC _ (CONS NIL NIL))
+                         CLFONT                              (* ; 
+                                                         "The font descriptor for these characters")
+                         CLNAME
 
-(DATATYPE PENDINGTAB ((* ;; "The data structure for a tab, within the line formatter, that we haven't finished dealing with yet, e.g. a centered tab where you need to wait for AFTER the centered text to do the formatting.") PTNEWTX (* ;; "An updated TX, being passed back to the line formatter.  This results from the resolution of an old RIGHT, CENTERED, or DECIMAL tab, which changed the width of a prior tab.") PTOLDTAB (* ; "The pending tab") PTTYPE (* ; "Its tab type") PTTABX (* ; "Its nominal X position") (PTWBASE FULLXPOINTER) (* ; "The WBASE for its width, for updating when we've figured out how wide the tab really is") PTOLDTX (* ; "The TX as of when the tab was encountered."))
-)
+                         (* ;; "Name of the font (e.g., HELVETICA) THIS FIELD IS A HINT, OR FOR USE IN CHARLOOKS-BUILDING CODE.  USE FONTPROP TO GET THE RIGHT VALUE FROM CLFONT.")
+
+                         CLSIZE                              (* ; "Font size, in points")
+                         (CLITAL FLAG)                       (* ; 
+                                                         "T if the characters are italic, else NIL")
+                         (CLBOLD FLAG)                       (* ; 
+                                                           "T if the characters are bold, else NIL")
+                         (CLULINE FLAG)                      (* ; 
+                                              "T if the characters are to be underscored, else NIL")
+                         (CLOLINE FLAG)                      (* ; 
+                                               "T if the characters are to be overscored, else NIL")
+                         (CLSTRIKE FLAG)                     (* ; 
+                                             "T if the characters are to be struck thru, else nil.")
+                         CLOFFSET                            (* ; 
+                       "A superscripting offset in points (?) else NIL (SUBSCRIPTING IF NEGATIVE.)")
+                         (CLSMALLCAP FLAG)                   (* ; "T if small caps, else NIL")
+                         (CLINVERTED FLAG)                   (* ; 
+                                               "T if the characters are to be shown white-on-black")
+                         (CLPROTECTED FLAG)                  (* ; 
+                                                           "T if chars can't be selected, else NIL")
+                         (CLINVISIBLE FLAG)                  (* ; 
+                                                   "T if TEDIT is to ignore these chars;  else NIL")
+                         (CLSELHERE FLAG)
+
+                         (* ;; "T if TEDIT can put selection after this char (for menu blanks) else NIL;  anything typed after this char will NOT BE PROTECTED.")
+
+                         (CLCANCOPY FLAG)
+
+                         (* ;; "T if this text can be selected for copying, even tho protected (it will become unprotected after the copy;  for Dribble/TTY interface)")
+
+                         CLSTYLE                             (* ; 
+                "The style to be used in marking these characters;  overridden by the other fields")
+                         CLUSERINFO                          (* ; 
+                                                "Any information that an outsider wants to include")
+                         CLLEADER                            (* ; 
+                                                    "For creating dotted and other kinds of leader")
+                         CLRULES
+
+                         (* ;; "For arbitrarily-places horizontal rules.  List of pairs, of (widthinpts  . offsetfrombaselineinpts).  Should be taken account of in ascent/descent calcs.")
+
+                         (CLMARK FLAG)
+
+                         (* ;; "Used for a mark-&-sweep of looks at PUT time -- T means this set of looks really IS in use in the document")
+
+                         )
+                        CLOFFSET _ 0)
+
+(DATATYPE FMTSPEC (
+                       (* ;; 
+                     "Describe the paragraph formatting for a paragraph in a TEdit document.")
+
+                       1STLEFTMAR                            (* ; 
+                                                   "Left margin of the first line of the paragraph")
+                       LEFTMAR                               (* ; 
+                                            "Left margin of the rest of the lines in the paragraph")
+                       RIGHTMAR                              (* ; "Right margin for the paragraph")
+                       LEADBEFORE                            (* ; 
+                                              "Leading above the paragraph's first line, in points")
+                       LEADAFTER                             (* ; 
+                          "Leading below the paragraph's bottom line, in points.  NOT IMPLEMENTED.")
+                       LINELEAD                              (* ; 
+    "Leading between lines, in points.  Actually, this space is added BELOW each line in the para.")
+                       FMTBASETOBASE                         (* ; 
+"The baseline-to-baseline spacing between lines in this paragraph.  THIS OVERRIDES THE LINE LEADING")
+                       TABSPEC                               (* ; 
+                       "The list of tabs for this paragraph, including CAR for a default tab width")
+                       QUAD                                  (* ; 
+                               "How the para is formatted: one of LEFT, RIGHT, CENTERED, JUSTIFIED")
+                       FMTSTYLE                              (* ; 
+                                              "The STYLE that controls this paragraph's appearance")
+                       FMTCHARSTYLES                         (* ; "The characterstyles that control the appearance of characters in this para (maybe?  may be part of the fmtstyle.)")
+                       FMTUSERINFO                           (* ; "Space for a PLIST of user info")
+                       FMTSPECIALX                           (* ; 
+                                 "A special horizontal location on the printed page for this para.")
+                       FMTSPECIALY                           (* ; 
+                                            "A special vertical location on the page for this para")
+                       (FMTHEADINGKEEP FLAG)                 (* ; 
+                              "This para should be kept with the top line or so of the next para..")
+                       FMTPARATYPE                           (* ; 
+                                           "What kind of para this is: TEXT, PAGEHEADING, whatever")
+                       FMTPARASUBTYPE                        (* ; 
+                                   "Sub type of the type, e.g., what KIND of page heading this is.")
+                       FMTNEWPAGEBEFORE                      (* ; "Start a new box (if T) or back up the page formatting tree to make a new box of the type named in the value -- by going the least distance back up the tree, then back down until you find that kind of box.")
+                       FMTNEWPAGEAFTER                       (* ; "Similarly")
+                       FMTKEEP                               (* ; 
+                    "For information about how this paragraph is to be kept with other paragraphs.")
+                       FMTCOLUMN                             (* ; 
+                                         "For setting up side-by-side paragraphs easily ala BravoX")
+                       FMTVERTRULES                          (* ; 
+                                                     "For Keeping track of vertical rules in force")
+                       (FMTMARK FLAG)                        (* ; "Used to keep track of which PARALOOKSs are really being used -- a mark & collect is done just before a PUT, so that only 'real' PARALOOKSs make it into the file")
+                                                             (* ; "Used for a mark&sweep of para looks at PUT time -- T means this looks really IS in use in the document, so it makes sense to save it on the file.")
+                       (FMTHARDCOPY FLAG)                    (* ; 
+                                       "T if this paragraph is to be displayed in hardcopy-format.")
+                       FMTREVISED                            (* ; "T (or perhaps a revision level or revision-mark spec??) if this paragraph is to be marked as changed on output.")
+                       )
+                      TABSPEC _ (CONS NIL NIL))
+
+(DATATYPE PENDINGTAB (
+                          (* ;; "The data structure for a tab, within the line formatter, that we haven't finished dealing with yet, e.g. a centered tab where you need to wait for AFTER the centered text to do the formatting.")
+
+                          PTNEWTX
+
+                          (* ;; "An updated TX, being passed back to the line formatter.  This results from the resolution of an old RIGHT, CENTERED, or DECIMAL tab, which changed the width of a prior tab.")
+
+                          PTOLDTAB                           (* ; "The pending tab")
+                          PTTYPE                             (* ; "Its tab type")
+                          PTTABX                             (* ; "Its nominal X position")
+                          (PTWBASE FULLXPOINTER)             (* ; 
+          "The WBASE for its width, for updating when we've figured out how wide the tab really is")
+                          PTOLDTX                            (* ; 
+                                                       "The TX as of when the tab was encountered.")
+                          ))
 )
 
-(/DECLAREDATATYPE (QUOTE CHARLOOKS) (QUOTE (POINTER POINTER POINTER FLAG FLAG FLAG FLAG FLAG POINTER FLAG FLAG FLAG FLAG FLAG FLAG POINTER POINTER POINTER POINTER FLAG)) (QUOTE ((CHARLOOKS 0 POINTER) (CHARLOOKS 2 POINTER) (CHARLOOKS 4 POINTER) (CHARLOOKS 4 (FLAGBITS . 0)) (CHARLOOKS 4 (FLAGBITS . 16)) (CHARLOOKS 4 (FLAGBITS . 32)) (CHARLOOKS 4 (FLAGBITS . 48)) (CHARLOOKS 2 (FLAGBITS . 0)) (CHARLOOKS 6 POINTER) (CHARLOOKS 6 (FLAGBITS . 0)) (CHARLOOKS 6 (FLAGBITS . 16)) (CHARLOOKS 6 (FLAGBITS . 32)) (CHARLOOKS 6 (FLAGBITS . 48)) (CHARLOOKS 2 (FLAGBITS . 16)) (CHARLOOKS 2 (FLAGBITS . 32)) (CHARLOOKS 8 POINTER) (CHARLOOKS 10 POINTER) (CHARLOOKS 12 POINTER) (CHARLOOKS 14 POINTER) (CHARLOOKS 14 (FLAGBITS . 0)))) (QUOTE 16))
+(/DECLAREDATATYPE 'CHARLOOKS
+       '(POINTER POINTER POINTER FLAG FLAG FLAG FLAG FLAG POINTER FLAG FLAG FLAG FLAG FLAG FLAG 
+               POINTER POINTER POINTER POINTER FLAG)
+       '((CHARLOOKS 0 POINTER)
+         (CHARLOOKS 2 POINTER)
+         (CHARLOOKS 4 POINTER)
+         (CHARLOOKS 4 (FLAGBITS . 0))
+         (CHARLOOKS 4 (FLAGBITS . 16))
+         (CHARLOOKS 4 (FLAGBITS . 32))
+         (CHARLOOKS 4 (FLAGBITS . 48))
+         (CHARLOOKS 2 (FLAGBITS . 0))
+         (CHARLOOKS 6 POINTER)
+         (CHARLOOKS 6 (FLAGBITS . 0))
+         (CHARLOOKS 6 (FLAGBITS . 16))
+         (CHARLOOKS 6 (FLAGBITS . 32))
+         (CHARLOOKS 6 (FLAGBITS . 48))
+         (CHARLOOKS 2 (FLAGBITS . 16))
+         (CHARLOOKS 2 (FLAGBITS . 32))
+         (CHARLOOKS 8 POINTER)
+         (CHARLOOKS 10 POINTER)
+         (CHARLOOKS 12 POINTER)
+         (CHARLOOKS 14 POINTER)
+         (CHARLOOKS 14 (FLAGBITS . 0)))
+       '16)
 
-(/DECLAREDATATYPE (QUOTE FMTSPEC) (QUOTE (POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER FLAG POINTER POINTER POINTER POINTER POINTER POINTER POINTER FLAG FLAG POINTER)) (QUOTE ((FMTSPEC 0 POINTER) (FMTSPEC 2 POINTER) (FMTSPEC 4 POINTER) (FMTSPEC 6 POINTER) (FMTSPEC 8 POINTER) (FMTSPEC 10 POINTER) (FMTSPEC 12 POINTER) (FMTSPEC 14 POINTER) (FMTSPEC 16 POINTER) (FMTSPEC 18 POINTER) (FMTSPEC 20 POINTER) (FMTSPEC 22 POINTER) (FMTSPEC 24 POINTER) (FMTSPEC 26 POINTER) (FMTSPEC 26 (FLAGBITS . 0)) (FMTSPEC 28 POINTER) (FMTSPEC 30 POINTER) (FMTSPEC 32 POINTER) (FMTSPEC 34 POINTER) (FMTSPEC 36 POINTER) (FMTSPEC 38 POINTER) (FMTSPEC 40 POINTER) (FMTSPEC 40 (FLAGBITS . 0)) (FMTSPEC 40 (FLAGBITS . 16)) (FMTSPEC 42 POINTER))) (QUOTE 44))
+(/DECLAREDATATYPE 'FMTSPEC
+       '(POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER 
+               POINTER POINTER POINTER FLAG POINTER POINTER POINTER POINTER POINTER POINTER POINTER 
+               FLAG FLAG POINTER)
+       '((FMTSPEC 0 POINTER)
+         (FMTSPEC 2 POINTER)
+         (FMTSPEC 4 POINTER)
+         (FMTSPEC 6 POINTER)
+         (FMTSPEC 8 POINTER)
+         (FMTSPEC 10 POINTER)
+         (FMTSPEC 12 POINTER)
+         (FMTSPEC 14 POINTER)
+         (FMTSPEC 16 POINTER)
+         (FMTSPEC 18 POINTER)
+         (FMTSPEC 20 POINTER)
+         (FMTSPEC 22 POINTER)
+         (FMTSPEC 24 POINTER)
+         (FMTSPEC 26 POINTER)
+         (FMTSPEC 26 (FLAGBITS . 0))
+         (FMTSPEC 28 POINTER)
+         (FMTSPEC 30 POINTER)
+         (FMTSPEC 32 POINTER)
+         (FMTSPEC 34 POINTER)
+         (FMTSPEC 36 POINTER)
+         (FMTSPEC 38 POINTER)
+         (FMTSPEC 40 POINTER)
+         (FMTSPEC 40 (FLAGBITS . 0))
+         (FMTSPEC 40 (FLAGBITS . 16))
+         (FMTSPEC 42 POINTER))
+       '44)
 
-(/DECLAREDATATYPE (QUOTE PENDINGTAB) (QUOTE (POINTER POINTER POINTER POINTER FULLXPOINTER POINTER)) (QUOTE ((PENDINGTAB 0 POINTER) (PENDINGTAB 2 POINTER) (PENDINGTAB 4 POINTER) (PENDINGTAB 6 POINTER) (PENDINGTAB 8 FULLXPOINTER) (PENDINGTAB 10 POINTER))) (QUOTE 12))
+(/DECLAREDATATYPE 'PENDINGTAB '(POINTER POINTER POINTER POINTER FULLXPOINTER POINTER)
+       '((PENDINGTAB 0 POINTER)
+         (PENDINGTAB 2 POINTER)
+         (PENDINGTAB 4 POINTER)
+         (PENDINGTAB 6 POINTER)
+         (PENDINGTAB 8 FULLXPOINTER)
+         (PENDINGTAB 10 POINTER))
+       '12)
 (DECLARE%: EVAL@COMPILE DONTCOPY 
 (DECLARE%: EVAL@COMPILE 
 
-(PUTPROPS \SMALLPIN MACRO (OPENLAMBDA (STREAM) (SIGNED (create WORD HIBYTE _ (\BIN STREAM) LOBYTE _ (\BIN STREAM)) BITSPERWORD)))
+(PUTPROPS \SMALLPIN MACRO (OPENLAMBDA (STREAM)
+                                    (SIGNED (create WORD
+                                                   HIBYTE _ (\BIN STREAM)
+                                                   LOBYTE _ (\BIN STREAM))
+                                           BITSPERWORD)))
 
-(PUTPROPS \SMALLPOUT MACRO (OPENLAMBDA (STREAM W) (\BOUT STREAM (LOGAND 255 (LRSH W 8))) (\BOUT STREAM (LOGAND W 255))))
+(PUTPROPS \SMALLPOUT MACRO (OPENLAMBDA (STREAM W)
+                                     (\BOUT STREAM (LOGAND 255 (LRSH W 8)))
+                                     (\BOUT STREAM (LOGAND W 255))))
 
-(PUTPROPS ONOFF MACRO (OPENLAMBDA (VAL) (COND (VAL (QUOTE ON)) (T (QUOTE OFF)))))
+(PUTPROPS ONOFF MACRO [OPENLAMBDA (VAL)
+                                (COND
+                                   (VAL 'ON)
+                                   (T 'OFF])
 )
 )
 
@@ -276,22 +1254,30 @@ Copyright (c) 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1994 by Venue.  All righ
 (DECLARE%: EVAL@COMPILE DONTCOPY 
 (DECLARE%: EVAL@COMPILE
 
-(RECORD MBUTTON NIL (TYPE? (AND (IMAGEOBJP DATUM) (OR (EQ (IMAGEOBJPROP DATUM (QUOTE DISPLAYFN)) (QUOTE MB.DISPLAY)) (EQ (IMAGEOBJPROP DATUM (QUOTE DISPLAYFN)) (QUOTE MB.THREESTATE.DISPLAY)) (EQ (IMAGEOBJPROP DATUM (QUOTE DISPLAYFN)) (QUOTE \TEXTMENU.TOGGLE.DISPLAY)))))
-)
+(RECORD MBUTTON NIL [TYPE? (AND (IMAGEOBJP DATUM)
+                                        (OR (EQ (IMAGEOBJPROP DATUM 'DISPLAYFN)
+                                                'MB.DISPLAY)
+                                            (EQ (IMAGEOBJPROP DATUM 'DISPLAYFN)
+                                                'MB.THREESTATE.DISPLAY)
+                                            (EQ (IMAGEOBJPROP DATUM 'DISPLAYFN)
+                                                '\TEXTMENU.TOGGLE.DISPLAY])
 )
 )
 (DECLARE%: EVAL@COMPILE DONTCOPY 
 (DECLARE%: EVAL@COMPILE
 
-(RECORD NWAYBUTTON NIL (TYPE? (AND (IMAGEOBJP DATUM) (EQ (IMAGEOBJPROP DATUM (QUOTE DISPLAYFN)) (QUOTE MB.NB.DISPLAYFN))))
-)
+(RECORD NWAYBUTTON NIL [TYPE? (AND (IMAGEOBJP DATUM)
+                                           (EQ (IMAGEOBJPROP DATUM 'DISPLAYFN)
+                                               'MB.NB.DISPLAYFN])
 )
 )
 (DECLARE%: EVAL@COMPILE DONTCOPY 
 (DECLARE%: EVAL@COMPILE
 
-(RECORD MARGINBAR (MARL1 MARLN MARR MARTABS MARUNIT MARTABTYPE) (TYPE? (AND (IMAGEOBJP DATUM) (EQ (IMAGEOBJPROP DATUM (QUOTE DISPLAYFN)) (QUOTE MB.MARGINBAR.DISPLAYFN))))
-)
+(RECORD MARGINBAR (MARL1 MARLN MARR MARTABS MARUNIT MARTABTYPE)
+                      [TYPE? (AND (IMAGEOBJP DATUM)
+                                      (EQ (IMAGEOBJPROP DATUM 'DISPLAYFN)
+                                          'MB.MARGINBAR.DISPLAYFN])
 )
 )
 (DECLARE%: EVAL@COMPILE DONTCOPY 
@@ -302,26 +1288,53 @@ Copyright (c) 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1994 by Venue.  All righ
 )
 (DECLARE%: EVAL@COMPILE
 
-(TYPERECORD MB.3STATE ((* ;; "Describes a 3-state menu button.") MBLABEL (* ; "Label for the button on the screen") MBFONT (* ; "Font the label text should appear in") MBCHANGESTATEFN (* ; "Function to call when the button's state changes") MBINITSTATE (* ; "Button's initial state."))
- MBFONT _ (FONTCREATE (QUOTE HELVETICA) 8 (QUOTE BOLD)))
+(TYPERECORD MB.3STATE (
+                           (* ;; "Describes a 3-state menu button.")
 
-(TYPERECORD MB.BUTTON (MBLABEL MBBUTTONEVENTFN MBFONT) MBBUTTONEVENTFN _ (QUOTE MB.DEFAULTBUTTON.FN)
- MBFONT _ (FONTCREATE (QUOTE HELVETICA) 8 (QUOTE BOLD)))
+                           MBLABEL                           (* ; 
+                                                           "Label for the button on the screen")
+                           MBFONT                            (* ; 
+                                                           "Font the label text should appear in")
+                           MBCHANGESTATEFN                   (* ; 
+                                                 "Function to call when the button's state changes")
+                           MBINITSTATE                       (* ; "Button's initial state.")
+                           )
+                          MBFONT _ (FONTCREATE 'HELVETICA 8 'BOLD))
+
+(TYPERECORD MB.BUTTON (MBLABEL MBBUTTONEVENTFN MBFONT)
+                          MBBUTTONEVENTFN _ 'MB.DEFAULTBUTTON.FN MBFONT _ (FONTCREATE 'HELVETICA 8
+                                                                                 'BOLD))
 
 (TYPERECORD MB.INSERT (MBINITENTRY))
 
 (TYPERECORD MB.MARGINBAR (ignoredfield))
 
-(TYPERECORD MB.NWAY (MBBUTTONS MBFONT MBCHANGESTATEFN MBINITSTATE MBMAXITEMSPERLINE) MBFONT _ (FONTCREATE (QUOTE HELVETICA) 8 (QUOTE BOLD))
-)
+(TYPERECORD MB.NWAY (MBBUTTONS MBFONT MBCHANGESTATEFN MBINITSTATE MBMAXITEMSPERLINE)
+                        MBFONT _ (FONTCREATE 'HELVETICA 8 'BOLD))
 
 (TYPERECORD MB.TEXT (MBSTRING MBFONT))
 
-(TYPERECORD MB.TOGGLE (MBTEXT MBFONT MBCHANGESTATEFN MBINITSTATE) MBFONT _ (FONTCREATE (QUOTE HELVETICA) 8 (QUOTE BOLD))
-)
+(TYPERECORD MB.TOGGLE (MBTEXT MBFONT MBCHANGESTATEFN MBINITSTATE)
+                          MBFONT _ (FONTCREATE 'HELVETICA 8 'BOLD))
 )
 
-(DEFMACRO WITHOUT-UPDATES (TEXTOBJ SCRATCHSEL &BODY BODY) (* ;; "For TEdit windows, run BODY without updating the edit window for TEXTOBJ.  This is useful if you're making a log of changes to a document at one time, where the changes are in essence atomic, and you don't need to see intermediate results.  It's also a good bit faster than constant updating.") (* ;; "TEXTOBJ is the TEXTOBJ for the document you'll be modifying.") (* ;; "SCRATCHSEL should be the scratch selection (often used in this work)") (BQUOTE (LET ((OLD-UNWIND-FLAG (FETCH (TEXTOBJ TXTDON'TUPDATE) OF (\, TEXTOBJ)))) (CL:UNWIND-PROTECT (PROGN (replace (TEXTOBJ TXTDON'TUPDATE) of (\, TEXTOBJ) with T) (\,@ BODY)) (\SHOWSEL (\, SCRATCHSEL) NIL NIL) (replace SET of (\, SCRATCHSEL) with NIL) (\TEDIT.MARK.LINES.DIRTY (\, TEXTOBJ) 1 (fetch (TEXTOBJ TEXTLEN) of (\, TEXTOBJ))) (replace (TEXTOBJ TXTDON'TUPDATE) of (\, TEXTOBJ) with OLD-UNWIND-FLAG) (TEDIT.UPDATE.SCREEN (\, TEXTOBJ))))))
+(DEFMACRO WITHOUT-UPDATES (TEXTOBJ SCRATCHSEL &BODY BODY)
+
+   (* ;; "For TEdit windows, run BODY without updating the edit window for TEXTOBJ.  This is useful if you're making a log of changes to a document at one time, where the changes are in essence atomic, and you don't need to see intermediate results.  It's also a good bit faster than constant updating.")
+
+   (* ;; "TEXTOBJ is the TEXTOBJ for the document you'll be modifying.")
+
+   (* ;; "SCRATCHSEL should be the scratch selection (often used in this work)")
+
+   `[LET [(OLD-UNWIND-FLAG (FETCH (TEXTOBJ TXTDON'TUPDATE) OF ,TEXTOBJ]
+         (CL:UNWIND-PROTECT
+             (PROGN (replace (TEXTOBJ TXTDON'TUPDATE) of ,TEXTOBJ with T)
+                    ,@BODY)
+             (\SHOWSEL ,SCRATCHSEL NIL NIL)
+             (replace SET of ,SCRATCHSEL with NIL)
+             (\TEDIT.MARK.LINES.DIRTY ,TEXTOBJ 1 (fetch (TEXTOBJ TEXTLEN) of ,TEXTOBJ))
+             (replace (TEXTOBJ TXTDON'TUPDATE) of ,TEXTOBJ with OLD-UNWIND-FLAG)
+             (TEDIT.UPDATE.SCREEN ,TEXTOBJ))])
 
 
 
@@ -329,8 +1342,25 @@ Copyright (c) 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1994 by Venue.  All righ
 
 (DECLARE%: EVAL@COMPILE
 
-(RECORD TEDITHISTORYEVENT ((* ;; "Describes one event on the TEdit edit history list.") THACTION (* ; "A LITATOM, specifying what the event was") THPOINT (* ; "Was the selection to the left or right?") THLEN (* ; "The # of chars involved") THCH# (* ; "The starting ch#") THFIRSTPIECE (* ; "First piece involved") THOLDINFO (* ; "Old info, for undo") THAUXINFO (* ; "Auxiliary info about the event, primarily for redo") THTEXTOBJ (* ;; "Place to remember a second textobj, for those like MOVE who need to remember both a source and a destination."))
- THPOINT _ (QUOTE LEFT))
+(RECORD TEDITHISTORYEVENT (
+                               (* ;; "Describes one event on the TEdit edit history list.")
+
+                               THACTION                      (* ; 
+                                                         "A LITATOM, specifying what the event was")
+                               THPOINT                       (* ; 
+                                                          "Was the selection to the left or right?")
+                               THLEN                         (* ; "The # of chars involved")
+                               THCH#                         (* ; "The starting ch#")
+                               THFIRSTPIECE                  (* ; "First piece involved")
+                               THOLDINFO                     (* ; "Old info, for undo")
+                               THAUXINFO                     (* ; 
+                                               "Auxiliary info about the event, primarily for redo")
+                               THTEXTOBJ
+
+                               (* ;; "Place to remember a second textobj, for those like MOVE who need to remember both a source and a destination.")
+
+                               )
+                              THPOINT _ 'LEFT)
 )
 
 
@@ -355,7 +1385,13 @@ Copyright (c) 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1994 by Venue.  All righ
 (RPAQQ \PieceDescriptorSAFEOBJECT 6)
 
 
-(CONSTANTS (\PieceDescriptorLOOKS 0) (\PieceDescriptorOBJECT 1) (\PieceDescriptorPARA 2) (\PieceDescriptorPAGEFRAME 3) (\PieceDescriptorCHARLOOKSLIST 4) (\PieceDescriptorPARALOOKSLIST 5) (\PieceDescriptorSAFEOBJECT 6))
+(CONSTANTS (\PieceDescriptorLOOKS 0)
+       (\PieceDescriptorOBJECT 1)
+       (\PieceDescriptorPARA 2)
+       (\PieceDescriptorPAGEFRAME 3)
+       (\PieceDescriptorCHARLOOKSLIST 4)
+       (\PieceDescriptorPARALOOKSLIST 5)
+       (\PieceDescriptorSAFEOBJECT 6))
 )
 )
 
@@ -366,17 +1402,40 @@ Copyright (c) 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1994 by Venue.  All righ
 (DECLARE%: EVAL@COMPILE DONTCOPY 
 (DECLARE%: EVAL@COMPILE 
 
-(PUTPROPS \INSERT\TTY\BUFFER MACRO (NIL (\TEDIT.INSERT.TTY.BUFFER ISCRSTRING IPASSSTRING TEXTOBJ SEL)))
+(PUTPROPS \INSERT\TTY\BUFFER MACRO (NIL (\TEDIT.INSERT.TTY.BUFFER ISCRSTRING IPASSSTRING 
+                                                       TEXTOBJ SEL)))
 
-(PUTPROPS \TEDIT.MOUSESTATE MACRO (BUTTON (* Test to see if only the specified mouse button is down. DOES NOT call GETMOUSESTATE, so the mouse-button info is the same as the last time it WAS called.) (SELECTQ (CAR BUTTON) (LEFT (QUOTE (IEQP LASTMOUSEBUTTONS 4))) (MIDDLE (QUOTE (IEQP LASTMOUSEBUTTONS 1))) (RIGHT (QUOTE (IEQP LASTMOUSEBUTTONS 2))) (SHOULDNT))))
+(PUTPROPS \TEDIT.MOUSESTATE MACRO (BUTTON 
 
-(PUTPROPS \TEDIT.CHECK MACRO (ARGS (COND ((AND (BOUNDP (QUOTE CHECK)) CHECK) (CONS (QUOTE PROGN) (for I in ARGS as J on ARGS when (NOT (STRINGP I)) collect (LIST (QUOTE OR) I (LIST (QUOTE HELP) "TEdit consistency-check failure [RETURN to continue]:  " (COND ((STRINGP (CADR J))) (T (KWOTE I)))))))) (T (CONS COMMENTFLG ARGS)))))
+         (* Test to see if only the specified mouse button is down.
+       DOES NOT call GETMOUSESTATE, so the mouse-button info is the same as the last 
+       time it WAS called.)
+
+                                                 (SELECTQ (CAR BUTTON)
+                                                     (LEFT '(IEQP LASTMOUSEBUTTONS 4))
+                                                     (MIDDLE '(IEQP LASTMOUSEBUTTONS 1))
+                                                     (RIGHT '(IEQP LASTMOUSEBUTTONS 2))
+                                                     (SHOULDNT))))
+
+(PUTPROPS \TEDIT.CHECK MACRO
+          [ARGS (COND
+                   [(AND (BOUNDP 'CHECK)
+                         CHECK)
+                    (CONS 'PROGN (for I in ARGS as J on ARGS
+                                    when (NOT (STRINGP I))
+                                    collect (LIST 'OR I (LIST 'HELP 
+                                            "TEdit consistency-check failure [RETURN to continue]:  "
+                                                                  (COND
+                                                                     ((STRINGP (CADR J)))
+                                                                     (T (KWOTE I]
+                   (T (CONS COMMENTFLG ARGS])
 )
 )
 (DECLARE%: EVAL@COMPILE DONTCOPY 
 (DECLARE%: EVAL@COMPILE
 
-(ACCESSFNS TEDITTERMCODE ((TTCLASS (LOGAND DATUM 224)) (TTDECODE (LOGAND DATUM 31))))
+(ACCESSFNS TEDITTERMCODE ((TTCLASS (LOGAND DATUM 224))
+                              (TTDECODE (LOGAND DATUM 31))))
 )
 )
 (DECLARE%: EVAL@COMPILE DONTCOPY 
@@ -409,7 +1468,19 @@ Copyright (c) 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1994 by Venue.  All righ
 (RPAQQ WHITESPACE.TTC 22)
 
 
-(CONSTANTS (NONE.TTC 0) (CHARDELETE.TTC 1) (WORDDELETE.TTC 2) (DELETE.TTC 3) (FUNCTIONCALL.TTC 4) (REDO.TTC 5) (UNDO.TTC 6) (CMD.TTC 7) (NEXT.TTC 8) (EXPAND.TTC 9) (PUNCT.TTC 20) (TEXT.TTC 21) (WHITESPACE.TTC 22))
+(CONSTANTS (NONE.TTC 0)
+       (CHARDELETE.TTC 1)
+       (WORDDELETE.TTC 2)
+       (DELETE.TTC 3)
+       (FUNCTIONCALL.TTC 4)
+       (REDO.TTC 5)
+       (UNDO.TTC 6)
+       (CMD.TTC 7)
+       (NEXT.TTC 8)
+       (EXPAND.TTC 9)
+       (PUNCT.TTC 20)
+       (TEXT.TTC 21)
+       (WHITESPACE.TTC 22))
 )
 )
 (DECLARE%: EVAL@COMPILE DONTCOPY 
@@ -424,7 +1495,10 @@ Copyright (c) 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1994 by Venue.  All righ
 (RPAQQ FIGSPACE 154)
 
 
-(CONSTANTS (MSPACE 153) (NSPACE 152) (THINSPACE 159) (FIGSPACE 154))
+(CONSTANTS (MSPACE 153)
+       (NSPACE 152)
+       (THINSPACE 159)
+       (FIGSPACE 154))
 )
 )
 
@@ -435,15 +1509,73 @@ Copyright (c) 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1994 by Venue.  All righ
 (DECLARE%: EVAL@COMPILE DONTCOPY 
 (DECLARE%: EVAL@COMPILE
 
-(DATATYPE TEDITCARET (TCNOWTIME (* Used to hold the current time, when checking to see if a transition is due) TCTHENTIME (* Time when the next transition is to take place) TCFORCEDDOWN (* TCFORCEDOWN = T means (Make the caret visible at the next call to \EDIT.FLIPCARET.)) TCUP (* TCUP = T => The caret is NOT VISIBLE. Used to track the current state of the caret) TCCARETDS (* The display stream that the caret appears in) TCCURSORBM (* The CURSOR representing the caret) TCCARETRATE (* %# of MSEC between caret up/down transitions) TCFORCEUP (* T => The caret is not allowed to become visible. Used to keep the caret up during screen updates) TCCARETX (* X position in the window that the caret appears at) TCCARETY (* Y position in the window where the caret appears) TCCARET (* A lisp CARET to be flashed (eventually)))
- TCNOWTIME _ (CREATECELL \FIXP) TCTHENTIME _ (CREATECELL \FIXP) TCCURSORBM _ BXCARET TCCARETRATE _ \CARETRATE
- TCUP _ T TCCARET _ (\CARET.CREATE BXCARET))
+(DATATYPE TEDITCARET (TCNOWTIME 
+
+         (* Used to hold the current time, when checking to see if a transition is due)
+
+                                TCTHENTIME                   (* Time when the next transition is 
+                                                           to take place)
+                                TCFORCEDDOWN                 (* TCFORCEDOWN = T means
+                                                           (Make the caret visible at the next 
+                                                           call to \EDIT.FLIPCARET.))
+                                TCUP
+
+         (* TCUP = T => The caret is NOT VISIBLE.
+       Used to track the current state of the caret)
+
+                                TCCARETDS                    (* The display stream that the caret 
+                                                           appears in)
+                                TCCURSORBM                   (* The CURSOR representing the caret)
+                                TCCARETRATE                  (* %# of MSEC between caret up/down 
+                                                           transitions)
+                                TCFORCEUP
+
+         (* T => The caret is not allowed to become visible.
+       Used to keep the caret up during screen updates)
+
+                                TCCARETX                     (* X position in the window that the 
+                                                           caret appears at)
+                                TCCARETY                     (* Y position in the window where 
+                                                           the caret appears)
+                                TCCARET                      (* A lisp CARET to be flashed
+                                                           (eventually))
+                                )
+                         TCNOWTIME _ (CREATECELL \FIXP)
+                         TCTHENTIME _ (CREATECELL \FIXP)
+                         TCCURSORBM _ BXCARET TCCARETRATE _ \CARETRATE TCUP _ T TCCARET _
+                         (\CARET.CREATE BXCARET))
 )
 
-(/DECLAREDATATYPE (QUOTE TEDITCARET) (QUOTE (POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER)) (QUOTE ((TEDITCARET 0 POINTER) (TEDITCARET 2 POINTER) (TEDITCARET 4 POINTER) (TEDITCARET 6 POINTER) (TEDITCARET 8 POINTER) (TEDITCARET 10 POINTER) (TEDITCARET 12 POINTER) (TEDITCARET 14 POINTER) (TEDITCARET 16 POINTER) (TEDITCARET 18 POINTER) (TEDITCARET 20 POINTER))) (QUOTE 22))
+(/DECLAREDATATYPE 'TEDITCARET '(POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER 
+                                      POINTER POINTER POINTER)
+       '((TEDITCARET 0 POINTER)
+         (TEDITCARET 2 POINTER)
+         (TEDITCARET 4 POINTER)
+         (TEDITCARET 6 POINTER)
+         (TEDITCARET 8 POINTER)
+         (TEDITCARET 10 POINTER)
+         (TEDITCARET 12 POINTER)
+         (TEDITCARET 14 POINTER)
+         (TEDITCARET 16 POINTER)
+         (TEDITCARET 18 POINTER)
+         (TEDITCARET 20 POINTER))
+       '22)
 )
 
-(/DECLAREDATATYPE (QUOTE TEDITCARET) (QUOTE (POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER)) (QUOTE ((TEDITCARET 0 POINTER) (TEDITCARET 2 POINTER) (TEDITCARET 4 POINTER) (TEDITCARET 6 POINTER) (TEDITCARET 8 POINTER) (TEDITCARET 10 POINTER) (TEDITCARET 12 POINTER) (TEDITCARET 14 POINTER) (TEDITCARET 16 POINTER) (TEDITCARET 18 POINTER) (TEDITCARET 20 POINTER))) (QUOTE 22))
+(/DECLAREDATATYPE 'TEDITCARET '(POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER 
+                                      POINTER POINTER POINTER)
+       '((TEDITCARET 0 POINTER)
+         (TEDITCARET 2 POINTER)
+         (TEDITCARET 4 POINTER)
+         (TEDITCARET 6 POINTER)
+         (TEDITCARET 8 POINTER)
+         (TEDITCARET 10 POINTER)
+         (TEDITCARET 12 POINTER)
+         (TEDITCARET 14 POINTER)
+         (TEDITCARET 16 POINTER)
+         (TEDITCARET 18 POINTER)
+         (TEDITCARET 20 POINTER))
+       '22)
 
 
 
@@ -451,11 +1583,33 @@ Copyright (c) 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1994 by Venue.  All righ
 
 (DECLARE%: EVAL@COMPILE
 
-(DATATYPE PCTNODE (CHNUM (* ; "Character #of piece in this node.") PCE (* ; "PIECE ") LO (* ; "Subtree these nodes' ch#are less than this node.") HI (* ; " Subtree these nodes' ch#are more than this node.") BF (* ; "Balance factor.") (* ; "1: Right(HI) Subtree is higher than left(lo) subtree.") (* ; "0: Right subtree and left subtree are same height") (* ; "-1: Right(HI) Subtree is shorter than left(lo) subtree.") RANK (* ; "(# of nodes in left subtree) +1"))
- CHNUM _ 0 BF _ 0 RANK _ 1)
+(DATATYPE PCTNODE (CHNUM                                 (* ; 
+                                                           "Character #of piece in this node.")
+                             PCE                             (* ; "PIECE ")
+                             LO                              (* ; 
+                                                 "Subtree these nodes' ch#are less than this node.")
+                             HI                              (* ; 
+                                                " Subtree these nodes' ch#are more than this node.")
+                             BF                              (* ; "Balance factor.")
+                                                             (* ; 
+                                            "1: Right(HI) Subtree is higher than left(lo) subtree.")
+                                                             (* ; 
+                                                "0: Right subtree and left subtree are same height")
+                                                             (* ; 
+                                          "-1: Right(HI) Subtree is shorter than left(lo) subtree.")
+                             RANK                            (* ; "(# of nodes in left subtree) +1")
+                             )
+                      CHNUM _ 0 BF _ 0 RANK _ 1)
 )
 
-(/DECLAREDATATYPE (QUOTE PCTNODE) (QUOTE (POINTER POINTER POINTER POINTER POINTER POINTER)) (QUOTE ((PCTNODE 0 POINTER) (PCTNODE 2 POINTER) (PCTNODE 4 POINTER) (PCTNODE 6 POINTER) (PCTNODE 8 POINTER) (PCTNODE 10 POINTER))) (QUOTE 12))
+(/DECLAREDATATYPE 'PCTNODE '(POINTER POINTER POINTER POINTER POINTER POINTER)
+       '((PCTNODE 0 POINTER)
+         (PCTNODE 2 POINTER)
+         (PCTNODE 4 POINTER)
+         (PCTNODE 6 POINTER)
+         (PCTNODE 8 POINTER)
+         (PCTNODE 10 POINTER))
+       '12)
 
 
 
@@ -484,10 +1638,15 @@ Copyright (c) 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1994 by Venue.  All righ
 (RPAQQ NEWCHAR-IF-SPLIT.LB 32)
 
 
-(CONSTANTS (NOTBEFORE.LB 1) (NOTAFTER.LB 2) (BEFORE.LB 4) (AFTER.LB 8) (DISAPPEAR-IF-NOT-SPLIT.LB 16) (NEWCHAR-IF-SPLIT.LB 32))
+(CONSTANTS (NOTBEFORE.LB 1)
+       (NOTAFTER.LB 2)
+       (BEFORE.LB 4)
+       (AFTER.LB 8)
+       (DISAPPEAR-IF-NOT-SPLIT.LB 16)
+       (NEWCHAR-IF-SPLIT.LB 32))
 )
 )
-(PUTPROPS TEDITDCL COPYRIGHT ("Venue" 1986 1987 1988 1989 1990 1991 1993 1994))
+(PUTPROPS TEDITDCL COPYRIGHT ("Venue" 1986 1987 1988 1989 1990 1991 1993 1994 2021))
 (DECLARE%: DONTCOPY
   (FILEMAP (NIL)))
 STOP
diff --git a/library/TEDITDCL.LCOM b/library/TEDITDCL.LCOM
index 57a88d1a..a4dd4df2 100644
--- a/library/TEDITDCL.LCOM
+++ b/library/TEDITDCL.LCOM
@@ -1 +1,459 @@
-(DEFINE-FILE-INFO READTABLE "INTERLISP" PACKAGE "INTERLISP")
(FILECREATED "18-May-2018 09:17:04" ("compiled on " 
{DSK}<USERS>KAPLAN>LOCAL>MEDLEY3.5>LISPCORE>LIBRARY>TEDITDCL.;1) " 9-Apr-2000 18:01:32" bcompl'd in 
"Medley 3.5 Full Sysout 14-May-2018 ..." dated "14-May-2018 23:31:09")
(FILECREATED "25-Aug-94 10:53:00" {DSK}<king>export>lispcore>library>TEDITDCL.;2 49062 previous date%:
 "25-Aug-94 10:38:37" {DSK}<king>export>lispcore>library>TEDITDCL.;1)
(PRETTYCOMPRINT TEDITDCLCOMS)
(RPAQQ TEDITDCLCOMS ((* ;;; 
"This file is the collected record declarations and compile-time necessities for TEDIT.") (* ;; 
"FROM TEDIT") (DECLARE%: EVAL@COMPILE DONTCOPY (CONSTANTS (\SCRATCHLEN 64))) (* ;; 
"FROM TEDITSELECTION") (RECORDS SELECTION) (DECLARE%: EVAL@COMPILE DONTCOPY (CONSTANTS (COPYSELSHADE 
30583) (COPYLOOKSSELSHADE 30583) (EDITMOVESHADE -1) (EDITGRAY 32800))) (VARS TEDITFILES) (* ;; 
"FROM TEDITSCREEN") (RECORDS THISLINE LINEDESCRIPTOR LINECACHE) (DECLARE%: EVAL@COMPILE DONTCOPY (
CONSTANTS (LMInvisibleRun 401) (LMLooksChange 400))) (* ;; "FROM TEXTOFD") (RECORDS EDITMARK) (RECORDS
 PIECE TEXTOBJ TEXTIMAGEDATA TEXTSTREAM) (OPTIMIZERS TEXTPROP) (COMS (* ;; 
"Private data structures and constants FROM TEXTOFD") (DECLARE%: EVAL@COMPILE DONTCOPY (CONSTANTS (
\PCTBFreePieces 0) (\PCTBLastPieceOffset 1) (\FirstPieceOffset 2) (\SecondPieceOffset 4) (
\EltsPerPiece 2)) (MACROS \EDITELT \GETCH \GETCHB \EDITSETA \WORDSETA) (GLOBALVARS \TEXTIMAGEOPS 
\TEXTOFD \TEXTFDEV))) (* ;;; "FROM TEDITPAGE") (RECORDS PAGEFORMATTINGSTATE PAGEREGION) (DECLARE%: 
EVAL@COMPILE DONTCOPY (RECORDS TEDITPAPERSIZE) (FUNCTIONS \NEW-COLUMN-START \FIRST-COLUMN-START)) (* 
;; "FROM TEDITFIND") (DECLARE%: EVAL@COMPILE DONTCOPY (CONSTANTS (\AlphaNumericFlag 256) (\AlphaFlag 
512) (\OneCharPattern 1024) (\AnyStringPattern 1025) (\OneAlphaPattern 1026) (\AnyAlphaPattern 1027) (
\OneNonAlphaPattern 1028) (\AnyNonAlphaPattern 1029) (\LeftBracketPattern 1030) (\RightBracketPattern 
1031) (\SpecialPattern 1024))) (* ;; " FROM TEDITLOOKS") (RECORDS CHARLOOKS FMTSPEC PENDINGTAB) (
DECLARE%: EVAL@COMPILE DONTCOPY (MACROS \SMALLPIN \SMALLPOUT ONOFF)) (* ;; "FROM TEDITMENU") (
DECLARE%: EVAL@COMPILE DONTCOPY (RECORDS MBUTTON)) (INITRECORDS MBUTTON) (DECLARE%: EVAL@COMPILE 
DONTCOPY (RECORDS NWAYBUTTON)) (INITRECORDS NWAYBUTTON) (DECLARE%: EVAL@COMPILE DONTCOPY (RECORDS 
MARGINBAR)) (INITRECORDS MARGINBAR) (DECLARE%: EVAL@COMPILE DONTCOPY (RECORDS TAB)) (RECORDS MB.3STATE
 MB.BUTTON MB.INSERT MB.MARGINBAR MB.NWAY MB.TEXT MB.TOGGLE) (FUNCTIONS WITHOUT-UPDATES) (* ;; 
"FROM TEDITHISTORY") (RECORDS TEDITHISTORYEVENT) (* ;; "FROM TEDITFILE") (DECLARE%: EVAL@COMPILE 
DONTCOPY (CONSTANTS (\PieceDescriptorLOOKS 0) (\PieceDescriptorOBJECT 1) (\PieceDescriptorPARA 2) (
\PieceDescriptorPAGEFRAME 3) (\PieceDescriptorCHARLOOKSLIST 4) (\PieceDescriptorPARALOOKSLIST 5) (
\PieceDescriptorSAFEOBJECT 6))) (* ;; "FROM TEDITCOMMAND") (DECLARE%: EVAL@COMPILE DONTCOPY (MACROS 
\INSERT\TTY\BUFFER \TEDIT.MOUSESTATE \TEDIT.CHECK)) (DECLARE%: EVAL@COMPILE DONTCOPY (RECORDS 
TEDITTERMCODE)) (DECLARE%: EVAL@COMPILE DONTCOPY (CONSTANTS (NONE.TTC 0) (CHARDELETE.TTC 1) (
WORDDELETE.TTC 2) (DELETE.TTC 3) (FUNCTIONCALL.TTC 4) (REDO.TTC 5) (UNDO.TTC 6) (CMD.TTC 7) (NEXT.TTC 
8) (EXPAND.TTC 9) (PUNCT.TTC 20) (TEXT.TTC 21) (WHITESPACE.TTC 22))) (DECLARE%: EVAL@COMPILE DONTCOPY 
(CONSTANTS (MSPACE 153) (NSPACE 152) (THINSPACE 159) (FIGSPACE 154))) (* ;; "FROM TEDITWINDOW") (
DECLARE%: EVAL@COMPILE DONTCOPY (RECORDS TEDITCARET)) (INITRECORDS TEDITCARET) (* ;; 
"FROM PCTREE added by Nakamura") (RECORDS PCTNODE) (* ;;; "THE END") (COMS (* ;; 
"Bits in the CHARTABLE that control line breaking, and what happens when a line is broken on this character "
) (DECLARE%: EVAL@COMPILE DONTCOPY (CONSTANTS (NOTBEFORE.LB 1) (* ; 
"Must not break before this character (e.g. Japanese right-paren)") (NOTAFTER.LB 2) (* ; 
"Must not break after this character (e.g. Japanese open-quote)") (BEFORE.LB 4) (* ; 
"OK to break before this character, provided it's OK to break after the prior char (true of most non-white-space)"
) (AFTER.LB 8) (* ; 
"OK to break after this char, if it's OK to break before the next one (true of most white space)") (
DISAPPEAR-IF-NOT-SPLIT.LB 16) (* ; 
"This character shouldn't be rendered if it isn't the last char on the line (non-breaking hyphen has this)"
) (NEWCHAR-IF-SPLIT.LB 32) (* ; 
"Look this char up in *TEDIT-SPLITCHAR-HASH* if this IS the last character on a line, and render it as the char we found."
))))))
(DATATYPE SELECTION ((* ;; 
"Description of a piece of selected text for TEdit.  Text has to be selected before it can be operated on by the user."
) Y0 (* ; "Y value of topmost line of selection") X0 (* ; "X value of left edge of selection") DX (* ;
 "Width of the selection, if it's on one line.") CH# (* ; "CH# of the first selected character") XLIM 
(* ; "X value of right edge of last selected character") CHLIM (* ; 
"CH# of the last character in the selection") DCH (* ; 
"# of characters selected (can be zero, for point selection.)") L1 (* ; 
"-> line descriptor for the line where the first selected character is") LN (* ; 
"-> line descriptor for the line which contains the end of the selection") YLIM (* ; 
"Y value of the bottom of the line that ends the selection") POINT (* ; 
"Which end should the caret appear at?  (LEFT or RIGHT)") (SET FLAG) (* ; 
"T if this selection is real;  NIL if not") (\TEXTOBJ FULLXPOINTER) (* ; 
"TEXTOBJ that describes the selected text") SELKIND (* ; 
"What kind of selection?  CHAR or WORD or LINE or PARA") HOW (* ; 
"SHADE used to highlight this selection") HOWHEIGHT (* ; 
"Height of the highlight (1 usually, full line for delete selection...)") (HASCARET FLAG) (* ; 
"T if there should be a caret for this selection") SELOBJ (* ; 
"If this selection is inside an object, which object?") (ONFLG FLAG) (* ; 
"T if the selection is highlighted on the screen, else NIL") SELOBJINFO (* ; 
"A Place for the selected object to put info about selection inside itself.")) SET _ NIL HOW _ 
BLACKSHADE HOWHEIGHT _ 1 HASCARET _ T Y0 _ 0 X0 _ 0 POINT _ (QUOTE LEFT) L1 _ (LIST NIL) LN _ (LIST 
NIL))
(/DECLAREDATATYPE (QUOTE SELECTION) (QUOTE (POINTER POINTER POINTER POINTER POINTER POINTER POINTER 
POINTER POINTER POINTER POINTER FLAG FULLXPOINTER POINTER POINTER POINTER FLAG POINTER FLAG POINTER)) 
(QUOTE ((SELECTION 0 POINTER) (SELECTION 2 POINTER) (SELECTION 4 POINTER) (SELECTION 6 POINTER) (
SELECTION 8 POINTER) (SELECTION 10 POINTER) (SELECTION 12 POINTER) (SELECTION 14 POINTER) (SELECTION 
16 POINTER) (SELECTION 18 POINTER) (SELECTION 20 POINTER) (SELECTION 20 (FLAGBITS . 0)) (SELECTION 22 
FULLXPOINTER) (SELECTION 24 POINTER) (SELECTION 26 POINTER) (SELECTION 28 POINTER) (SELECTION 28 (
FLAGBITS . 0)) (SELECTION 30 POINTER) (SELECTION 30 (FLAGBITS . 0)) (SELECTION 32 POINTER))) (QUOTE 34
))
(RPAQQ TEDITFILES (PCTREE TEXTOFD TEDIT TEDITABBREV TEDITCOMMAND TEDITDCL TEDITFILE TEDITFIND 
TEDITFNKEYS TEDITHCPY TEDITHISTORY TEDITLOOKS TEDITMENU TEDITPAGE TEDITSCREEN TEDITSELECTION 
TEDITWINDOW))
(DATATYPE THISLINE ((* ;; 
"Cache for line-related character location info, for selection and line-display code to use.") (DESC 
FULLXPOINTER) (* ; "Line descriptor for the line this describes now") LEN (* ; 
"Length of the line in characters") CHARS (* ;; 
"Array of character codes (or objects) on the line (charcode of 400 => dummy entry for looks change--go get next entry in LOOKS)"
) WIDTHS (* ; "Array of each character's width in points") LOOKS (* ; 
"Array of any looks changes within the line.  LOOKS (0) = starting character looks for the line") 
TLSPACEFACTOR (* ; "The SPACEFACTOR to be used in printing this line") TLFIRSTSPACE (* ; 
"The first space to which SPACEFACTOR is to apply.  This is used so that spaces to the left of a TAB have their default width."
)) LEN _ 0 CHARS _ (ARRAY 512 (QUOTE POINTER) 0 0) WIDTHS _ (ARRAY 512 (QUOTE POINTER) 0 0) LOOKS _ (
ARRAY 512 (QUOTE POINTER) NIL 0) TLFIRSTSPACE _ 0)
(DATATYPE LINEDESCRIPTOR ((* ;; 
"Description of a single line of formatted text, either on the display or for a printed page.") YBOT (
* ; "Y value for the bottom of the line (below the descent)") YBASE (* ; 
"Yvalue for the base line the characters sit on") LEFTMARGIN (* ; "Left margin, in screen points") 
RIGHTMARGIN (* ; "Right margin, in screen points") LXLIM (* ; 
"X value of right edge of rightmost character on the line (may exceed right margin, if char is a space.)"
) SPACELEFT (* ; "Space left on the line, ignoring trailing blanks & CRs.") LHEIGHT (* ; 
"Total height of hte line, Ascent+Descent.") ASCENT (* ; "Ascent of the line above YBASE") DESCENT (* 
; "How far line descends below YBASE") LTRUEDESCENT (* ; 
"The TRUE DESCENT for this line, unadjusted for line leading.") LTRUEASCENT (* ; 
"The TRUE ASCENT for this line, unadjusted for pre-paragraph leading.") CHAR1 (* ; 
"CH# of the first character on the line.") CHARLIM (* ; "CH# of the last character on the line") 
CHARTOP (* ; "CH# of the character which forced the line break (may exceed CHARLIM)") NEXTLINE (* ; 
"Next line chain pointer") (PREVLINE FULLXPOINTER) (* ; "Previous line chain pointer") LMARK (* ; 
"One of SOLID, GREY, NIL.  Tells what kind of special-line marker should be put in the left margin for this paragraph.  (For hardcopy, can also be an indicator for special processing?)"
) LTEXTOBJ (* ; 
"A cached TEXTOBJ that this line took its text from.  Used in hardcopy to disambiguate when chno's should be updated..."
) CACHE (* ; 
"A cached THISLINE, for keeping hardcopy info around while we crunch with the line descriptors to make things fit."
) LDOBJ (* ; "The object which lies behind this line of text, for updating, etc.") LFMTSPEC (* ; 
"The format spec for this line's paragraph (eventually)") (DIRTY FLAG) (* ; 
"T if this line has changed since it was last formatted.") (CR\END FLAG) (* ; 
"T if this line ends with a CR.") (DELETED FLAG) (* ; 
"T if this line has been completely deleted since it was last formatted or displayed.  (Used by deletion routines to detect garbage lines)"
) (LHASPROT FLAG) (* ; "This line contains protected text.") (LHASTABS FLAG) (* ; 
"If this line has a tab in it, this is the line-relative ch# of the final tab.  This is to let us punt properly with tabs in a line."
) (1STLN FLAG) (* ; "This line is the first line in a paragraph") (LSTLN FLAG) (* ; 
"This is the last line in a paragraph")) CHARLIM _ 1000000 NEXTLINE _ NIL PREVLINE _ NIL DIRTY _ NIL 
YBOT _ 0 YBASE _ 0 LEFTMARGIN _ 0 DELETED _ NIL)
(DATATYPE LINECACHE ((* ;; "Image cache for display lines.") LCBITMAP (* ; 
"The bitmap that will be used by this instance of the cache") (LCNEXTCACHE FULLXPOINTER) (* ; 
"The next cache in the chain, for screen updates.")))
(/DECLAREDATATYPE (QUOTE THISLINE) (QUOTE (FULLXPOINTER POINTER POINTER POINTER POINTER POINTER 
POINTER)) (QUOTE ((THISLINE 0 FULLXPOINTER) (THISLINE 2 POINTER) (THISLINE 4 POINTER) (THISLINE 6 
POINTER) (THISLINE 8 POINTER) (THISLINE 10 POINTER) (THISLINE 12 POINTER))) (QUOTE 14))
(/DECLAREDATATYPE (QUOTE LINEDESCRIPTOR) (QUOTE (POINTER POINTER POINTER POINTER POINTER POINTER 
POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER FULLXPOINTER POINTER POINTER 
POINTER POINTER POINTER FLAG FLAG FLAG FLAG FLAG FLAG FLAG)) (QUOTE ((LINEDESCRIPTOR 0 POINTER) (
LINEDESCRIPTOR 2 POINTER) (LINEDESCRIPTOR 4 POINTER) (LINEDESCRIPTOR 6 POINTER) (LINEDESCRIPTOR 8 
POINTER) (LINEDESCRIPTOR 10 POINTER) (LINEDESCRIPTOR 12 POINTER) (LINEDESCRIPTOR 14 POINTER) (
LINEDESCRIPTOR 16 POINTER) (LINEDESCRIPTOR 18 POINTER) (LINEDESCRIPTOR 20 POINTER) (LINEDESCRIPTOR 22 
POINTER) (LINEDESCRIPTOR 24 POINTER) (LINEDESCRIPTOR 26 POINTER) (LINEDESCRIPTOR 28 POINTER) (
LINEDESCRIPTOR 30 FULLXPOINTER) (LINEDESCRIPTOR 32 POINTER) (LINEDESCRIPTOR 34 POINTER) (
LINEDESCRIPTOR 36 POINTER) (LINEDESCRIPTOR 38 POINTER) (LINEDESCRIPTOR 40 POINTER) (LINEDESCRIPTOR 40 
(FLAGBITS . 0)) (LINEDESCRIPTOR 40 (FLAGBITS . 16)) (LINEDESCRIPTOR 40 (FLAGBITS . 32)) (
LINEDESCRIPTOR 40 (FLAGBITS . 48)) (LINEDESCRIPTOR 38 (FLAGBITS . 0)) (LINEDESCRIPTOR 38 (FLAGBITS . 
16)) (LINEDESCRIPTOR 38 (FLAGBITS . 32)))) (QUOTE 42))
(/DECLAREDATATYPE (QUOTE LINECACHE) (QUOTE (POINTER FULLXPOINTER)) (QUOTE ((LINECACHE 0 POINTER) (
LINECACHE 2 FULLXPOINTER))) (QUOTE 4))
(RECORD EDITMARK ((* ;; 
"Used for fast access to a given place in the text--a %"Marker%".   It consists of the piece, and the offset within the piece, and the piece number within the piece table.  That's everything that's needed to set a text stream up quickly to start reading from a given place."
) PC PCOFF . PCNO))
(DATATYPE PIECE ((* ; 
"The piece describes either a string or part of a file.  , or a generalized OBJECT.") PSTR (* ; 
"The string where this piece's text resides, or NIL") PFILE (* ; 
"The file which contains this piece's text, or NIL") PFPOS (* ; 
"The FILEPTR of the start of the piece in the file") PLEN (* ; "Length of the piece, in characters.") 
NEXTPIECE (* ; "-> Next piece in this textobj.") (PREVPIECE FULLXPOINTER) (* ; 
"-> Prior piece in this text object.") PLOOKS (* ; 
"Formatting info and formatting events in this piece") POBJ (* ; "The OBJECT this piece describes") (
PPARALAST FLAG) (* ; "This piece contains a paragraph break") PPARALOOKS (* ; 
"Paragraph looks for this piece") (PNEW FLAG) (* ; 
"This text is new here;  used by the tentative edit system, and anyone else interested.") (PFATP FLAG)
 (* ; "T if the characters in this piece are FAT -- i.e., are 16 bits each.") (PTREENODE XPOINTER) (* 
; "Points to the PCTB tree-node that contains this piece.")) PSTR _ NIL PFILE _ NIL PFPOS _ 0 PLEN _ 0
 PPARALOOKS _ TEDIT.DEFAULT.FMTSPEC PTREENODE _ NIL)
(DATATYPE TEXTOBJ ((* ;; 
"This is where TEdit stores its state information, and internal data about the text being edited.") 
PCTB (* ; "The piece table") TEXTLEN (* ; "# of chars in the text") \INSERTPC (* ; 
"Piece to hold type-in") \INSERTPCNO (* ; "Piece # of the input piece") \INSERTNEXTCH (* ; 
"CH# of next char which is typed into that piece.") \INSERTLEFT (* ; "Space left in the type-in piece"
) \INSERTLEN (* ; "# of characters already in the piece.") \INSERTSTRING (* ; 
"The string which the piece describes.") \INSERTFIRSTCH (* ; "CH# of first char in the piece.") (
\INSERTPCVALID FLAG) (* ; 
"T if it's OK to use the cached piece.  Set to NIL by people who require that the next insertion/deletion use a different piece."
) \WINDOW (* ; "The window<s> where this textobj is displayed") MOUSEREGION (* ; 
"Section of the window the mouse is in.") LINES (* ; 
"-> to top of chain of line descriptors for displayed text") DS (* ; 
"Display stream where this textobj is displayed") SEL (* ; "The current selection within the text") 
SCRATCHSEL (* ; "Scratch space for the selection code") MOVESEL (* ; 
"Source for the next MOVE of text") SHIFTEDSEL (* ; "Source for the next COPY") DELETESEL (* ; 
"Text to be deleted imminently") WRIGHT (* ; 
"Right edge of the window (or subregion) where this is displayed") WTOP (* ; 
"Top of the window/region") WBOTTOM (* ; "Bottom of the window/region") WLEFT (* ; 
"Left edge of the window/region") TXTFILE (* ; "The original text file we're editing") (\XDIRTY FLAG) 
(* ; "T => changed since last saved.") (STREAMHINT FULLXPOINTER) (* ; 
"-> the TEXTOFD stream which gives access to this textobj") EDITFINISHEDFLG (* ; 
"T => The guy has asked the editor to go way") CARET (* ; 
"Describes the flashing caret for the editing window") CARETLOOKS (* ; 
"Font to be used for inserted text.") WINDOWTITLE (* ; 
"Original title for this window, of there was one.") THISLINE (* ; 
"Cache of line-related info, to speed up selection &c") (MENUFLG FLAG) (* ; 
"T if this TEXTOBJ is a tedit-style menu") FMTSPEC (* ; 
"Default Formatting Spec to be used when formatting paragraphs") (FORMATTEDP FLAG) (* ; 
"Flag for paragraph formatting.  T if this document is to contain paragraph formatting information.") 
(TXTREADONLY FLAG) (* ; "This is only available for shift selection.") (TXTEDITING FLAG) (* ; 
"T => This document is in a window and there is an edit process behind it.  For example, it only makes sense to have a caret show up if you are editing."
) (TXTNONSCHARS FLAG) (* ; 
"T => If TEdit rns into a 255, it won't attempt to convert to NS characters.  Used for REALLY plain-text manipulation."
) TXTTERMSA (* ; "Special instructions for displaying characters on the screen") EDITOPACTIVE (* ; 
"T if there is an editing operation in progress.  Used to interlock the TEdit menu") DEFAULTCHARLOOKS 
(* ; 
"The default character looks -- if any -- to be applied to characters coming into the file from outside."
) TXTRTBL (* ; "The READTABLE to be used by the command loop for command dispatch") TXTWTBL (* ; 
"The READTABLE to be used to decide on word breaks") EDITPROPS (* ; 
"The PROPS that were passed into this edit session") (BLUEPENDINGDELETE FLAG) (* ; 
"T if the next insertion in this document is to be preceded by a deletion of the then-current selection"
) TXTHISTORY (* ; "The history list for this edit session.") (SELWINDOW FULLXPOINTER) (* ; 
"The window in which the last 'real' selection got made for this edit;  used to control caret placement"
) PROMPTWINDOW (* ; 
"A window to be used for unscheduled interactions;  normally a small window above the edit window") 
DISPLAYCACHE (* ; "The bitmap to be used when building the image of a line for display") 
DISPLAYCACHEDS (* ; "The DISPLAYSTREAM that is used to build line images") DISPLAYHCPYDS (* ; 
"The DISPLAYSTREAM used to build line images of lines that are displayed in 'hardcopy' simulation mode"
) TXTPAGEFRAMES (* ; "A tree of page frames, specifying how the document is to be laid out.") 
TXTCHARLOOKSLIST (* ; "List of all the CHARLOOKSs in the document, so they can be kept unique") 
TXTPARALOOKSLIST (* ; "List of all the FMTSPECs in the document, so they can be kept unique") (
TXTNEEDSUPDATE FLAG) (* ; "T => Screen invalid, need to run updater") (TXTDON'TUPDATE FLAG) (* ; 
"T if we're holding off on screen updates until later.  Used, e.g., by the menu-SHOW code so that you don't get piecemeal updates, but only one at the end of the SHOW."
) TXTRAWINCLUDESTREAM (* ; 
"NODIRCORE stream used to cache RAW includes (and maybe later, all includes?)") DOCPROPS (* ; 
"Document properties that are stored with the document (not used yet)") TXTSTYLESHEET (* ; 
"Style sheet local to this document.  Not currently saved as part of the file.")) (ACCESSFNS TEXTOBJ (
(\DIRTY (ffetch (TEXTOBJ \XDIRTY) of DATUM) (PROGN (IF (NEQ (FETCH (TEXTOBJ \XDIRTY) OF DATUM) 
NEWVALUE) THEN (* ; "update the title to reflect the change") (\TEDIT.WINDOW.TITLE DATUM (
\TEDIT.ORIGINAL.WINDOW.TITLE (ffetch (TEXTOBJ TXTFILE) of DATUM) NEWVALUE))) (freplace \XDIRTY OF 
DATUM WITH NEWVALUE))))) SEL _ (create SELECTION) SCRATCHSEL _ (create SELECTION) MOVESEL _ (create 
SELECTION HOWHEIGHT _ 32767 HASCARET _ NIL) SHIFTEDSEL _ (create SELECTION HASCARET _ NIL) DELETESEL _
 (create SELECTION HOWHEIGHT _ 32767 HASCARET _ NIL) \INSERTNEXTCH _ -1 \INSERTPC _ NIL \INSERTLEFT _ 
0 \INSERTLEN _ 0 \INSERTSTRING _ NIL \INSERTFIRSTCH _ 1000000 TEXTLEN _ 0 WRIGHT _ 0 WTOP _ 0 WLEFT _ 
0 WBOTTOM _ 0 TXTFILE _ NIL \XDIRTY _ NIL MOUSEREGION _ (QUOTE TEXT) THISLINE _ (create THISLINE) 
MENUFLG _ NIL FMTSPEC _ TEDIT.DEFAULT.FMTSPEC FORMATTEDP _ NIL)
(DATATYPE TEXTIMAGEDATA ((* ;; "Fills the IMAGEDATA field of text streams.") TICURPARALOOKS (* ; 
"The current paragraph looks") TICURIMAGESTREAM (* ; "The image stream for this hardcopy transduction"
) TILOOKSUPDATEFN (* ; "The function to call to update looks for this stream") TIPCOFFSET (* ; 
"The offset into the current piece, as of the last page cross.")))
(ACCESSFNS TEXTSTREAM ((* ;; 
"Overlay for the STREAM record to allow mnemonic access to stream fields for Text streams.") (REALFILE
 (fetch F1 of DATUM) (REPLACE F1 OF DATUM WITH NEWVALUE)) (* ; 
"The real, underlying file behind the current piece") (CHARSLEFT (fetch F2 of DATUM) (REPLACE F2 OF 
DATUM WITH NEWVALUE)) (* ;; 
"The # of characters that will be left in the current piece the next time its file crosses a page boundary"
) (TEXTOBJ (fetch F3 of DATUM) (REPLACE F3 OF DATUM WITH NEWVALUE)) (* ; 
"The TEXTOBJ that is editing this text") (PIECE (fetch F5 of DATUM) (REPLACE F5 OF DATUM WITH NEWVALUE
)) (* ; "The PIECE we're currently fetching chars from/putting chars into") (PCNO (fetch FW8 of DATUM)
 (REPLACE FW8 OF DATUM WITH NEWVALUE)) (* ; "The position of that piece in the piece table") (
PCSTARTPG (fetch FW6 of DATUM) (REPLACE FW6 OF DATUM WITH NEWVALUE)) (* ; 
"The underlying file page# that this piece starts on") (PCSTARTCH (fetch FW7 of DATUM) (REPLACE FW7 OF
 DATUM WITH NEWVALUE)) (* ; 
"The char within page of the underlying file that this piece starts on -- for backbin & co") (PCOFFSET
 (fetch TIPCOFFSET of (fetch IMAGEDATA of DATUM)) (REPLACE TIPCOFFSET OF (fetch IMAGEDATA of DATUM) 
with NEWVALUE)) (* ; "The offset into the current piece, as of the last page cross.") (CURRENTLOOKS (
fetch F10 of DATUM) (replace F10 of DATUM with NEWVALUE)) (* ; 
"The CHARLOOKS that are currently applicable to characters being taken from the stream.") (
CURRENTPARALOOKS (fetch TICURPARALOOKS of (fetch IMAGEDATA of DATUM)) (REPLACE TICURPARALOOKS OF (
fetch IMAGEDATA of DATUM) with NEWVALUE)) (* ; 
"The FMTSPEC that is currently applicable to characters being taken from the stream.") (
CURRENTIMAGESTREAM (fetch TICURIMAGESTREAM of (fetch IMAGEDATA of DATUM)) (REPLACE TICURIMAGESTREAM OF
 (fetch IMAGEDATA of DATUM) with NEWVALUE) (* ; 
"The image stream that this text is being put onto;  used for scaling decisions")) (LOOKSUPDATEFN (
fetch TILOOKSUPDATEFN of (fetch IMAGEDATA of DATUM)) (REPLACE TILOOKSUPDATEFN OF (fetch IMAGEDATA of 
DATUM) with NEWVALUE)) (* ; "Function to be called each time character looks change.") (FATSTREAMP (
fetch F4 of DATUM) (REPLACE F4 OF DATUM WITH NEWVALUE)) (* ; 
"T if the current piece is 16 bit characters.")) (CREATE (create STREAM using \TEXTOFD IMAGEDATA _ (
create TEXTIMAGEDATA))))
(/DECLAREDATATYPE (QUOTE PIECE) (QUOTE (POINTER POINTER POINTER POINTER POINTER FULLXPOINTER POINTER 
POINTER FLAG POINTER FLAG FLAG XPOINTER)) (QUOTE ((PIECE 0 POINTER) (PIECE 2 POINTER) (PIECE 4 POINTER
) (PIECE 6 POINTER) (PIECE 8 POINTER) (PIECE 10 FULLXPOINTER) (PIECE 12 POINTER) (PIECE 14 POINTER) (
PIECE 14 (FLAGBITS . 0)) (PIECE 16 POINTER) (PIECE 16 (FLAGBITS . 0)) (PIECE 16 (FLAGBITS . 16)) (
PIECE 18 XPOINTER))) (QUOTE 20))
(/DECLAREDATATYPE (QUOTE TEXTOBJ) (QUOTE (POINTER POINTER POINTER POINTER POINTER POINTER POINTER 
POINTER POINTER FLAG POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER 
POINTER POINTER POINTER POINTER FLAG FULLXPOINTER POINTER POINTER POINTER POINTER POINTER FLAG POINTER
 FLAG FLAG FLAG FLAG POINTER POINTER POINTER POINTER POINTER POINTER FLAG POINTER FULLXPOINTER POINTER
 POINTER POINTER POINTER POINTER POINTER POINTER FLAG FLAG POINTER POINTER POINTER)) (QUOTE ((TEXTOBJ 
0 POINTER) (TEXTOBJ 2 POINTER) (TEXTOBJ 4 POINTER) (TEXTOBJ 6 POINTER) (TEXTOBJ 8 POINTER) (TEXTOBJ 10
 POINTER) (TEXTOBJ 12 POINTER) (TEXTOBJ 14 POINTER) (TEXTOBJ 16 POINTER) (TEXTOBJ 16 (FLAGBITS . 0)) (
TEXTOBJ 18 POINTER) (TEXTOBJ 20 POINTER) (TEXTOBJ 22 POINTER) (TEXTOBJ 24 POINTER) (TEXTOBJ 26 POINTER
) (TEXTOBJ 28 POINTER) (TEXTOBJ 30 POINTER) (TEXTOBJ 32 POINTER) (TEXTOBJ 34 POINTER) (TEXTOBJ 36 
POINTER) (TEXTOBJ 38 POINTER) (TEXTOBJ 40 POINTER) (TEXTOBJ 42 POINTER) (TEXTOBJ 44 POINTER) (TEXTOBJ 
44 (FLAGBITS . 0)) (TEXTOBJ 46 FULLXPOINTER) (TEXTOBJ 48 POINTER) (TEXTOBJ 50 POINTER) (TEXTOBJ 52 
POINTER) (TEXTOBJ 54 POINTER) (TEXTOBJ 56 POINTER) (TEXTOBJ 56 (FLAGBITS . 0)) (TEXTOBJ 58 POINTER) (
TEXTOBJ 58 (FLAGBITS . 0)) (TEXTOBJ 58 (FLAGBITS . 16)) (TEXTOBJ 58 (FLAGBITS . 32)) (TEXTOBJ 58 (
FLAGBITS . 48)) (TEXTOBJ 60 POINTER) (TEXTOBJ 62 POINTER) (TEXTOBJ 64 POINTER) (TEXTOBJ 66 POINTER) (
TEXTOBJ 68 POINTER) (TEXTOBJ 70 POINTER) (TEXTOBJ 70 (FLAGBITS . 0)) (TEXTOBJ 72 POINTER) (TEXTOBJ 74 
FULLXPOINTER) (TEXTOBJ 76 POINTER) (TEXTOBJ 78 POINTER) (TEXTOBJ 80 POINTER) (TEXTOBJ 82 POINTER) (
TEXTOBJ 84 POINTER) (TEXTOBJ 86 POINTER) (TEXTOBJ 88 POINTER) (TEXTOBJ 88 (FLAGBITS . 0)) (TEXTOBJ 88 
(FLAGBITS . 16)) (TEXTOBJ 90 POINTER) (TEXTOBJ 92 POINTER) (TEXTOBJ 94 POINTER))) (QUOTE 96))
(/DECLAREDATATYPE (QUOTE TEXTIMAGEDATA) (QUOTE (POINTER POINTER POINTER POINTER)) (QUOTE ((
TEXTIMAGEDATA 0 POINTER) (TEXTIMAGEDATA 2 POINTER) (TEXTIMAGEDATA 4 POINTER) (TEXTIMAGEDATA 6 POINTER)
)) (QUOTE 8))
(DEFOPTIMIZER TEXTPROP (TEXTOBJ PROP &OPTIONAL (VAL NIL WRITING)) (* ;; "compiles calls to TEXTPROP") 
(COND ((NOT (LISTP PROP)) (* ; "property is not quoted.") (QUOTE IGNOREMACRO)) ((NOT (EQ (CAR PROP) (
QUOTE QUOTE))) (* ; "property is not quoted.") (QUOTE IGNOREMACRO)) ((NOT WRITING) (* ; 
"fetching a TEXTPROP property.") (SELECTQ (CADR PROP) ((READONLY READ-ONLY) (BQUOTE (fetch (TEXTOBJ 
TXTREADONLY) of (TEXTOBJ (\, TEXTOBJ))))) ((BEING-EDITED ACTIVE) (BQUOTE (fetch (TEXTOBJ TXTEDITING) 
of (TEXTOBJ (\, TEXTOBJ))))) ((NO-NS-CHARS NONSCHARS NO-NSCHARS) (BQUOTE (fetch (TEXTOBJ TXTNONSCHARS)
 of (TEXTOBJ (\, TEXTOBJ))))) (BQUOTE (LISTGET (fetch (TEXTOBJ EDITPROPS) of (TEXTOBJ (\, TEXTOBJ))) (
\, PROP))))) (T (* ; "storing a window property") (SELECTQ (CADR PROP) ((READONLY READ-ONLY) (BQUOTE (
REPLACE (TEXTOBJ TXTREADONLY) OF (TEXTOBJ (\, TEXTOBJ)) WITH (\, VAL)))) ((BEING-EDITED ACTIVE) (
BQUOTE (REPLACE (TEXTOBJ TXTEDITING) OF (TEXTOBJ (\, TEXTOBJ)) WITH (\, VAL)))) ((NO-NS-CHARS 
NONSCHARS NO-NSCHARS) (BQUOTE (REPLACE (TEXTOBJ TXTNONSCHARS) OF (TEXTOBJ (\, TEXTOBJ)) WITH (\, VAL))
)) (BQUOTE (LET* (($$TEXTOBJ$$ (TEXTOBJ (\, TEXTOBJ))) ($$PROPLST$$ (FETCH EDITPROPS OF $$TEXTOBJ$$)))
 (COND ($$PROPLST$$ (LISTPUT $$PROPLST$$ (\, PROP) (\, VAL))) (T (REPLACE EDITPROPS OF $$TEXTOBJ$$ 
WITH (LIST (\, PROP) (\, VAL)))))))))))
(RECORD PAGEFORMATTINGSTATE ((* ;; "Contains the state for a TEdit page-formatting job.") PAGE# (* ; 
"The current page number.  Counted from 1") FIRSTPAGE (* ;; 
"T if the current page is the 'first page' .  Is set initially, and can be set again by the user at will.  Gets reset after each page image is printed."
) MINPAGE# (* ; "The page # of the first page to be printed, or NIL") MAXPAGE# (* ; 
"The page # of the last page to be printed, or NIL") STATE (* ; "One of FORMATTING or SEARCHING.") 
REQUIREDREGIONTYPE (* ; 
"If STATE is SEARCHING, the kind of box we're looking for.  If STATE is :SEARCHING-FOR-EQUIVALENT-PAGE, this is the page count for the matching page."
) MAINSTREAM (* ; "The principal textobj/stream source") CHNO (* ; "Our position in that stream") 
PRESSREGION (* ; "The press code's REGION info.") PAGEHEADINGS (* ; 
"The list of current values to be printed, indexed by heading type") PAGE#GENERATOR (* ; 
"List of page numbers;  later, maybe, a function to generate page numbers.  Used to fill in PAGE#TEXT, below"
) PAGE#TEXT (* ; 
"If special page numbers are in use, this is the place to take them from.  PAGE# is still used for recto/verso decisions &c"
) PAGEISRECTO (* ; "T if this is a recto page, NIL if it's a VERSO page.") PAGEFOOTNOTELINES (* ; 
"A list of extant footnote lines that should appear at the next opportunity") PAGEFLOATINGTOPLINES (* 
; "A list of lines that should float to the top of the next available place") PAGECOUNT (* ; 
"The number of pages we've formatted so far.") PAGELINECACHE (* ; 
"A cache for pre-created LINEDESCRIPTOR/THISLINE sets, to avoid the overhead of re-allocating them all the time"
) NEWPAGELAYOUT (* ; 
"If we switch page layouts in mid-document, this is where the new layout gets cached until we get started again."
)) PAGECOUNT _ 0)
(DATATYPE PAGEREGION ((* ;; 
"Describe a part of a page for page formatting.  Can be made into compound descriptions.") 
REGIONFILLMETHOD (* ; "What kind of a region this is -- TEXT, FOLIO, PAGEHEADING, etc.") REGIONSPEC (*
 ; "The page-relative region this occupies") REGIONLOCALINFO (* ; "A PLIST for local information") (
REGIONPARENT FULLXPOINTER) (* ; "The parent node for this box, for sub-boxes") REGIONSUBBOXES (* ; 
"The sub-regions of this region") REGIONTYPE (* ; "A user-settable region type")))
(/DECLAREDATATYPE (QUOTE PAGEREGION) (QUOTE (POINTER POINTER POINTER FULLXPOINTER POINTER POINTER)) (
QUOTE ((PAGEREGION 0 POINTER) (PAGEREGION 2 POINTER) (PAGEREGION 4 POINTER) (PAGEREGION 6 FULLXPOINTER
) (PAGEREGION 8 POINTER) (PAGEREGION 10 POINTER))) (QUOTE 12))
(DATATYPE CHARLOOKS ((* ;; "Describes the appearance (%"Looks%") of characters in a TEdit document.") 
CLFONT (* ; "The font descriptor for these characters") CLNAME (* ;; 
"Name of the font (e.g., HELVETICA) THIS FIELD IS A HINT, OR FOR USE IN CHARLOOKS-BUILDING CODE.  USE FONTPROP TO GET THE RIGHT VALUE FROM CLFONT."
) CLSIZE (* ; "Font size, in points") (CLITAL FLAG) (* ; "T if the characters are italic, else NIL") (
CLBOLD FLAG) (* ; "T if the characters are bold, else NIL") (CLULINE FLAG) (* ; 
"T if the characters are to be underscored, else NIL") (CLOLINE FLAG) (* ; 
"T if the characters are to be overscored, else NIL") (CLSTRIKE FLAG) (* ; 
"T if the characters are to be struck thru, else nil.") CLOFFSET (* ; 
"A superscripting offset in points (?) else NIL (SUBSCRIPTING IF NEGATIVE.)") (CLSMALLCAP FLAG) (* ; 
"T if small caps, else NIL") (CLINVERTED FLAG) (* ; 
"T if the characters are to be shown white-on-black") (CLPROTECTED FLAG) (* ; 
"T if chars can't be selected, else NIL") (CLINVISIBLE FLAG) (* ; 
"T if TEDIT is to ignore these chars;  else NIL") (CLSELHERE FLAG) (* ;; 
"T if TEDIT can put selection after this char (for menu blanks) else NIL;  anything typed after this char will NOT BE PROTECTED."
) (CLCANCOPY FLAG) (* ;; 
"T if this text can be selected for copying, even tho protected (it will become unprotected after the copy;  for Dribble/TTY interface)"
) CLSTYLE (* ; "The style to be used in marking these characters;  overridden by the other fields") 
CLUSERINFO (* ; "Any information that an outsider wants to include") CLLEADER (* ; 
"For creating dotted and other kinds of leader") CLRULES (* ;; 
"For arbitrarily-places horizontal rules.  List of pairs, of (widthinpts  . offsetfrombaselineinpts).  Should be taken account of in ascent/descent calcs."
) (CLMARK FLAG) (* ;; 
"Used for a mark-&-sweep of looks at PUT time -- T means this set of looks really IS in use in the document"
)) CLOFFSET _ 0)
(DATATYPE FMTSPEC ((* ;; "Describe the paragraph formatting for a paragraph in a TEdit document.") 
1STLEFTMAR (* ; "Left margin of the first line of the paragraph") LEFTMAR (* ; 
"Left margin of the rest of the lines in the paragraph") RIGHTMAR (* ; 
"Right margin for the paragraph") LEADBEFORE (* ; 
"Leading above the paragraph's first line, in points") LEADAFTER (* ; 
"Leading below the paragraph's bottom line, in points.  NOT IMPLEMENTED.") LINELEAD (* ; 
"Leading between lines, in points.  Actually, this space is added BELOW each line in the para.") 
FMTBASETOBASE (* ; 
"The baseline-to-baseline spacing between lines in this paragraph.  THIS OVERRIDES THE LINE LEADING") 
TABSPEC (* ; "The list of tabs for this paragraph, including CAR for a default tab width") QUAD (* ; 
"How the para is formatted: one of LEFT, RIGHT, CENTERED, JUSTIFIED") FMTSTYLE (* ; 
"The STYLE that controls this paragraph's appearance") FMTCHARSTYLES (* ; 
"The characterstyles that control the appearance of characters in this para (maybe?  may be part of the fmtstyle.)"
) FMTUSERINFO (* ; "Space for a PLIST of user info") FMTSPECIALX (* ; 
"A special horizontal location on the printed page for this para.") FMTSPECIALY (* ; 
"A special vertical location on the page for this para") (FMTHEADINGKEEP FLAG) (* ; 
"This para should be kept with the top line or so of the next para..") FMTPARATYPE (* ; 
"What kind of para this is: TEXT, PAGEHEADING, whatever") FMTPARASUBTYPE (* ; 
"Sub type of the type, e.g., what KIND of page heading this is.") FMTNEWPAGEBEFORE (* ; 
"Start a new box (if T) or back up the page formatting tree to make a new box of the type named in the value -- by going the least distance back up the tree, then back down until you find that kind of box."
) FMTNEWPAGEAFTER (* ; "Similarly") FMTKEEP (* ; 
"For information about how this paragraph is to be kept with other paragraphs.") FMTCOLUMN (* ; 
"For setting up side-by-side paragraphs easily ala BravoX") FMTVERTRULES (* ; 
"For Keeping track of vertical rules in force") (FMTMARK FLAG) (* ; 
"Used to keep track of which PARALOOKSs are really being used -- a mark & collect is done just before a PUT, so that only 'real' PARALOOKSs make it into the file"
) (* ; 
"Used for a mark&sweep of para looks at PUT time -- T means this looks really IS in use in the document, so it makes sense to save it on the file."
) (FMTHARDCOPY FLAG) (* ; "T if this paragraph is to be displayed in hardcopy-format.") FMTREVISED (* 
; 
"T (or perhaps a revision level or revision-mark spec??) if this paragraph is to be marked as changed on output."
)) TABSPEC _ (CONS NIL NIL))
(DATATYPE PENDINGTAB ((* ;; 
"The data structure for a tab, within the line formatter, that we haven't finished dealing with yet, e.g. a centered tab where you need to wait for AFTER the centered text to do the formatting."
) PTNEWTX (* ;; 
"An updated TX, being passed back to the line formatter.  This results from the resolution of an old RIGHT, CENTERED, or DECIMAL tab, which changed the width of a prior tab."
) PTOLDTAB (* ; "The pending tab") PTTYPE (* ; "Its tab type") PTTABX (* ; "Its nominal X position") (
PTWBASE FULLXPOINTER) (* ; 
"The WBASE for its width, for updating when we've figured out how wide the tab really is") PTOLDTX (* 
; "The TX as of when the tab was encountered.")))
(/DECLAREDATATYPE (QUOTE CHARLOOKS) (QUOTE (POINTER POINTER POINTER FLAG FLAG FLAG FLAG FLAG POINTER 
FLAG FLAG FLAG FLAG FLAG FLAG POINTER POINTER POINTER POINTER FLAG)) (QUOTE ((CHARLOOKS 0 POINTER) (
CHARLOOKS 2 POINTER) (CHARLOOKS 4 POINTER) (CHARLOOKS 4 (FLAGBITS . 0)) (CHARLOOKS 4 (FLAGBITS . 16)) 
(CHARLOOKS 4 (FLAGBITS . 32)) (CHARLOOKS 4 (FLAGBITS . 48)) (CHARLOOKS 2 (FLAGBITS . 0)) (CHARLOOKS 6 
POINTER) (CHARLOOKS 6 (FLAGBITS . 0)) (CHARLOOKS 6 (FLAGBITS . 16)) (CHARLOOKS 6 (FLAGBITS . 32)) (
CHARLOOKS 6 (FLAGBITS . 48)) (CHARLOOKS 2 (FLAGBITS . 16)) (CHARLOOKS 2 (FLAGBITS . 32)) (CHARLOOKS 8 
POINTER) (CHARLOOKS 10 POINTER) (CHARLOOKS 12 POINTER) (CHARLOOKS 14 POINTER) (CHARLOOKS 14 (FLAGBITS
 . 0)))) (QUOTE 16))
(/DECLAREDATATYPE (QUOTE FMTSPEC) (QUOTE (POINTER POINTER POINTER POINTER POINTER POINTER POINTER 
POINTER POINTER POINTER POINTER POINTER POINTER POINTER FLAG POINTER POINTER POINTER POINTER POINTER 
POINTER POINTER FLAG FLAG POINTER)) (QUOTE ((FMTSPEC 0 POINTER) (FMTSPEC 2 POINTER) (FMTSPEC 4 POINTER
) (FMTSPEC 6 POINTER) (FMTSPEC 8 POINTER) (FMTSPEC 10 POINTER) (FMTSPEC 12 POINTER) (FMTSPEC 14 
POINTER) (FMTSPEC 16 POINTER) (FMTSPEC 18 POINTER) (FMTSPEC 20 POINTER) (FMTSPEC 22 POINTER) (FMTSPEC 
24 POINTER) (FMTSPEC 26 POINTER) (FMTSPEC 26 (FLAGBITS . 0)) (FMTSPEC 28 POINTER) (FMTSPEC 30 POINTER)
 (FMTSPEC 32 POINTER) (FMTSPEC 34 POINTER) (FMTSPEC 36 POINTER) (FMTSPEC 38 POINTER) (FMTSPEC 40 
POINTER) (FMTSPEC 40 (FLAGBITS . 0)) (FMTSPEC 40 (FLAGBITS . 16)) (FMTSPEC 42 POINTER))) (QUOTE 44))
(/DECLAREDATATYPE (QUOTE PENDINGTAB) (QUOTE (POINTER POINTER POINTER POINTER FULLXPOINTER POINTER)) (
QUOTE ((PENDINGTAB 0 POINTER) (PENDINGTAB 2 POINTER) (PENDINGTAB 4 POINTER) (PENDINGTAB 6 POINTER) (
PENDINGTAB 8 FULLXPOINTER) (PENDINGTAB 10 POINTER))) (QUOTE 12))
(TYPERECORD MB.3STATE ((* ;; "Describes a 3-state menu button.") MBLABEL (* ; 
"Label for the button on the screen") MBFONT (* ; "Font the label text should appear in") 
MBCHANGESTATEFN (* ; "Function to call when the button's state changes") MBINITSTATE (* ; 
"Button's initial state.")) MBFONT _ (FONTCREATE (QUOTE HELVETICA) 8 (QUOTE BOLD)))
(TYPERECORD MB.BUTTON (MBLABEL MBBUTTONEVENTFN MBFONT) MBBUTTONEVENTFN _ (QUOTE MB.DEFAULTBUTTON.FN) 
MBFONT _ (FONTCREATE (QUOTE HELVETICA) 8 (QUOTE BOLD)))
(TYPERECORD MB.INSERT (MBINITENTRY))
(TYPERECORD MB.MARGINBAR (ignoredfield))
(TYPERECORD MB.NWAY (MBBUTTONS MBFONT MBCHANGESTATEFN MBINITSTATE MBMAXITEMSPERLINE) MBFONT _ (
FONTCREATE (QUOTE HELVETICA) 8 (QUOTE BOLD)))
(TYPERECORD MB.TEXT (MBSTRING MBFONT))
(TYPERECORD MB.TOGGLE (MBTEXT MBFONT MBCHANGESTATEFN MBINITSTATE) MBFONT _ (FONTCREATE (QUOTE 
HELVETICA) 8 (QUOTE BOLD)))
(DEFMACRO WITHOUT-UPDATES (TEXTOBJ SCRATCHSEL &BODY BODY) (* ;; 
"For TEdit windows, run BODY without updating the edit window for TEXTOBJ.  This is useful if you're making a log of changes to a document at one time, where the changes are in essence atomic, and you don't need to see intermediate results.  It's also a good bit faster than constant updating."
) (* ;; "TEXTOBJ is the TEXTOBJ for the document you'll be modifying.") (* ;; 
"SCRATCHSEL should be the scratch selection (often used in this work)") (BQUOTE (LET ((OLD-UNWIND-FLAG
 (FETCH (TEXTOBJ TXTDON'TUPDATE) OF (\, TEXTOBJ)))) (CL:UNWIND-PROTECT (PROGN (replace (TEXTOBJ 
TXTDON'TUPDATE) of (\, TEXTOBJ) with T) (\,@ BODY)) (\SHOWSEL (\, SCRATCHSEL) NIL NIL) (replace SET of
 (\, SCRATCHSEL) with NIL) (\TEDIT.MARK.LINES.DIRTY (\, TEXTOBJ) 1 (fetch (TEXTOBJ TEXTLEN) of (\, 
TEXTOBJ))) (replace (TEXTOBJ TXTDON'TUPDATE) of (\, TEXTOBJ) with OLD-UNWIND-FLAG) (
TEDIT.UPDATE.SCREEN (\, TEXTOBJ))))))
(RECORD TEDITHISTORYEVENT ((* ;; "Describes one event on the TEdit edit history list.") THACTION (* ; 
"A LITATOM, specifying what the event was") THPOINT (* ; "Was the selection to the left or right?") 
THLEN (* ; "The # of chars involved") THCH# (* ; "The starting ch#") THFIRSTPIECE (* ; 
"First piece involved") THOLDINFO (* ; "Old info, for undo") THAUXINFO (* ; 
"Auxiliary info about the event, primarily for redo") THTEXTOBJ (* ;; 
"Place to remember a second textobj, for those like MOVE who need to remember both a source and a destination."
)) THPOINT _ (QUOTE LEFT))
(/DECLAREDATATYPE (QUOTE TEDITCARET) (QUOTE (POINTER POINTER POINTER POINTER POINTER POINTER POINTER 
POINTER POINTER POINTER POINTER)) (QUOTE ((TEDITCARET 0 POINTER) (TEDITCARET 2 POINTER) (TEDITCARET 4 
POINTER) (TEDITCARET 6 POINTER) (TEDITCARET 8 POINTER) (TEDITCARET 10 POINTER) (TEDITCARET 12 POINTER)
 (TEDITCARET 14 POINTER) (TEDITCARET 16 POINTER) (TEDITCARET 18 POINTER) (TEDITCARET 20 POINTER))) (
QUOTE 22))
(DATATYPE PCTNODE (CHNUM (* ; "Character #of piece in this node.") PCE (* ; "PIECE ") LO (* ; 
"Subtree these nodes' ch#are less than this node.") HI (* ; 
" Subtree these nodes' ch#are more than this node.") BF (* ; "Balance factor.") (* ; 
"1: Right(HI) Subtree is higher than left(lo) subtree.") (* ; 
"0: Right subtree and left subtree are same height") (* ; 
"-1: Right(HI) Subtree is shorter than left(lo) subtree.") RANK (* ; "(# of nodes in left subtree) +1"
)) CHNUM _ 0 BF _ 0 RANK _ 1)
(/DECLAREDATATYPE (QUOTE PCTNODE) (QUOTE (POINTER POINTER POINTER POINTER POINTER POINTER)) (QUOTE ((
PCTNODE 0 POINTER) (PCTNODE 2 POINTER) (PCTNODE 4 POINTER) (PCTNODE 6 POINTER) (PCTNODE 8 POINTER) (
PCTNODE 10 POINTER))) (QUOTE 12))
(PUTPROPS TEDITDCL COPYRIGHT ("Venue" 1986 1987 1988 1989 1990 1991 1993 1994))
NIL
\ No newline at end of file
+(DEFINE-FILE-INFO READTABLE "INTERLISP" PACKAGE "INTERLISP")
+(FILECREATED "30-Apr-2021 17:26:58" ("compiled on " 
+{DSK}<Users>kaplan>Local>medley3.5>git-medley>library>TEDITDCL.;2) "29-Apr-2021 09:48:40" brecompiled 
+exprs%: nothing in "Medley  Full Sysout 30-Apr-2021 ..." dated "30-Apr-2021 14:49:58")
+(FILECREATED "30-Apr-2021 17:26:17" {DSK}<Users>kaplan>Local>medley3.5>git-medley>library>TEDITDCL.;2 
+86155 previous date%: "25-Aug-94 10:53:00" 
+{DSK}<Users>kaplan>Local>medley3.5>git-medley>library>TEDITDCL.;1)
+(PRETTYCOMPRINT TEDITDCLCOMS)
+(RPAQQ TEDITDCLCOMS ((* ;;; 
+"This file is the collected record declarations and compile-time necessities for TEDIT.") (* ;; 
+"FROM TEDIT") (DECLARE%: EVAL@COMPILE DONTCOPY (CONSTANTS (\SCRATCHLEN 64))) (* ;; 
+"FROM TEDITSELECTION") (RECORDS SELECTION) (DECLARE%: EVAL@COMPILE DONTCOPY (CONSTANTS (COPYSELSHADE 
+30583) (COPYLOOKSSELSHADE 30583) (EDITMOVESHADE -1) (EDITGRAY 32800))) (VARS TEDITFILES) (* ;; 
+"FROM TEDITSCREEN") (RECORDS THISLINE LINEDESCRIPTOR LINECACHE) (DECLARE%: EVAL@COMPILE DONTCOPY (
+CONSTANTS (LMInvisibleRun 401) (LMLooksChange 400))) (* ;; "FROM TEXTOFD") (RECORDS EDITMARK) (RECORDS
+ PIECE TEXTOBJ TEXTIMAGEDATA TEXTSTREAM) (OPTIMIZERS TEXTPROP) (COMS (* ;; 
+"Private data structures and constants FROM TEXTOFD") (DECLARE%: EVAL@COMPILE DONTCOPY (CONSTANTS (
+\PCTBFreePieces 0) (\PCTBLastPieceOffset 1) (\FirstPieceOffset 2) (\SecondPieceOffset 4) (
+\EltsPerPiece 2)) (MACROS \EDITELT \GETCH \GETCHB \EDITSETA \WORDSETA) (GLOBALVARS \TEXTIMAGEOPS 
+\TEXTOFD \TEXTFDEV))) (* ;;; "FROM TEDITPAGE") (RECORDS PAGEFORMATTINGSTATE PAGEREGION) (DECLARE%: 
+EVAL@COMPILE DONTCOPY (RECORDS TEDITPAPERSIZE) (FUNCTIONS \NEW-COLUMN-START \FIRST-COLUMN-START)) (* 
+;; "FROM TEDITFIND") (DECLARE%: EVAL@COMPILE DONTCOPY (CONSTANTS (\AlphaNumericFlag 256) (\AlphaFlag 
+512) (\OneCharPattern 1024) (\AnyStringPattern 1025) (\OneAlphaPattern 1026) (\AnyAlphaPattern 1027) (
+\OneNonAlphaPattern 1028) (\AnyNonAlphaPattern 1029) (\LeftBracketPattern 1030) (\RightBracketPattern 
+1031) (\SpecialPattern 1024))) (* ;; " FROM TEDITLOOKS") (RECORDS CHARLOOKS FMTSPEC PENDINGTAB) (
+DECLARE%: EVAL@COMPILE DONTCOPY (MACROS \SMALLPIN \SMALLPOUT ONOFF)) (* ;; "FROM TEDITMENU") (
+DECLARE%: EVAL@COMPILE DONTCOPY (RECORDS MBUTTON)) (INITRECORDS MBUTTON) (DECLARE%: EVAL@COMPILE 
+DONTCOPY (RECORDS NWAYBUTTON)) (INITRECORDS NWAYBUTTON) (DECLARE%: EVAL@COMPILE DONTCOPY (RECORDS 
+MARGINBAR)) (INITRECORDS MARGINBAR) (DECLARE%: EVAL@COMPILE DONTCOPY (RECORDS TAB)) (RECORDS MB.3STATE
+ MB.BUTTON MB.INSERT MB.MARGINBAR MB.NWAY MB.TEXT MB.TOGGLE) (FUNCTIONS WITHOUT-UPDATES) (* ;; 
+"FROM TEDITHISTORY") (RECORDS TEDITHISTORYEVENT) (* ;; "FROM TEDITFILE") (DECLARE%: EVAL@COMPILE 
+DONTCOPY (CONSTANTS (\PieceDescriptorLOOKS 0) (\PieceDescriptorOBJECT 1) (\PieceDescriptorPARA 2) (
+\PieceDescriptorPAGEFRAME 3) (\PieceDescriptorCHARLOOKSLIST 4) (\PieceDescriptorPARALOOKSLIST 5) (
+\PieceDescriptorSAFEOBJECT 6))) (* ;; "FROM TEDITCOMMAND") (DECLARE%: EVAL@COMPILE DONTCOPY (MACROS 
+\INSERT\TTY\BUFFER \TEDIT.MOUSESTATE \TEDIT.CHECK)) (DECLARE%: EVAL@COMPILE DONTCOPY (RECORDS 
+TEDITTERMCODE)) (DECLARE%: EVAL@COMPILE DONTCOPY (CONSTANTS (NONE.TTC 0) (CHARDELETE.TTC 1) (
+WORDDELETE.TTC 2) (DELETE.TTC 3) (FUNCTIONCALL.TTC 4) (REDO.TTC 5) (UNDO.TTC 6) (CMD.TTC 7) (NEXT.TTC 
+8) (EXPAND.TTC 9) (PUNCT.TTC 20) (TEXT.TTC 21) (WHITESPACE.TTC 22))) (DECLARE%: EVAL@COMPILE DONTCOPY 
+(CONSTANTS (MSPACE 153) (NSPACE 152) (THINSPACE 159) (FIGSPACE 154))) (* ;; "FROM TEDITWINDOW") (
+DECLARE%: EVAL@COMPILE DONTCOPY (RECORDS TEDITCARET)) (INITRECORDS TEDITCARET) (* ;; 
+"FROM PCTREE added by Nakamura") (RECORDS PCTNODE) (* ;;; "THE END") (COMS (* ;; 
+"Bits in the CHARTABLE that control line breaking, and what happens when a line is broken on this character "
+) (DECLARE%: EVAL@COMPILE DONTCOPY (CONSTANTS (NOTBEFORE.LB 1) (* ; 
+"Must not break before this character (e.g. Japanese right-paren)") (NOTAFTER.LB 2) (* ; 
+"Must not break after this character (e.g. Japanese open-quote)") (BEFORE.LB 4) (* ; 
+"OK to break before this character, provided it's OK to break after the prior char (true of most non-white-space)"
+) (AFTER.LB 8) (* ; 
+"OK to break after this char, if it's OK to break before the next one (true of most white space)") (
+DISAPPEAR-IF-NOT-SPLIT.LB 16) (* ; 
+"This character shouldn't be rendered if it isn't the last char on the line (non-breaking hyphen has this)"
+) (NEWCHAR-IF-SPLIT.LB 32) (* ; 
+"Look this char up in *TEDIT-SPLITCHAR-HASH* if this IS the last character on a line, and render it as the char we found."
+))))))
+(DATATYPE SELECTION ((* ;; 
+"Description of a piece of selected text for TEdit.  Text has to be selected before it can be operated on by the user."
+) Y0 (* ; "Y value of topmost line of selection") X0 (* ; "X value of left edge of selection") DX (* ;
+ "Width of the selection, if it's on one line.") CH# (* ; "CH# of the first selected character") XLIM 
+(* ; "X value of right edge of last selected character") CHLIM (* ; 
+"CH# of the last character in the selection") DCH (* ; 
+"# of characters selected (can be zero, for point selection.)") L1 (* ; 
+"-> line descriptor for the line where the first selected character is") LN (* ; 
+"-> line descriptor for the line which contains the end of the selection") YLIM (* ; 
+"Y value of the bottom of the line that ends the selection") POINT (* ; 
+"Which end should the caret appear at?  (LEFT or RIGHT)") (SET FLAG) (* ; 
+"T if this selection is real;  NIL if not") (\TEXTOBJ FULLXPOINTER) (* ; 
+"TEXTOBJ that describes the selected text") SELKIND (* ; 
+"What kind of selection?  CHAR or WORD or LINE or PARA") HOW (* ; 
+"SHADE used to highlight this selection") HOWHEIGHT (* ; 
+"Height of the highlight (1 usually, full line for delete selection...)") (HASCARET FLAG) (* ; 
+"T if there should be a caret for this selection") SELOBJ (* ; 
+"If this selection is inside an object, which object?") (ONFLG FLAG) (* ; 
+"T if the selection is highlighted on the screen, else NIL") SELOBJINFO (* ; 
+"A Place for the selected object to put info about selection inside itself.")) SET _ NIL HOW _ 
+BLACKSHADE HOWHEIGHT _ 1 HASCARET _ T Y0 _ 0 X0 _ 0 POINT _ (QUOTE LEFT) L1 _ (LIST NIL) LN _ (LIST 
+NIL))
+(/DECLAREDATATYPE (QUOTE SELECTION) (QUOTE (POINTER POINTER POINTER POINTER POINTER POINTER POINTER 
+POINTER POINTER POINTER POINTER FLAG FULLXPOINTER POINTER POINTER POINTER FLAG POINTER FLAG POINTER)) 
+(QUOTE ((SELECTION 0 POINTER) (SELECTION 2 POINTER) (SELECTION 4 POINTER) (SELECTION 6 POINTER) (
+SELECTION 8 POINTER) (SELECTION 10 POINTER) (SELECTION 12 POINTER) (SELECTION 14 POINTER) (SELECTION 
+16 POINTER) (SELECTION 18 POINTER) (SELECTION 20 POINTER) (SELECTION 20 (FLAGBITS . 0)) (SELECTION 22 
+FULLXPOINTER) (SELECTION 24 POINTER) (SELECTION 26 POINTER) (SELECTION 28 POINTER) (SELECTION 28 (
+FLAGBITS . 0)) (SELECTION 30 POINTER) (SELECTION 30 (FLAGBITS . 0)) (SELECTION 32 POINTER))) (QUOTE 34
+))
+(RPAQQ TEDITFILES (PCTREE TEXTOFD TEDIT TEDITABBREV TEDITCOMMAND TEDITDCL TEDITFILE TEDITFIND 
+TEDITFNKEYS TEDITHCPY TEDITHISTORY TEDITLOOKS TEDITMENU TEDITPAGE TEDITSCREEN TEDITSELECTION 
+TEDITWINDOW))
+(DATATYPE THISLINE ((* ;; 
+"Cache for line-related character location info, for selection and line-display code to use.") (DESC 
+FULLXPOINTER) (* ; "Line descriptor for the line this describes now") LEN (* ; 
+"Length of the line in characters") CHARS (* ;; 
+"Array of character codes (or objects) on the line (charcode of 400 => dummy entry for looks change--go get next entry in LOOKS)"
+) WIDTHS (* ; "Array of each character's width in points") LOOKS (* ; 
+"Array of any looks changes within the line.  LOOKS (0) = starting character looks for the line") 
+TLSPACEFACTOR (* ; "The SPACEFACTOR to be used in printing this line") TLFIRSTSPACE (* ; 
+"The first space to which SPACEFACTOR is to apply.  This is used so that spaces to the left of a TAB have their default width."
+)) LEN _ 0 CHARS _ (ARRAY 512 (QUOTE POINTER) 0 0) WIDTHS _ (ARRAY 512 (QUOTE POINTER) 0 0) LOOKS _ (
+ARRAY 512 (QUOTE POINTER) NIL 0) TLFIRSTSPACE _ 0)
+(DATATYPE LINEDESCRIPTOR ((* ;; 
+"Description of a single line of formatted text, either on the display or for a printed page.") YBOT (
+* ; "Y value for the bottom of the line (below the descent)") YBASE (* ; 
+"Yvalue for the base line the characters sit on") LEFTMARGIN (* ; "Left margin, in screen points") 
+RIGHTMARGIN (* ; "Right margin, in screen points") LXLIM (* ; 
+"X value of right edge of rightmost character on the line (may exceed right margin, if char is a space.)"
+) SPACELEFT (* ; "Space left on the line, ignoring trailing blanks & CRs.") LHEIGHT (* ; 
+"Total height of hte line, Ascent+Descent.") ASCENT (* ; "Ascent of the line above YBASE") DESCENT (* 
+; "How far line descends below YBASE") LTRUEDESCENT (* ; 
+"The TRUE DESCENT for this line, unadjusted for line leading.") LTRUEASCENT (* ; 
+"The TRUE ASCENT for this line, unadjusted for pre-paragraph leading.") CHAR1 (* ; 
+"CH# of the first character on the line.") CHARLIM (* ; "CH# of the last character on the line") 
+CHARTOP (* ; "CH# of the character which forced the line break (may exceed CHARLIM)") NEXTLINE (* ; 
+"Next line chain pointer") (PREVLINE FULLXPOINTER) (* ; "Previous line chain pointer") LMARK (* ; 
+"One of SOLID, GREY, NIL.  Tells what kind of special-line marker should be put in the left margin for this paragraph.  (For hardcopy, can also be an indicator for special processing?)"
+) LTEXTOBJ (* ; 
+"A cached TEXTOBJ that this line took its text from.  Used in hardcopy to disambiguate when chno's should be updated..."
+) CACHE (* ; 
+"A cached THISLINE, for keeping hardcopy info around while we crunch with the line descriptors to make things fit."
+) LDOBJ (* ; "The object which lies behind this line of text, for updating, etc.") LFMTSPEC (* ; 
+"The format spec for this line's paragraph (eventually)") (DIRTY FLAG) (* ; 
+"T if this line has changed since it was last formatted.") (CR\END FLAG) (* ; 
+"T if this line ends with a CR.") (DELETED FLAG) (* ; 
+"T if this line has been completely deleted since it was last formatted or displayed.  (Used by deletion routines to detect garbage lines)"
+) (LHASPROT FLAG) (* ; "This line contains protected text.") (LHASTABS FLAG) (* ; 
+"If this line has a tab in it, this is the line-relative ch# of the final tab.  This is to let us punt properly with tabs in a line."
+) (1STLN FLAG) (* ; "This line is the first line in a paragraph") (LSTLN FLAG) (* ; 
+"This is the last line in a paragraph")) CHARLIM _ 1000000 NEXTLINE _ NIL PREVLINE _ NIL DIRTY _ NIL 
+YBOT _ 0 YBASE _ 0 LEFTMARGIN _ 0 DELETED _ NIL)
+(DATATYPE LINECACHE ((* ;; "Image cache for display lines.") LCBITMAP (* ; 
+"The bitmap that will be used by this instance of the cache") (LCNEXTCACHE FULLXPOINTER) (* ; 
+"The next cache in the chain, for screen updates.")))
+(/DECLAREDATATYPE (QUOTE THISLINE) (QUOTE (FULLXPOINTER POINTER POINTER POINTER POINTER POINTER 
+POINTER)) (QUOTE ((THISLINE 0 FULLXPOINTER) (THISLINE 2 POINTER) (THISLINE 4 POINTER) (THISLINE 6 
+POINTER) (THISLINE 8 POINTER) (THISLINE 10 POINTER) (THISLINE 12 POINTER))) (QUOTE 14))
+(/DECLAREDATATYPE (QUOTE LINEDESCRIPTOR) (QUOTE (POINTER POINTER POINTER POINTER POINTER POINTER 
+POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER FULLXPOINTER POINTER POINTER 
+POINTER POINTER POINTER FLAG FLAG FLAG FLAG FLAG FLAG FLAG)) (QUOTE ((LINEDESCRIPTOR 0 POINTER) (
+LINEDESCRIPTOR 2 POINTER) (LINEDESCRIPTOR 4 POINTER) (LINEDESCRIPTOR 6 POINTER) (LINEDESCRIPTOR 8 
+POINTER) (LINEDESCRIPTOR 10 POINTER) (LINEDESCRIPTOR 12 POINTER) (LINEDESCRIPTOR 14 POINTER) (
+LINEDESCRIPTOR 16 POINTER) (LINEDESCRIPTOR 18 POINTER) (LINEDESCRIPTOR 20 POINTER) (LINEDESCRIPTOR 22 
+POINTER) (LINEDESCRIPTOR 24 POINTER) (LINEDESCRIPTOR 26 POINTER) (LINEDESCRIPTOR 28 POINTER) (
+LINEDESCRIPTOR 30 FULLXPOINTER) (LINEDESCRIPTOR 32 POINTER) (LINEDESCRIPTOR 34 POINTER) (
+LINEDESCRIPTOR 36 POINTER) (LINEDESCRIPTOR 38 POINTER) (LINEDESCRIPTOR 40 POINTER) (LINEDESCRIPTOR 40 
+(FLAGBITS . 0)) (LINEDESCRIPTOR 40 (FLAGBITS . 16)) (LINEDESCRIPTOR 40 (FLAGBITS . 32)) (
+LINEDESCRIPTOR 40 (FLAGBITS . 48)) (LINEDESCRIPTOR 38 (FLAGBITS . 0)) (LINEDESCRIPTOR 38 (FLAGBITS . 
+16)) (LINEDESCRIPTOR 38 (FLAGBITS . 32)))) (QUOTE 42))
+(/DECLAREDATATYPE (QUOTE LINECACHE) (QUOTE (POINTER FULLXPOINTER)) (QUOTE ((LINECACHE 0 POINTER) (
+LINECACHE 2 FULLXPOINTER))) (QUOTE 4))
+(RECORD EDITMARK ((* ;; 
+"Used for fast access to a given place in the text--a %"Marker%".   It consists of the piece, and the offset within the piece, and the piece number within the piece table.  That's everything that's needed to set a text stream up quickly to start reading from a given place."
+) PC PCOFF . PCNO))
+(DATATYPE PIECE ((* ; 
+"The piece describes either a string or part of a file.  , or a generalized OBJECT.") PSTR (* ; 
+"The string where this piece's text resides, or NIL") PFILE (* ; 
+"The file which contains this piece's text, or NIL") PFPOS (* ; 
+"The FILEPTR of the start of the piece in the file") PLEN (* ; "Length of the piece, in characters.") 
+NEXTPIECE (* ; "-> Next piece in this textobj.") (PREVPIECE FULLXPOINTER) (* ; 
+"-> Prior piece in this text object.") PLOOKS (* ; 
+"Formatting info and formatting events in this piece") POBJ (* ; "The OBJECT this piece describes") (
+PPARALAST FLAG) (* ; "This piece contains a paragraph break") PPARALOOKS (* ; 
+"Paragraph looks for this piece") (PNEW FLAG) (* ; 
+"This text is new here;  used by the tentative edit system, and anyone else interested.") (PFATP FLAG)
+ (* ; "T if the characters in this piece are FAT -- i.e., are 16 bits each.") (PTREENODE XPOINTER) (* 
+; "Points to the PCTB tree-node that contains this piece.")) PSTR _ NIL PFILE _ NIL PFPOS _ 0 PLEN _ 0
+ PPARALOOKS _ TEDIT.DEFAULT.FMTSPEC PTREENODE _ NIL)
+(DATATYPE TEXTOBJ ((* ;; 
+"This is where TEdit stores its state information, and internal data about the text being edited.") 
+PCTB (* ; "The piece table") TEXTLEN (* ; "# of chars in the text") \INSERTPC (* ; 
+"Piece to hold type-in") \INSERTPCNO (* ; "Piece # of the input piece") \INSERTNEXTCH (* ; 
+"CH# of next char which is typed into that piece.") \INSERTLEFT (* ; "Space left in the type-in piece"
+) \INSERTLEN (* ; "# of characters already in the piece.") \INSERTSTRING (* ; 
+"The string which the piece describes.") \INSERTFIRSTCH (* ; "CH# of first char in the piece.") (
+\INSERTPCVALID FLAG) (* ; 
+"T if it's OK to use the cached piece.  Set to NIL by people who require that the next insertion/deletion use a different piece."
+) \WINDOW (* ; "The window<s> where this textobj is displayed") MOUSEREGION (* ; 
+"Section of the window the mouse is in.") LINES (* ; 
+"-> to top of chain of line descriptors for displayed text") DS (* ; 
+"Display stream where this textobj is displayed") SEL (* ; "The current selection within the text") 
+SCRATCHSEL (* ; "Scratch space for the selection code") MOVESEL (* ; 
+"Source for the next MOVE of text") SHIFTEDSEL (* ; "Source for the next COPY") DELETESEL (* ; 
+"Text to be deleted imminently") WRIGHT (* ; 
+"Right edge of the window (or subregion) where this is displayed") WTOP (* ; 
+"Top of the window/region") WBOTTOM (* ; "Bottom of the window/region") WLEFT (* ; 
+"Left edge of the window/region") TXTFILE (* ; "The original text file we're editing") (\XDIRTY FLAG) 
+(* ; "T => changed since last saved.") (STREAMHINT FULLXPOINTER) (* ; 
+"-> the TEXTOFD stream which gives access to this textobj") EDITFINISHEDFLG (* ; 
+"T => The guy has asked the editor to go way") CARET (* ; 
+"Describes the flashing caret for the editing window") CARETLOOKS (* ; 
+"Font to be used for inserted text.") WINDOWTITLE (* ; 
+"Original title for this window, of there was one.") THISLINE (* ; 
+"Cache of line-related info, to speed up selection &c") (MENUFLG FLAG) (* ; 
+"T if this TEXTOBJ is a tedit-style menu") FMTSPEC (* ; 
+"Default Formatting Spec to be used when formatting paragraphs") (FORMATTEDP FLAG) (* ; 
+"Flag for paragraph formatting.  T if this document is to contain paragraph formatting information.") 
+(TXTREADONLY FLAG) (* ; "This is only available for shift selection.") (TXTEDITING FLAG) (* ; 
+"T => This document is in a window and there is an edit process behind it.  For example, it only makes sense to have a caret show up if you are editing."
+) (TXTNONSCHARS FLAG) (* ; 
+"T => If TEdit rns into a 255, it won't attempt to convert to NS characters.  Used for REALLY plain-text manipulation."
+) TXTTERMSA (* ; "Special instructions for displaying characters on the screen") EDITOPACTIVE (* ; 
+"T if there is an editing operation in progress.  Used to interlock the TEdit menu") DEFAULTCHARLOOKS 
+(* ; 
+"The default character looks -- if any -- to be applied to characters coming into the file from outside."
+) TXTRTBL (* ; "The READTABLE to be used by the command loop for command dispatch") TXTWTBL (* ; 
+"The READTABLE to be used to decide on word breaks") EDITPROPS (* ; 
+"The PROPS that were passed into this edit session") (BLUEPENDINGDELETE FLAG) (* ; 
+"T if the next insertion in this document is to be preceded by a deletion of the then-current selection"
+) TXTHISTORY (* ; "The history list for this edit session.") (SELWINDOW FULLXPOINTER) (* ; 
+"The window in which the last 'real' selection got made for this edit;  used to control caret placement"
+) PROMPTWINDOW (* ; 
+"A window to be used for unscheduled interactions;  normally a small window above the edit window") 
+DISPLAYCACHE (* ; "The bitmap to be used when building the image of a line for display") 
+DISPLAYCACHEDS (* ; "The DISPLAYSTREAM that is used to build line images") DISPLAYHCPYDS (* ; 
+"The DISPLAYSTREAM used to build line images of lines that are displayed in 'hardcopy' simulation mode"
+) TXTPAGEFRAMES (* ; "A tree of page frames, specifying how the document is to be laid out.") 
+TXTCHARLOOKSLIST (* ; "List of all the CHARLOOKSs in the document, so they can be kept unique") 
+TXTPARALOOKSLIST (* ; "List of all the FMTSPECs in the document, so they can be kept unique") (
+TXTNEEDSUPDATE FLAG) (* ; "T => Screen invalid, need to run updater") (TXTDON'TUPDATE FLAG) (* ; 
+"T if we're holding off on screen updates until later.  Used, e.g., by the menu-SHOW code so that you don't get piecemeal updates, but only one at the end of the SHOW."
+) TXTRAWINCLUDESTREAM (* ; 
+"NODIRCORE stream used to cache RAW includes (and maybe later, all includes?)") DOCPROPS (* ; 
+"Document properties that are stored with the document (not used yet)") TXTSTYLESHEET (* ; 
+"Style sheet local to this document.  Not currently saved as part of the file.")) (ACCESSFNS TEXTOBJ (
+(\DIRTY (ffetch (TEXTOBJ \XDIRTY) of DATUM) (PROGN (IF (NEQ (FETCH (TEXTOBJ \XDIRTY) OF DATUM) 
+NEWVALUE) THEN (* ; "update the title to reflect the change") (\TEDIT.WINDOW.TITLE DATUM (
+\TEDIT.ORIGINAL.WINDOW.TITLE (ffetch (TEXTOBJ TXTFILE) of DATUM) NEWVALUE))) (freplace \XDIRTY OF 
+DATUM WITH NEWVALUE))))) SEL _ (create SELECTION) SCRATCHSEL _ (create SELECTION) MOVESEL _ (create 
+SELECTION HOWHEIGHT _ 32767 HASCARET _ NIL) SHIFTEDSEL _ (create SELECTION HASCARET _ NIL) DELETESEL _
+ (create SELECTION HOWHEIGHT _ 32767 HASCARET _ NIL) \INSERTNEXTCH _ -1 \INSERTPC _ NIL \INSERTLEFT _ 
+0 \INSERTLEN _ 0 \INSERTSTRING _ NIL \INSERTFIRSTCH _ 1000000 TEXTLEN _ 0 WRIGHT _ 0 WTOP _ 0 WLEFT _ 
+0 WBOTTOM _ 0 TXTFILE _ NIL \XDIRTY _ NIL MOUSEREGION _ (QUOTE TEXT) THISLINE _ (create THISLINE) 
+MENUFLG _ NIL FMTSPEC _ TEDIT.DEFAULT.FMTSPEC FORMATTEDP _ NIL)
+(DATATYPE TEXTIMAGEDATA ((* ;; "Fills the IMAGEDATA field of text streams.") TICURPARALOOKS (* ; 
+"The current paragraph looks") TICURIMAGESTREAM (* ; "The image stream for this hardcopy transduction"
+) TILOOKSUPDATEFN (* ; "The function to call to update looks for this stream") TIPCOFFSET (* ; 
+"The offset into the current piece, as of the last page cross.")))
+(ACCESSFNS TEXTSTREAM ((* ;; 
+"Overlay for the STREAM record to allow mnemonic access to stream fields for Text streams.") (REALFILE
+ (fetch F1 of DATUM) (REPLACE F1 OF DATUM WITH NEWVALUE)) (* ; 
+"The real, underlying file behind the current piece") (CHARSLEFT (fetch F2 of DATUM) (REPLACE F2 OF 
+DATUM WITH NEWVALUE)) (* ;; 
+"The # of characters that will be left in the current piece the next time its file crosses a page boundary"
+) (TEXTOBJ (fetch F3 of DATUM) (REPLACE F3 OF DATUM WITH NEWVALUE)) (* ; 
+"The TEXTOBJ that is editing this text") (PIECE (fetch F5 of DATUM) (REPLACE F5 OF DATUM WITH NEWVALUE
+)) (* ; "The PIECE we're currently fetching chars from/putting chars into") (PCNO (fetch FW8 of DATUM)
+ (REPLACE FW8 OF DATUM WITH NEWVALUE)) (* ; "The position of that piece in the piece table") (
+PCSTARTPG (fetch FW6 of DATUM) (REPLACE FW6 OF DATUM WITH NEWVALUE)) (* ; 
+"The underlying file page# that this piece starts on") (PCSTARTCH (fetch FW7 of DATUM) (REPLACE FW7 OF
+ DATUM WITH NEWVALUE)) (* ; 
+"The char within page of the underlying file that this piece starts on -- for backbin & co") (PCOFFSET
+ (fetch TIPCOFFSET of (fetch IMAGEDATA of DATUM)) (REPLACE TIPCOFFSET OF (fetch IMAGEDATA of DATUM) 
+with NEWVALUE)) (* ; "The offset into the current piece, as of the last page cross.") (CURRENTLOOKS (
+fetch F10 of DATUM) (replace F10 of DATUM with NEWVALUE)) (* ; 
+"The CHARLOOKS that are currently applicable to characters being taken from the stream.") (
+CURRENTPARALOOKS (fetch TICURPARALOOKS of (fetch IMAGEDATA of DATUM)) (REPLACE TICURPARALOOKS OF (
+fetch IMAGEDATA of DATUM) with NEWVALUE)) (* ; 
+"The FMTSPEC that is currently applicable to characters being taken from the stream.") (
+CURRENTIMAGESTREAM (fetch TICURIMAGESTREAM of (fetch IMAGEDATA of DATUM)) (REPLACE TICURIMAGESTREAM OF
+ (fetch IMAGEDATA of DATUM) with NEWVALUE) (* ; 
+"The image stream that this text is being put onto;  used for scaling decisions")) (LOOKSUPDATEFN (
+fetch TILOOKSUPDATEFN of (fetch IMAGEDATA of DATUM)) (REPLACE TILOOKSUPDATEFN OF (fetch IMAGEDATA of 
+DATUM) with NEWVALUE)) (* ; "Function to be called each time character looks change.") (FATSTREAMP (
+fetch F4 of DATUM) (REPLACE F4 OF DATUM WITH NEWVALUE)) (* ; 
+"T if the current piece is 16 bit characters.")) (CREATE (create STREAM using \TEXTOFD IMAGEDATA _ (
+create TEXTIMAGEDATA))))
+(/DECLAREDATATYPE (QUOTE PIECE) (QUOTE (POINTER POINTER POINTER POINTER POINTER FULLXPOINTER POINTER 
+POINTER FLAG POINTER FLAG FLAG XPOINTER)) (QUOTE ((PIECE 0 POINTER) (PIECE 2 POINTER) (PIECE 4 POINTER
+) (PIECE 6 POINTER) (PIECE 8 POINTER) (PIECE 10 FULLXPOINTER) (PIECE 12 POINTER) (PIECE 14 POINTER) (
+PIECE 14 (FLAGBITS . 0)) (PIECE 16 POINTER) (PIECE 16 (FLAGBITS . 0)) (PIECE 16 (FLAGBITS . 16)) (
+PIECE 18 XPOINTER))) (QUOTE 20))
+(/DECLAREDATATYPE (QUOTE TEXTOBJ) (QUOTE (POINTER POINTER POINTER POINTER POINTER POINTER POINTER 
+POINTER POINTER FLAG POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER 
+POINTER POINTER POINTER POINTER FLAG FULLXPOINTER POINTER POINTER POINTER POINTER POINTER FLAG POINTER
+ FLAG FLAG FLAG FLAG POINTER POINTER POINTER POINTER POINTER POINTER FLAG POINTER FULLXPOINTER POINTER
+ POINTER POINTER POINTER POINTER POINTER POINTER FLAG FLAG POINTER POINTER POINTER)) (QUOTE ((TEXTOBJ 
+0 POINTER) (TEXTOBJ 2 POINTER) (TEXTOBJ 4 POINTER) (TEXTOBJ 6 POINTER) (TEXTOBJ 8 POINTER) (TEXTOBJ 10
+ POINTER) (TEXTOBJ 12 POINTER) (TEXTOBJ 14 POINTER) (TEXTOBJ 16 POINTER) (TEXTOBJ 16 (FLAGBITS . 0)) (
+TEXTOBJ 18 POINTER) (TEXTOBJ 20 POINTER) (TEXTOBJ 22 POINTER) (TEXTOBJ 24 POINTER) (TEXTOBJ 26 POINTER
+) (TEXTOBJ 28 POINTER) (TEXTOBJ 30 POINTER) (TEXTOBJ 32 POINTER) (TEXTOBJ 34 POINTER) (TEXTOBJ 36 
+POINTER) (TEXTOBJ 38 POINTER) (TEXTOBJ 40 POINTER) (TEXTOBJ 42 POINTER) (TEXTOBJ 44 POINTER) (TEXTOBJ 
+44 (FLAGBITS . 0)) (TEXTOBJ 46 FULLXPOINTER) (TEXTOBJ 48 POINTER) (TEXTOBJ 50 POINTER) (TEXTOBJ 52 
+POINTER) (TEXTOBJ 54 POINTER) (TEXTOBJ 56 POINTER) (TEXTOBJ 56 (FLAGBITS . 0)) (TEXTOBJ 58 POINTER) (
+TEXTOBJ 58 (FLAGBITS . 0)) (TEXTOBJ 58 (FLAGBITS . 16)) (TEXTOBJ 58 (FLAGBITS . 32)) (TEXTOBJ 58 (
+FLAGBITS . 48)) (TEXTOBJ 60 POINTER) (TEXTOBJ 62 POINTER) (TEXTOBJ 64 POINTER) (TEXTOBJ 66 POINTER) (
+TEXTOBJ 68 POINTER) (TEXTOBJ 70 POINTER) (TEXTOBJ 70 (FLAGBITS . 0)) (TEXTOBJ 72 POINTER) (TEXTOBJ 74 
+FULLXPOINTER) (TEXTOBJ 76 POINTER) (TEXTOBJ 78 POINTER) (TEXTOBJ 80 POINTER) (TEXTOBJ 82 POINTER) (
+TEXTOBJ 84 POINTER) (TEXTOBJ 86 POINTER) (TEXTOBJ 88 POINTER) (TEXTOBJ 88 (FLAGBITS . 0)) (TEXTOBJ 88 
+(FLAGBITS . 16)) (TEXTOBJ 90 POINTER) (TEXTOBJ 92 POINTER) (TEXTOBJ 94 POINTER))) (QUOTE 96))
+(/DECLAREDATATYPE (QUOTE TEXTIMAGEDATA) (QUOTE (POINTER POINTER POINTER POINTER)) (QUOTE ((
+TEXTIMAGEDATA 0 POINTER) (TEXTIMAGEDATA 2 POINTER) (TEXTIMAGEDATA 4 POINTER) (TEXTIMAGEDATA 6 POINTER)
+)) (QUOTE 8))
+(DEFOPTIMIZER TEXTPROP (TEXTOBJ PROP &OPTIONAL (VAL NIL WRITING)) (* ;; "compiles calls to TEXTPROP") 
+(COND ((NOT (LISTP PROP)) (* ; "property is not quoted.") (QUOTE IGNOREMACRO)) ((NOT (EQ (CAR PROP) (
+QUOTE QUOTE))) (* ; "property is not quoted.") (QUOTE IGNOREMACRO)) ((NOT WRITING) (* ; 
+"fetching a TEXTPROP property.") (SELECTQ (CADR PROP) ((READONLY READ-ONLY) (BQUOTE (fetch (TEXTOBJ 
+TXTREADONLY) of (TEXTOBJ (\, TEXTOBJ))))) ((BEING-EDITED ACTIVE) (BQUOTE (fetch (TEXTOBJ TXTEDITING) 
+of (TEXTOBJ (\, TEXTOBJ))))) ((NO-NS-CHARS NONSCHARS NO-NSCHARS) (BQUOTE (fetch (TEXTOBJ TXTNONSCHARS)
+ of (TEXTOBJ (\, TEXTOBJ))))) (BQUOTE (LISTGET (fetch (TEXTOBJ EDITPROPS) of (TEXTOBJ (\, TEXTOBJ))) (
+\, PROP))))) (T (* ; "storing a window property") (SELECTQ (CADR PROP) ((READONLY READ-ONLY) (BQUOTE (
+REPLACE (TEXTOBJ TXTREADONLY) OF (TEXTOBJ (\, TEXTOBJ)) WITH (\, VAL)))) ((BEING-EDITED ACTIVE) (
+BQUOTE (REPLACE (TEXTOBJ TXTEDITING) OF (TEXTOBJ (\, TEXTOBJ)) WITH (\, VAL)))) ((NO-NS-CHARS 
+NONSCHARS NO-NSCHARS) (BQUOTE (REPLACE (TEXTOBJ TXTNONSCHARS) OF (TEXTOBJ (\, TEXTOBJ)) WITH (\, VAL))
+)) (BQUOTE (LET* (($$TEXTOBJ$$ (TEXTOBJ (\, TEXTOBJ))) ($$PROPLST$$ (FETCH EDITPROPS OF $$TEXTOBJ$$)))
+ (COND ($$PROPLST$$ (LISTPUT $$PROPLST$$ (\, PROP) (\, VAL))) (T (REPLACE EDITPROPS OF $$TEXTOBJ$$ 
+WITH (LIST (\, PROP) (\, VAL)))))))))))
+(RECORD PAGEFORMATTINGSTATE ((* ;; "Contains the state for a TEdit page-formatting job.") PAGE# (* ; 
+"The current page number.  Counted from 1") FIRSTPAGE (* ;; 
+"T if the current page is the 'first page' .  Is set initially, and can be set again by the user at will.  Gets reset after each page image is printed."
+) MINPAGE# (* ; "The page # of the first page to be printed, or NIL") MAXPAGE# (* ; 
+"The page # of the last page to be printed, or NIL") STATE (* ; "One of FORMATTING or SEARCHING.") 
+REQUIREDREGIONTYPE (* ; 
+"If STATE is SEARCHING, the kind of box we're looking for.  If STATE is :SEARCHING-FOR-EQUIVALENT-PAGE, this is the page count for the matching page."
+) MAINSTREAM (* ; "The principal textobj/stream source") CHNO (* ; "Our position in that stream") 
+PRESSREGION (* ; "The press code's REGION info.") PAGEHEADINGS (* ; 
+"The list of current values to be printed, indexed by heading type") PAGE#GENERATOR (* ; 
+"List of page numbers;  later, maybe, a function to generate page numbers.  Used to fill in PAGE#TEXT, below"
+) PAGE#TEXT (* ; 
+"If special page numbers are in use, this is the place to take them from.  PAGE# is still used for recto/verso decisions &c"
+) PAGEISRECTO (* ; "T if this is a recto page, NIL if it's a VERSO page.") PAGEFOOTNOTELINES (* ; 
+"A list of extant footnote lines that should appear at the next opportunity") PAGEFLOATINGTOPLINES (* 
+; "A list of lines that should float to the top of the next available place") PAGECOUNT (* ; 
+"The number of pages we've formatted so far.") PAGELINECACHE (* ; 
+"A cache for pre-created LINEDESCRIPTOR/THISLINE sets, to avoid the overhead of re-allocating them all the time"
+) NEWPAGELAYOUT (* ; 
+"If we switch page layouts in mid-document, this is where the new layout gets cached until we get started again."
+)) PAGECOUNT _ 0)
+(DATATYPE PAGEREGION ((* ;; 
+"Describe a part of a page for page formatting.  Can be made into compound descriptions.") 
+REGIONFILLMETHOD (* ; "What kind of a region this is -- TEXT, FOLIO, PAGEHEADING, etc.") REGIONSPEC (*
+ ; "The page-relative region this occupies") REGIONLOCALINFO (* ; "A PLIST for local information") (
+REGIONPARENT FULLXPOINTER) (* ; "The parent node for this box, for sub-boxes") REGIONSUBBOXES (* ; 
+"The sub-regions of this region") REGIONTYPE (* ; "A user-settable region type")))
+(/DECLAREDATATYPE (QUOTE PAGEREGION) (QUOTE (POINTER POINTER POINTER FULLXPOINTER POINTER POINTER)) (
+QUOTE ((PAGEREGION 0 POINTER) (PAGEREGION 2 POINTER) (PAGEREGION 4 POINTER) (PAGEREGION 6 FULLXPOINTER
+) (PAGEREGION 8 POINTER) (PAGEREGION 10 POINTER))) (QUOTE 12))
+(DATATYPE CHARLOOKS ((* ;; "Describes the appearance (%"Looks%") of characters in a TEdit document.") 
+CLFONT (* ; "The font descriptor for these characters") CLNAME (* ;; 
+"Name of the font (e.g., HELVETICA) THIS FIELD IS A HINT, OR FOR USE IN CHARLOOKS-BUILDING CODE.  USE FONTPROP TO GET THE RIGHT VALUE FROM CLFONT."
+) CLSIZE (* ; "Font size, in points") (CLITAL FLAG) (* ; "T if the characters are italic, else NIL") (
+CLBOLD FLAG) (* ; "T if the characters are bold, else NIL") (CLULINE FLAG) (* ; 
+"T if the characters are to be underscored, else NIL") (CLOLINE FLAG) (* ; 
+"T if the characters are to be overscored, else NIL") (CLSTRIKE FLAG) (* ; 
+"T if the characters are to be struck thru, else nil.") CLOFFSET (* ; 
+"A superscripting offset in points (?) else NIL (SUBSCRIPTING IF NEGATIVE.)") (CLSMALLCAP FLAG) (* ; 
+"T if small caps, else NIL") (CLINVERTED FLAG) (* ; 
+"T if the characters are to be shown white-on-black") (CLPROTECTED FLAG) (* ; 
+"T if chars can't be selected, else NIL") (CLINVISIBLE FLAG) (* ; 
+"T if TEDIT is to ignore these chars;  else NIL") (CLSELHERE FLAG) (* ;; 
+"T if TEDIT can put selection after this char (for menu blanks) else NIL;  anything typed after this char will NOT BE PROTECTED."
+) (CLCANCOPY FLAG) (* ;; 
+"T if this text can be selected for copying, even tho protected (it will become unprotected after the copy;  for Dribble/TTY interface)"
+) CLSTYLE (* ; "The style to be used in marking these characters;  overridden by the other fields") 
+CLUSERINFO (* ; "Any information that an outsider wants to include") CLLEADER (* ; 
+"For creating dotted and other kinds of leader") CLRULES (* ;; 
+"For arbitrarily-places horizontal rules.  List of pairs, of (widthinpts  . offsetfrombaselineinpts).  Should be taken account of in ascent/descent calcs."
+) (CLMARK FLAG) (* ;; 
+"Used for a mark-&-sweep of looks at PUT time -- T means this set of looks really IS in use in the document"
+)) CLOFFSET _ 0)
+(DATATYPE FMTSPEC ((* ;; "Describe the paragraph formatting for a paragraph in a TEdit document.") 
+1STLEFTMAR (* ; "Left margin of the first line of the paragraph") LEFTMAR (* ; 
+"Left margin of the rest of the lines in the paragraph") RIGHTMAR (* ; 
+"Right margin for the paragraph") LEADBEFORE (* ; 
+"Leading above the paragraph's first line, in points") LEADAFTER (* ; 
+"Leading below the paragraph's bottom line, in points.  NOT IMPLEMENTED.") LINELEAD (* ; 
+"Leading between lines, in points.  Actually, this space is added BELOW each line in the para.") 
+FMTBASETOBASE (* ; 
+"The baseline-to-baseline spacing between lines in this paragraph.  THIS OVERRIDES THE LINE LEADING") 
+TABSPEC (* ; "The list of tabs for this paragraph, including CAR for a default tab width") QUAD (* ; 
+"How the para is formatted: one of LEFT, RIGHT, CENTERED, JUSTIFIED") FMTSTYLE (* ; 
+"The STYLE that controls this paragraph's appearance") FMTCHARSTYLES (* ; 
+"The characterstyles that control the appearance of characters in this para (maybe?  may be part of the fmtstyle.)"
+) FMTUSERINFO (* ; "Space for a PLIST of user info") FMTSPECIALX (* ; 
+"A special horizontal location on the printed page for this para.") FMTSPECIALY (* ; 
+"A special vertical location on the page for this para") (FMTHEADINGKEEP FLAG) (* ; 
+"This para should be kept with the top line or so of the next para..") FMTPARATYPE (* ; 
+"What kind of para this is: TEXT, PAGEHEADING, whatever") FMTPARASUBTYPE (* ; 
+"Sub type of the type, e.g., what KIND of page heading this is.") FMTNEWPAGEBEFORE (* ; 
+"Start a new box (if T) or back up the page formatting tree to make a new box of the type named in the value -- by going the least distance back up the tree, then back down until you find that kind of box."
+) FMTNEWPAGEAFTER (* ; "Similarly") FMTKEEP (* ; 
+"For information about how this paragraph is to be kept with other paragraphs.") FMTCOLUMN (* ; 
+"For setting up side-by-side paragraphs easily ala BravoX") FMTVERTRULES (* ; 
+"For Keeping track of vertical rules in force") (FMTMARK FLAG) (* ; 
+"Used to keep track of which PARALOOKSs are really being used -- a mark & collect is done just before a PUT, so that only 'real' PARALOOKSs make it into the file"
+) (* ; 
+"Used for a mark&sweep of para looks at PUT time -- T means this looks really IS in use in the document, so it makes sense to save it on the file."
+) (FMTHARDCOPY FLAG) (* ; "T if this paragraph is to be displayed in hardcopy-format.") FMTREVISED (* 
+; 
+"T (or perhaps a revision level or revision-mark spec??) if this paragraph is to be marked as changed on output."
+)) TABSPEC _ (CONS NIL NIL))
+(DATATYPE PENDINGTAB ((* ;; 
+"The data structure for a tab, within the line formatter, that we haven't finished dealing with yet, e.g. a centered tab where you need to wait for AFTER the centered text to do the formatting."
+) PTNEWTX (* ;; 
+"An updated TX, being passed back to the line formatter.  This results from the resolution of an old RIGHT, CENTERED, or DECIMAL tab, which changed the width of a prior tab."
+) PTOLDTAB (* ; "The pending tab") PTTYPE (* ; "Its tab type") PTTABX (* ; "Its nominal X position") (
+PTWBASE FULLXPOINTER) (* ; 
+"The WBASE for its width, for updating when we've figured out how wide the tab really is") PTOLDTX (* 
+; "The TX as of when the tab was encountered.")))
+(/DECLAREDATATYPE (QUOTE CHARLOOKS) (QUOTE (POINTER POINTER POINTER FLAG FLAG FLAG FLAG FLAG POINTER 
+FLAG FLAG FLAG FLAG FLAG FLAG POINTER POINTER POINTER POINTER FLAG)) (QUOTE ((CHARLOOKS 0 POINTER) (
+CHARLOOKS 2 POINTER) (CHARLOOKS 4 POINTER) (CHARLOOKS 4 (FLAGBITS . 0)) (CHARLOOKS 4 (FLAGBITS . 16)) 
+(CHARLOOKS 4 (FLAGBITS . 32)) (CHARLOOKS 4 (FLAGBITS . 48)) (CHARLOOKS 2 (FLAGBITS . 0)) (CHARLOOKS 6 
+POINTER) (CHARLOOKS 6 (FLAGBITS . 0)) (CHARLOOKS 6 (FLAGBITS . 16)) (CHARLOOKS 6 (FLAGBITS . 32)) (
+CHARLOOKS 6 (FLAGBITS . 48)) (CHARLOOKS 2 (FLAGBITS . 16)) (CHARLOOKS 2 (FLAGBITS . 32)) (CHARLOOKS 8 
+POINTER) (CHARLOOKS 10 POINTER) (CHARLOOKS 12 POINTER) (CHARLOOKS 14 POINTER) (CHARLOOKS 14 (FLAGBITS
+ . 0)))) (QUOTE 16))
+(/DECLAREDATATYPE (QUOTE FMTSPEC) (QUOTE (POINTER POINTER POINTER POINTER POINTER POINTER POINTER 
+POINTER POINTER POINTER POINTER POINTER POINTER POINTER FLAG POINTER POINTER POINTER POINTER POINTER 
+POINTER POINTER FLAG FLAG POINTER)) (QUOTE ((FMTSPEC 0 POINTER) (FMTSPEC 2 POINTER) (FMTSPEC 4 POINTER
+) (FMTSPEC 6 POINTER) (FMTSPEC 8 POINTER) (FMTSPEC 10 POINTER) (FMTSPEC 12 POINTER) (FMTSPEC 14 
+POINTER) (FMTSPEC 16 POINTER) (FMTSPEC 18 POINTER) (FMTSPEC 20 POINTER) (FMTSPEC 22 POINTER) (FMTSPEC 
+24 POINTER) (FMTSPEC 26 POINTER) (FMTSPEC 26 (FLAGBITS . 0)) (FMTSPEC 28 POINTER) (FMTSPEC 30 POINTER)
+ (FMTSPEC 32 POINTER) (FMTSPEC 34 POINTER) (FMTSPEC 36 POINTER) (FMTSPEC 38 POINTER) (FMTSPEC 40 
+POINTER) (FMTSPEC 40 (FLAGBITS . 0)) (FMTSPEC 40 (FLAGBITS . 16)) (FMTSPEC 42 POINTER))) (QUOTE 44))
+(/DECLAREDATATYPE (QUOTE PENDINGTAB) (QUOTE (POINTER POINTER POINTER POINTER FULLXPOINTER POINTER)) (
+QUOTE ((PENDINGTAB 0 POINTER) (PENDINGTAB 2 POINTER) (PENDINGTAB 4 POINTER) (PENDINGTAB 6 POINTER) (
+PENDINGTAB 8 FULLXPOINTER) (PENDINGTAB 10 POINTER))) (QUOTE 12))
+(TYPERECORD MB.3STATE ((* ;; "Describes a 3-state menu button.") MBLABEL (* ; 
+"Label for the button on the screen") MBFONT (* ; "Font the label text should appear in") 
+MBCHANGESTATEFN (* ; "Function to call when the button's state changes") MBINITSTATE (* ; 
+"Button's initial state.")) MBFONT _ (FONTCREATE (QUOTE HELVETICA) 8 (QUOTE BOLD)))
+(TYPERECORD MB.BUTTON (MBLABEL MBBUTTONEVENTFN MBFONT) MBBUTTONEVENTFN _ (QUOTE MB.DEFAULTBUTTON.FN) 
+MBFONT _ (FONTCREATE (QUOTE HELVETICA) 8 (QUOTE BOLD)))
+(TYPERECORD MB.INSERT (MBINITENTRY))
+(TYPERECORD MB.MARGINBAR (ignoredfield))
+(TYPERECORD MB.NWAY (MBBUTTONS MBFONT MBCHANGESTATEFN MBINITSTATE MBMAXITEMSPERLINE) MBFONT _ (
+FONTCREATE (QUOTE HELVETICA) 8 (QUOTE BOLD)))
+(TYPERECORD MB.TEXT (MBSTRING MBFONT))
+(TYPERECORD MB.TOGGLE (MBTEXT MBFONT MBCHANGESTATEFN MBINITSTATE) MBFONT _ (FONTCREATE (QUOTE 
+HELVETICA) 8 (QUOTE BOLD)))
+(DEFMACRO WITHOUT-UPDATES (TEXTOBJ SCRATCHSEL &BODY BODY) (* ;; 
+"For TEdit windows, run BODY without updating the edit window for TEXTOBJ.  This is useful if you're making a log of changes to a document at one time, where the changes are in essence atomic, and you don't need to see intermediate results.  It's also a good bit faster than constant updating."
+) (* ;; "TEXTOBJ is the TEXTOBJ for the document you'll be modifying.") (* ;; 
+"SCRATCHSEL should be the scratch selection (often used in this work)") (BQUOTE (LET ((OLD-UNWIND-FLAG
+ (FETCH (TEXTOBJ TXTDON'TUPDATE) OF (\, TEXTOBJ)))) (CL:UNWIND-PROTECT (PROGN (replace (TEXTOBJ 
+TXTDON'TUPDATE) of (\, TEXTOBJ) with T) (\,@ BODY)) (\SHOWSEL (\, SCRATCHSEL) NIL NIL) (replace SET of
+ (\, SCRATCHSEL) with NIL) (\TEDIT.MARK.LINES.DIRTY (\, TEXTOBJ) 1 (fetch (TEXTOBJ TEXTLEN) of (\, 
+TEXTOBJ))) (replace (TEXTOBJ TXTDON'TUPDATE) of (\, TEXTOBJ) with OLD-UNWIND-FLAG) (
+TEDIT.UPDATE.SCREEN (\, TEXTOBJ))))))
+(RECORD TEDITHISTORYEVENT ((* ;; "Describes one event on the TEdit edit history list.") THACTION (* ; 
+"A LITATOM, specifying what the event was") THPOINT (* ; "Was the selection to the left or right?") 
+THLEN (* ; "The # of chars involved") THCH# (* ; "The starting ch#") THFIRSTPIECE (* ; 
+"First piece involved") THOLDINFO (* ; "Old info, for undo") THAUXINFO (* ; 
+"Auxiliary info about the event, primarily for redo") THTEXTOBJ (* ;; 
+"Place to remember a second textobj, for those like MOVE who need to remember both a source and a destination."
+)) THPOINT _ (QUOTE LEFT))
+(/DECLAREDATATYPE (QUOTE TEDITCARET) (QUOTE (POINTER POINTER POINTER POINTER POINTER POINTER POINTER 
+POINTER POINTER POINTER POINTER)) (QUOTE ((TEDITCARET 0 POINTER) (TEDITCARET 2 POINTER) (TEDITCARET 4 
+POINTER) (TEDITCARET 6 POINTER) (TEDITCARET 8 POINTER) (TEDITCARET 10 POINTER) (TEDITCARET 12 POINTER)
+ (TEDITCARET 14 POINTER) (TEDITCARET 16 POINTER) (TEDITCARET 18 POINTER) (TEDITCARET 20 POINTER))) (
+QUOTE 22))
+(DATATYPE PCTNODE (CHNUM (* ; "Character #of piece in this node.") PCE (* ; "PIECE ") LO (* ; 
+"Subtree these nodes' ch#are less than this node.") HI (* ; 
+" Subtree these nodes' ch#are more than this node.") BF (* ; "Balance factor.") (* ; 
+"1: Right(HI) Subtree is higher than left(lo) subtree.") (* ; 
+"0: Right subtree and left subtree are same height") (* ; 
+"-1: Right(HI) Subtree is shorter than left(lo) subtree.") RANK (* ; "(# of nodes in left subtree) +1"
+)) CHNUM _ 0 BF _ 0 RANK _ 1)
+(/DECLAREDATATYPE (QUOTE PCTNODE) (QUOTE (POINTER POINTER POINTER POINTER POINTER POINTER)) (QUOTE ((
+PCTNODE 0 POINTER) (PCTNODE 2 POINTER) (PCTNODE 4 POINTER) (PCTNODE 6 POINTER) (PCTNODE 8 POINTER) (
+PCTNODE 10 POINTER))) (QUOTE 12))
+(PUTPROPS TEDITDCL COPYRIGHT ("Venue" 1986 1987 1988 1989 1990 1991 1993 1994 2021))
+NIL
diff --git a/library/TEDITFILE b/library/TEDITFILE
index 1019f714..945a911e 100644
--- a/library/TEDITFILE
+++ b/library/TEDITFILE
@@ -1,13 +1,15 @@
 (DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10)
-(FILECREATED "19-May-2001 11:45:53" {DSK}<project>medley3.5>library>TEDITFILE.;5 245586 
+(FILECREATED "30-Apr-2021 14:46:41" 
+{DSK}<Users>kaplan>Local>medley3.5>git-medley>library>TEDITFILE.;8 246290 
 
-      changes to%:  (FNS TEDIT.GET TEDIT.INCLUDE)
+      changes to%:  (FNS TEDIT.PUT.PCTB)
 
-      previous date%: "26-Dec-2000 15:18:25" {DSK}<project>medley3.5>library>TEDITFILE.;4)
+      previous date%: "30-Apr-2021 13:43:24" 
+{DSK}<Users>kaplan>Local>medley3.5>git-medley>library>TEDITFILE.;7)
 
 
 (* ; "
-Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1999, 2000, 2001 by Venue & Xerox Corporation.  All rights reserved.
+Copyright (c) 1983-1994, 1999-2001, 2021 by Venue & Xerox Corporation.
 ")
 
 (PRETTYCOMPRINT TEDITFILECOMS)
@@ -83,7 +85,7 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
 
 (TEDIT.BUILD.PCTB
   [LAMBDA (TEXT TEXTOBJ START END DEFAULTLOOKS DEFAULTPARALOOKS CLEARGET?)
-                                                             (* ; "Edited 11-Jun-99 14:51 by rmk:")
+                                                            (* ; "Edited 29-Apr-2021 22:52 by rmk:")
                                                              (* ; "Edited 11-Jun-99 14:37 by rmk:")
                                                              (* ; "Edited 19-Apr-93 13:46 by jds")
                                                              (* ; 
@@ -160,10 +162,13 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
 
                   ))
               (SETQ PCCOUNT (\TEDIT.FORMATTEDP1 TEXT END))
+
+              (* ;; "RMK:  Domestic EOL is now LF, so changed from CR")
+
               (COND
                  ((AND (NOT PCCOUNT)
                        (NEQ (fetch (STREAM EOLCONVENTION) of TEXT)
-                            CR.EOLC))
+                            LF.EOLC))
 
                   (* ;; "This is an UNFORMATTED file, and it has a foreign EOL convention.  Convert it, and save the converted copy locally.")
 
@@ -1348,7 +1353,7 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
           (RETURN OFILE])
 
 (TEDIT.PUT.PCTB
-  [LAMBDA (TEXTOBJ OFILE UNFORMATTED? SEPARATEFORMAT)    (* ; "Edited 11-Jun-99 15:55 by rmk:")
+  [LAMBDA (TEXTOBJ OFILE UNFORMATTED? SEPARATEFORMAT)   (* ; "Edited 30-Apr-2021 14:46 by rmk:")
                                                              (* ; "Edited 19-May-99 21:58 by rmk:")
                                                   (* ; 
                                                 "Edited 27-May-93 16:00 by sybalsky:mv:envos")
@@ -1378,10 +1383,13 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
                                   (fetch (PIECE PLOOKS) of PC))
                              (fetch (TEXTOBJ DEFAULTCHARLOOKS) of TEXTOBJ)
                              TEDIT.DEFAULT.CHARLOOKS))       (* ; "Starting looks")
+
+     (* ;; "RMK:  CHANGED DEFAULT FROM CR TO LF")
+
           (COND
              ((NEQ (fetch (STREAM EOLCONVENTION) of OFILE)
-                   CR.EOLC)                                  (* ; 
-                                          "This file is on a non-CR host;  make a note to cache it")
+                   LF.EOLC)                                  (* ; 
+                                          "This file is on a non-LF host;  make a note to cache it")
               (SETQ TRUEFILE OFILE)                          (* ; 
                                                           "Remember where the file should wind up.")
               [SETQ OFILE (OPENSTREAM '{NODIRCORE} 'BOTH 'NEW '((TYPE TEXT]
@@ -1604,17 +1612,26 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
                           ((SETQ PSTR (fetch (PIECE PSTR) of PC))
                                                              (* ; 
                                                            "It's in a string.  Just print it.")
-                           (COND
-                              [(fetch (PIECE PFATP) of PC)
-                                                             (* ; 
-                                            "The string is fat: Copy twice as many bytes as chars.")
-                               (for I from 1 to (fetch (PIECE PLEN) of PC)
-                                  as CH instring PSTR do (\BOUT OFILE (\CHARSET CH))
-                                                                (\BOUT OFILE (\CHAR8CODE CH]
-                              (T                             (* ; 
-                                                   "The string is thin.  Just copy it to the file.")
-                                 (for I from 1 to (fetch (PIECE PLEN) of PC)
-                                    as CH instring PSTR do (\BOUT OFILE CH]
+
+                           (* ;; 
+                         "RMK: BOUT ptimizations would miss external formats and EOL conventions")
+
+                           (for I from 1 to (fetch (PIECE PLEN) of PC)
+                              as CH instring PSTR do (\OUTCHAR OFILE CH))
+                                                             (* (COND ((fetch (PIECE PFATP) of PC)
+                                                           (* ; 
+                                            "The string is fat: Copy twice as many bytes as chars.")
+                                                           (for I from 1 to (fetch
+                                                           (PIECE PLEN) of PC) as CH instring 
+                                                           PSTR do (\BOUT OFILE
+                                                           (\CHARSET CH)) (\BOUT OFILE
+                                                           (\CHAR8CODE CH))))
+                                                           (T (* ; 
+                                                   "The string is thin.  Just copy it to the file.")
+                                                           (for I from 1 to (fetch
+                                                           (PIECE PLEN) of PC) as CH instring 
+                                                           PSTR do (\BOUT OFILE CH)))))
+                           ]
                        [COND
                           ((AND (NOT CACHE)
                                 (RANDACCESSP OFILE))         (* ; 
@@ -3633,27 +3650,27 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
               (RPLACD TABSPEC TABS])
 )
 (PUTPROPS TEDITFILE COPYRIGHT ("Venue & Xerox Corporation" 1983 1984 1985 1986 1987 1988 1989 1990 
-1991 1992 1993 1994 1999 2000 2001))
+1991 1992 1993 1994 1999 2000 2001 2021))
 (DECLARE%: DONTCOPY
-  (FILEMAP (NIL (3099 57926 (TEDIT.BUILD.PCTB 3109 . 37483) (\TEDIT.CONVERT.FOREIGN.FORMAT 37485 . 38926
-) (TEDIT.FORMATTEDFILEP 38928 . 42792) (TEDIT.GET 42794 . 51610) (TEDIT.PARSE.PAGEFRAMES1 51612 . 
-53318) (\ARBIN 53320 . 53941) (\ATMIN 53943 . 54272) (\DWIN 54274 . 54552) (\STRINGIN 54554 . 55151) (
-\TEDIT.FORMATTEDP1 55153 . 57417) (\TEDIT.SET.WINDOW 57419 . 57924)) (57962 78490 (TEDIT.INCLUDE 57972
- . 69359) (TEDIT.RAW.INCLUDE 69361 . 78488)) (78524 122097 (TEDIT.PUT 78534 . 88907) (TEDIT.PUT.PCTB 
-88909 . 115833) (\TEDIT.PUTRESET 115835 . 116081) (TEDIT.PUT.PIECE.DESCRIPTOR 116083 . 118546) (
-\ARBOUT 118548 . 119748) (\ATMOUT 119750 . 120265) (\DWOUT 120267 . 120550) (\STRINGOUT 120552 . 
-121004) (\TEDIT-OPEN-FONT-FILE 121006 . 122095)) (122098 132610 (\TEDIT.GET.CHARLOOKS.LIST 122108 . 
-122513) (\TEDIT.GET.SINGLE.CHARLOOKS 122515 . 125560) (\TEDIT.PUT.CHARLOOKS.LIST 125562 . 127357) (
-\TEDIT.PUT.SINGLE.CHARLOOKS 127359 . 132608)) (132611 146890 (\TEDIT.GET.PARALOOKS.LIST 132621 . 
-133034) (\TEDIT.GET.SINGLE.PARALOOKS 133036 . 139430) (\TEDIT.PUT.PARALOOKS.LIST 139432 . 140426) (
-\TEDIT.PUT.SINGLE.PARALOOKS 140428 . 146888)) (147198 208459 (TEDIT.BUILD.PCTB2 147208 . 160564) (
-\TEDIT.GET.CHARLOOKS.LIST2 160566 . 160973) (\TEDIT.GET.SINGLE.CHARLOOKS2 160975 . 163887) (
-\TEDIT.PUT.SINGLE.PARALOOKS2 163889 . 168603) (\TEDIT.PUT.SINGLE.CHARLOOKS2 168605 . 173101) (
-\TEDIT.GET.PARALOOKS.LIST2 173103 . 173510) (\TEDIT.GET.SINGLE.PARALOOKS2 173512 . 178100) (
-TEDIT.PUT.PCTB2 178102 . 205763) (\TEDIT.PUT.CHARLOOKS.LIST2 205765 . 207562) (
-\TEDIT.PUT.PARALOOKS.LIST2 207564 . 208457)) (208536 229660 (TEDIT.BUILD.PCTB1 208546 . 218736) (
-TEDIT.GET.PAGEFRAMES1 218738 . 218993) (\TEDIT.GET.CHARLOOKS1 218995 . 222545) (\TEDIT.GET.PARALOOKS1 
-222547 . 227128) (TEDIT.GET.OBJECT1 227130 . 229658)) (229720 245426 (TEDIT.BUILD.PCTB0 229730 . 
-235437) (TEDIT.GET.CHARLOOKS0 235439 . 239458) (TEDIT.GET.OBJECT0 239460 . 241988) (
-TEDIT.GET.PARALOOKS0 241990 . 245424)))))
+  (FILEMAP (NIL (3052 57958 (TEDIT.BUILD.PCTB 3062 . 37515) (\TEDIT.CONVERT.FOREIGN.FORMAT 37517 . 38958
+) (TEDIT.FORMATTEDFILEP 38960 . 42824) (TEDIT.GET 42826 . 51642) (TEDIT.PARSE.PAGEFRAMES1 51644 . 
+53350) (\ARBIN 53352 . 53973) (\ATMIN 53975 . 54304) (\DWIN 54306 . 54584) (\STRINGIN 54586 . 55183) (
+\TEDIT.FORMATTEDP1 55185 . 57449) (\TEDIT.SET.WINDOW 57451 . 57956)) (57994 78522 (TEDIT.INCLUDE 58004
+ . 69391) (TEDIT.RAW.INCLUDE 69393 . 78520)) (78556 122796 (TEDIT.PUT 78566 . 88939) (TEDIT.PUT.PCTB 
+88941 . 116532) (\TEDIT.PUTRESET 116534 . 116780) (TEDIT.PUT.PIECE.DESCRIPTOR 116782 . 119245) (
+\ARBOUT 119247 . 120447) (\ATMOUT 120449 . 120964) (\DWOUT 120966 . 121249) (\STRINGOUT 121251 . 
+121703) (\TEDIT-OPEN-FONT-FILE 121705 . 122794)) (122797 133309 (\TEDIT.GET.CHARLOOKS.LIST 122807 . 
+123212) (\TEDIT.GET.SINGLE.CHARLOOKS 123214 . 126259) (\TEDIT.PUT.CHARLOOKS.LIST 126261 . 128056) (
+\TEDIT.PUT.SINGLE.CHARLOOKS 128058 . 133307)) (133310 147589 (\TEDIT.GET.PARALOOKS.LIST 133320 . 
+133733) (\TEDIT.GET.SINGLE.PARALOOKS 133735 . 140129) (\TEDIT.PUT.PARALOOKS.LIST 140131 . 141125) (
+\TEDIT.PUT.SINGLE.PARALOOKS 141127 . 147587)) (147897 209158 (TEDIT.BUILD.PCTB2 147907 . 161263) (
+\TEDIT.GET.CHARLOOKS.LIST2 161265 . 161672) (\TEDIT.GET.SINGLE.CHARLOOKS2 161674 . 164586) (
+\TEDIT.PUT.SINGLE.PARALOOKS2 164588 . 169302) (\TEDIT.PUT.SINGLE.CHARLOOKS2 169304 . 173800) (
+\TEDIT.GET.PARALOOKS.LIST2 173802 . 174209) (\TEDIT.GET.SINGLE.PARALOOKS2 174211 . 178799) (
+TEDIT.PUT.PCTB2 178801 . 206462) (\TEDIT.PUT.CHARLOOKS.LIST2 206464 . 208261) (
+\TEDIT.PUT.PARALOOKS.LIST2 208263 . 209156)) (209235 230359 (TEDIT.BUILD.PCTB1 209245 . 219435) (
+TEDIT.GET.PAGEFRAMES1 219437 . 219692) (\TEDIT.GET.CHARLOOKS1 219694 . 223244) (\TEDIT.GET.PARALOOKS1 
+223246 . 227827) (TEDIT.GET.OBJECT1 227829 . 230357)) (230419 246125 (TEDIT.BUILD.PCTB0 230429 . 
+236136) (TEDIT.GET.CHARLOOKS0 236138 . 240157) (TEDIT.GET.OBJECT0 240159 . 242687) (
+TEDIT.GET.PARALOOKS0 242689 . 246123)))))
 STOP
diff --git a/library/TEDITFILE.LCOM b/library/TEDITFILE.LCOM
index cd9addf3..5c6e88ce 100644
Binary files a/library/TEDITFILE.LCOM and b/library/TEDITFILE.LCOM differ
diff --git a/library/TEDITMENU b/library/TEDITMENU
index 46fe08b5..09d5306a 100644
--- a/library/TEDITMENU
+++ b/library/TEDITMENU
@@ -1,13 +1,15 @@
 (DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10)
-(FILECREATED " 4-Jan-2021 13:48:43" {DSK}<home>larry>ilisp>medley>library>TEDITMENU.;2 275817 
+(FILECREATED "29-Apr-2021 22:44:22" 
+{DSK}<Users>kaplan>Local>medley3.5>git-medley>library>TEDITMENU.;5 275764 
 
       changes to%:  (FNS \TEDIT.MENU.INIT)
 
-      previous date%: "24-Apr-95 12:05:29" {DSK}<home>larry>ilisp>medley>library>TEDITMENU.;1)
+      previous date%: "29-Apr-2021 22:40:33" 
+{DSK}<Users>kaplan>Local>medley3.5>git-medley>library>TEDITMENU.;4)
 
 
 (* ; "
-Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 2021 by Venue & Xerox Corporation.  All rights reserved.
+Copyright (c) 1983-1995, 2021 by Venue & Xerox Corporation.
 ")
 
 (PRETTYCOMPRINT TEDITMENUCOMS)
@@ -17,7 +19,7 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
         (DECLARE%: EVAL@COMPILE DONTCOPY (CONSTANTS (\SCRATCHLEN 64))
                (FILES (LOADCOMP)
                       TEDITDCL))
-        [COMS                                                (* ; "Simple Menu Button support")
+        [COMS                                                (* ; "Simple Menu Button support")
               (FNS MB.BUTTONEVENTINFN MB.DISPLAY MB.SETIMAGE MB.SELFN MB.SIZEFN MB.WHENOPERATEDFN 
                    MB.COPYFN MB.GETFN MB.PUTFN MB.SHOWSELFN MBUTTON.CREATE MBUTTON.CHANGENAME 
                    MBUTTON.FIND.BUTTON MBUTTON.FIND.NEXT.BUTTON MBUTTON.FIND.NEXT.FIELD MBUTTON.INIT
@@ -29,13 +31,13 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
               (DECLARE%: DONTEVAL@LOAD DOCOPY (P (MBUTTON.INIT))
                      (ADDVARS (IMAGEOBJTYPES (TEditMenuButton FILE TEDITMENU GETFN MB.GETFN]
         [COMS 
-              (* ;; 
-            "Three-state (ON-OFF-NEUTRAL) menu buttons, for, e.g., character properties like BOLD")
+              (* ;; 
+            "Three-state (ON-OFF-NEUTRAL) menu buttons, for, e.g., character properties like BOLD")
 
               (FNS MB.CREATE.THREESTATEBUTTON MB.THREESTATE.DISPLAY MB.THREESTATE.SHOWSELFN 
                    MB.THREESTATE.WHENOPERATEDFN MB.THREESTATEBUTTON.FN THREESTATE.INIT)
               (DECLARE%: DONTEVAL@LOAD DOCOPY (P (THREESTATE.INIT]
-        [COMS                                                (* ; "One-of-N Menu button sets")
+        [COMS                                                (* ; "One-of-N Menu button sets")
               (FNS MB.CREATE.NWAYBUTTON MB.NB.DISPLAYFN MB.NB.WHENOPERATEDFN MB.NB.SIZEFN 
                    MB.NWAYBUTTON.SELFN MB.NWAYMENU.NEWBUTTON NWAYBUTTON.INIT MB.NB.PACKITEMS 
                    MB.NWAYBUTTON.ADDITEM)
@@ -43,7 +45,7 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
               (DECLARE%: DONTEVAL@LOAD DOCOPY (P (NWAYBUTTON.INIT))
                      (ADDVARS (IMAGEOBJTYPES (NWayButton FILE TEDITMENU GETFN MB.GETFN]
         [COMS 
-              (* ;; "Two-state, toggling menu buttons.")
+              (* ;; "Two-state, toggling menu buttons.")
 
               (FNS \TEXTMENU.TOGGLE.CREATE \TEXTMENU.TOGGLE.DISPLAY \TEXTMENU.TOGGLE.SHOWSELFN 
                    \TEXTMENU.TOGGLE.WHENOPERATEDFN \TEXTMENU.TOGGLEFN \TEXTMENU.TOGGLE.INIT 
@@ -52,7 +54,7 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
               (DECLARE%: DONTEVAL@LOAD DOCOPY (P (\TEXTMENU.TOGGLE.INIT))
                      (ADDVARS (IMAGEOBJTYPES (ToggleButton FILE TEDITMENU GETFN MB.GETFN]
         [COMS 
-              (* ;; "Margin Setting and display")
+              (* ;; "Margin Setting and display")
 
               (FNS DRAWMARGINSCALE MARGINBAR MARGINBAR.CREATE MB.MARGINBAR.SELFN MB.MARGINBAR.SIZEFN
                    MB.MARGINBAR.DISPLAYFN MDESCALE MSCALE MB.MARGINBAR.SHOWTAB MB.MARGINBAR.TABTRACK
@@ -64,11 +66,11 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
               (DECLARE%: DONTEVAL@LOAD DOCOPY (P (MARGINBAR.INIT))
                      (ADDVARS (IMAGEOBJTYPES (MarginRuler FILE TEDITMENU GETFN MB.GETFN]
         (COMS 
-              (* ;; "Text menu creation and support")
+              (* ;; "Text menu creation and support")
 
               (FNS \TEXTMENU.START \TEXTMENU.DOC.CREATE TEXTMENU.CLOSEFN)
               (BITMAPS TEXTMENUICON TEXTMENUICONMASK))
-        [COMS                                                (* ; "TEdit-specific support")
+        [COMS                                                (* ; "TEdit-specific support")
               (FNS \TEDITMENU.CREATE \TEDIT.EXPANDED.MENU MB.DEFAULTBUTTON.FN 
                    \TEDITMENU.RECORD.UNFORMATTED MB.DEFAULTBUTTON.ACTIONFN)
               (FNS \TEDIT.CHARLOOKSMENU.CREATE \TEDIT.EXPANDEDCHARLOOKS.MENU \TEDIT.APPLY.BOLDNESS 
@@ -80,7 +82,7 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
                    \TEDIT.SHOW.PARALOOKS \TEDIT.NEUTRALIZE.PARALOOKS.MENU \TEDIT.RECORD.TABLEADERS)
               (FNS \TEDIT.SHOW.PAGEFORMATTING \TEDITPAGEMENU.CREATE \TEDIT.APPLY.PAGEFORMATTING 
                    TEDIT.UNPARSE.PAGEFORMAT)
-              (COMS                                          (* ; "Initialization Code")
+              (COMS                                          (* ; "Initialization Code")
                     (GLOBALVARS TEDIT.EXPANDED.MENU TEDIT.EXPANDEDPARA.MENU TEDIT.CHARLOOKS.MENU 
                            TEDIT.MENUDIVIDER.SPEC TEDIT.EXPANDEDMENU.SPEC TEDIT.CHARLOOKSMENU.SPEC 
                            TEDIT.PARAMENU.SPEC TEDIT.PAGEMENU.SPEC TEDIT.EXPANDED.PAGEMENU)
@@ -4039,19 +4041,19 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
 (DEFINEQ
 
 (\TEDIT.MENU.INIT
-  [LAMBDA NIL                                          (* ; "Edited  4-Jan-2021 13:36 by larry")
-                                                             (* ; "Edited 30-Mar-94 15:53 by jds")
+  [LAMBDA NIL                                           (* ; "Edited 29-Apr-2021 22:44 by rmk:")
+                                                             (* ; "Edited 30-Mar-94 15:53 by jds")
 
-(* ;;; "Initialize the descriptions for all TEdit menus")
+(* ;;; "Initialize the descriptions for all TEdit menus")
 
-(* ;;; "Divides between the main page layout menu and page-# font submenu")
+(* ;;; "Divides between the main page layout menu and page-# font submenu")
 
     (SETQ TEDIT.MENUDIVIDER.SPEC (LIST (create MB.TEXT
                                               MBSTRING _ "
 
 ")))
 
-(* ;;; "The principal expanded menu")
+(* ;;; "The principal expanded menu")
 
     (SETQ TEDIT.EXPANDEDMENU.SPEC (LIST (create MB.BUTTON
                                                MBLABEL _ "Quit")
@@ -4138,7 +4140,7 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
                                                MBSTRING _ "   Message/Phone#:")
                                         (create MB.INSERT)))
 
-(* ;;; "The character-looks (font, etc.) menu")
+(* ;;; "The character-looks (font, etc.) menu")
 
     (SETQ TEDIT.CHARLOOKSMENU.SPEC (LIST (create MB.TEXT
                                                 MBSTRING _ "Props:  "
@@ -4188,7 +4190,7 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
                                                 MBFONT _ (FONTCREATE 'HELVETICA 8))
                                          (create MB.INSERT)))
 
-(* ;;; "The paragraph-formatting menu (margins, etc.)")
+(* ;;; "The paragraph-formatting menu (margins, etc.)")
 
     (SETQ TEDIT.PARAMENU.SPEC (LIST (create MB.BUTTON
                                            MBLABEL _ 'APPLY
@@ -4217,7 +4219,7 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
                                            MBSTRING _ "  type:")
                                     (create MB.INSERT)
                                     (create MB.TEXT
-                                           MBSTRING _ "%
+                                           MBSTRING _ "
 Line leading:"
                                            MBFONT _ (FONTCREATE 'HELVETICA 8))
                                     (create MB.INSERT)
@@ -4234,7 +4236,7 @@ Line leading:"
                                            MBFONT _ (FONTCREATE 'HELVETICA 8))
                                     (create MB.INSERT)
                                     (create MB.TEXT
-                                           MBSTRING _ "picas%
+                                           MBSTRING _ "picas
 New Page:  "
                                            MBFONT _ (FONTCREATE 'HELVETICA 8))
                                     (create MB.3STATE
@@ -4279,7 +4281,7 @@ Tab Type:  "
                                            MBSTRING _ "
 ")))
 
-(* ;;; "Page-layout menu for columns, page headings, page numbers, etc.")
+(* ;;; "Page-layout menu for columns, page headings, page numbers, etc.")
 
     (SETQ TEDIT.PAGEMENU.SPEC (APPEND (LIST (create MB.BUTTON
                                                    MBLABEL _ 'APPLY
@@ -4342,7 +4344,8 @@ Tab Type:  "
                                                    MBBUTTONS _ '(123 xiv XIV)
                                                    MBINITSTATE _ '123)
                                             (create MB.TEXT
-                                                   MBSTRING _ "%
+                                                   MBSTRING _ "
+
 		")
                                             (create MB.TEXT
                                                    MBSTRING _ "Alignment: ")
@@ -4400,7 +4403,7 @@ Tab Type:  "
                                                   MBSTRING _ "Page Headings:"
                                                   MBFONT _ (FONTCREATE 'HELVETICA 10 'BOLD))
                                            (create MB.TEXT
-                                                  MBSTRING _ "%
+                                                  MBSTRING _ "
 	Heading Type:")
                                            (create MB.INSERT)
                                            (create MB.TEXT
@@ -4419,7 +4422,7 @@ Tab Type:  "
                                                   MBSTRING _ "  Y:")
                                            (create MB.INSERT)
                                            (create MB.TEXT
-                                                  MBSTRING _ "%
+                                                  MBSTRING _ "
 	Heading Type:")
                                            (create MB.INSERT)
                                            (create MB.TEXT
@@ -4499,42 +4502,42 @@ Tab Type:  "
 (PUTPROPS TEDITMENU COPYRIGHT ("Venue & Xerox Corporation" 1983 1984 1985 1986 1987 1988 1989 1990 
 1991 1992 1993 1994 1995 2021))
 (DECLARE%: DONTCOPY
-  (FILEMAP (NIL (6319 33161 (MB.BUTTONEVENTINFN 6329 . 7660) (MB.DISPLAY 7662 . 10030) (MB.SETIMAGE 
-10032 . 10990) (MB.SELFN 10992 . 12407) (MB.SIZEFN 12409 . 13426) (MB.WHENOPERATEDFN 13428 . 13760) (
-MB.COPYFN 13762 . 14224) (MB.GETFN 14226 . 14834) (MB.PUTFN 14836 . 15613) (MB.SHOWSELFN 15615 . 16587
-) (MBUTTON.CREATE 16589 . 17873) (MBUTTON.CHANGENAME 17875 . 18270) (MBUTTON.FIND.BUTTON 18272 . 19288
-) (MBUTTON.FIND.NEXT.BUTTON 19290 . 20685) (MBUTTON.FIND.NEXT.FIELD 20687 . 24401) (MBUTTON.INIT 24403
- . 25193) (MBUTTON.NEXT.FIELD.AS.NUMBER 25195 . 25548) (MBUTTON.NEXT.FIELD.AS.PIECES 25550 . 25980) (
-MBUTTON.NEXT.FIELD.AS.TEXT 25982 . 26404) (MBUTTON.NEXT.FIELD.AS.ATOM 26406 . 27279) (
-MBUTTON.SET.FIELD 27281 . 29337) (MBUTTON.SET.NEXT.FIELD 29339 . 30556) (MBUTTON.SET.NEXT.BUTTON.STATE
- 30558 . 31054) (TEDITMENU.STREAM 31056 . 31665) (\TEDITMENU.SELSCREENER 31667 . 33159)) (33465 43888 
-(MB.CREATE.THREESTATEBUTTON 33475 . 34646) (MB.THREESTATE.DISPLAY 34648 . 37238) (
-MB.THREESTATE.SHOWSELFN 37240 . 40342) (MB.THREESTATE.WHENOPERATEDFN 40344 . 41723) (
-MB.THREESTATEBUTTON.FN 41725 . 42822) (THREESTATE.INIT 42824 . 43886)) (43989 63225 (
-MB.CREATE.NWAYBUTTON 43999 . 47967) (MB.NB.DISPLAYFN 47969 . 50241) (MB.NB.WHENOPERATEDFN 50243 . 
-51275) (MB.NB.SIZEFN 51277 . 54816) (MB.NWAYBUTTON.SELFN 54818 . 56762) (MB.NWAYMENU.NEWBUTTON 56764
- . 57350) (NWAYBUTTON.INIT 57352 . 58205) (MB.NB.PACKITEMS 58207 . 60204) (MB.NWAYBUTTON.ADDITEM 60206
- . 63223)) (63479 74127 (\TEXTMENU.TOGGLE.CREATE 63489 . 64890) (\TEXTMENU.TOGGLE.DISPLAY 64892 . 
-67244) (\TEXTMENU.TOGGLE.SHOWSELFN 67246 . 69608) (\TEXTMENU.TOGGLE.WHENOPERATEDFN 69610 . 70998) (
-\TEXTMENU.TOGGLEFN 71000 . 72080) (\TEXTMENU.TOGGLE.INIT 72082 . 72917) (\TEXTMENU.SET.TOGGLE 72919 . 
-74125)) (74379 111751 (DRAWMARGINSCALE 74389 . 77933) (MARGINBAR 77935 . 85305) (MARGINBAR.CREATE 
-85307 . 88217) (MB.MARGINBAR.SELFN 88219 . 100813) (MB.MARGINBAR.SIZEFN 100815 . 101177) (
-MB.MARGINBAR.DISPLAYFN 101179 . 103864) (MDESCALE 103866 . 104305) (MSCALE 104307 . 104641) (
-MB.MARGINBAR.SHOWTAB 104643 . 106814) (MB.MARGINBAR.TABTRACK 106816 . 108151) (\TEDIT.TABTYPE.SET 
-108153 . 110860) (MARGINBAR.INIT 110862 . 111749)) (112768 130370 (\TEXTMENU.START 112778 . 115970) (
-\TEXTMENU.DOC.CREATE 115972 . 127496) (TEXTMENU.CLOSEFN 127498 . 130368)) (130680 150744 (
-\TEDITMENU.CREATE 130690 . 130990) (\TEDIT.EXPANDED.MENU 130992 . 131696) (MB.DEFAULTBUTTON.FN 131698
- . 134570) (\TEDITMENU.RECORD.UNFORMATTED 134572 . 134910) (MB.DEFAULTBUTTON.ACTIONFN 134912 . 150742)
-) (150745 178128 (\TEDIT.CHARLOOKSMENU.CREATE 150755 . 152895) (\TEDIT.EXPANDEDCHARLOOKS.MENU 152897
- . 153271) (\TEDIT.APPLY.BOLDNESS 153273 . 153558) (\TEDIT.APPLY.CHARLOOKS 153560 . 155491) (
-\TEDIT.APPLY.OLINE 155493 . 155774) (\TEDIT.SHOW.CHARLOOKS 155776 . 157689) (
-\TEDIT.NEUTRALIZE.CHARLOOKS 157691 . 158617) (\TEDIT.FILL.IN.CHARLOOKS.MENU 158619 . 166272) (
-\TEDIT.NEUTRALIZE.CHARLOOKS.MENU 166274 . 169157) (\TEDIT.PARSE.CHARLOOKS.MENU 169159 . 177267) (
-\TEDIT.APPLY.SLOPE 177269 . 177552) (\TEDIT.APPLY.STRIKEOUT 177554 . 177841) (\TEDIT.APPLY.ULINE 
-177843 . 178126)) (178129 210195 (\TEDITPARAMENU.CREATE 178139 . 178519) (\TEDIT.EXPANDEDPARA.MENU 
-178521 . 178841) (\TEDIT.APPLY.PARALOOKS 178843 . 191073) (\TEDIT.SHOW.PARALOOKS 191075 . 202602) (
-\TEDIT.NEUTRALIZE.PARALOOKS.MENU 202604 . 208675) (\TEDIT.RECORD.TABLEADERS 208677 . 210193)) (210196 
-248198 (\TEDIT.SHOW.PAGEFORMATTING 210206 . 226746) (\TEDITPAGEMENU.CREATE 226748 . 227791) (
-\TEDIT.APPLY.PAGEFORMATTING 227793 . 240164) (TEDIT.UNPARSE.PAGEFORMAT 240166 . 248196)) (248503 
-275352 (\TEDIT.MENU.INIT 248513 . 275350)))))
+  (FILEMAP (NIL (6266 33108 (MB.BUTTONEVENTINFN 6276 . 7607) (MB.DISPLAY 7609 . 9977) (MB.SETIMAGE 9979
+ . 10937) (MB.SELFN 10939 . 12354) (MB.SIZEFN 12356 . 13373) (MB.WHENOPERATEDFN 13375 . 13707) (
+MB.COPYFN 13709 . 14171) (MB.GETFN 14173 . 14781) (MB.PUTFN 14783 . 15560) (MB.SHOWSELFN 15562 . 16534
+) (MBUTTON.CREATE 16536 . 17820) (MBUTTON.CHANGENAME 17822 . 18217) (MBUTTON.FIND.BUTTON 18219 . 19235
+) (MBUTTON.FIND.NEXT.BUTTON 19237 . 20632) (MBUTTON.FIND.NEXT.FIELD 20634 . 24348) (MBUTTON.INIT 24350
+ . 25140) (MBUTTON.NEXT.FIELD.AS.NUMBER 25142 . 25495) (MBUTTON.NEXT.FIELD.AS.PIECES 25497 . 25927) (
+MBUTTON.NEXT.FIELD.AS.TEXT 25929 . 26351) (MBUTTON.NEXT.FIELD.AS.ATOM 26353 . 27226) (
+MBUTTON.SET.FIELD 27228 . 29284) (MBUTTON.SET.NEXT.FIELD 29286 . 30503) (MBUTTON.SET.NEXT.BUTTON.STATE
+ 30505 . 31001) (TEDITMENU.STREAM 31003 . 31612) (\TEDITMENU.SELSCREENER 31614 . 33106)) (33412 43835 
+(MB.CREATE.THREESTATEBUTTON 33422 . 34593) (MB.THREESTATE.DISPLAY 34595 . 37185) (
+MB.THREESTATE.SHOWSELFN 37187 . 40289) (MB.THREESTATE.WHENOPERATEDFN 40291 . 41670) (
+MB.THREESTATEBUTTON.FN 41672 . 42769) (THREESTATE.INIT 42771 . 43833)) (43936 63172 (
+MB.CREATE.NWAYBUTTON 43946 . 47914) (MB.NB.DISPLAYFN 47916 . 50188) (MB.NB.WHENOPERATEDFN 50190 . 
+51222) (MB.NB.SIZEFN 51224 . 54763) (MB.NWAYBUTTON.SELFN 54765 . 56709) (MB.NWAYMENU.NEWBUTTON 56711
+ . 57297) (NWAYBUTTON.INIT 57299 . 58152) (MB.NB.PACKITEMS 58154 . 60151) (MB.NWAYBUTTON.ADDITEM 60153
+ . 63170)) (63426 74074 (\TEXTMENU.TOGGLE.CREATE 63436 . 64837) (\TEXTMENU.TOGGLE.DISPLAY 64839 . 
+67191) (\TEXTMENU.TOGGLE.SHOWSELFN 67193 . 69555) (\TEXTMENU.TOGGLE.WHENOPERATEDFN 69557 . 70945) (
+\TEXTMENU.TOGGLEFN 70947 . 72027) (\TEXTMENU.TOGGLE.INIT 72029 . 72864) (\TEXTMENU.SET.TOGGLE 72866 . 
+74072)) (74326 111698 (DRAWMARGINSCALE 74336 . 77880) (MARGINBAR 77882 . 85252) (MARGINBAR.CREATE 
+85254 . 88164) (MB.MARGINBAR.SELFN 88166 . 100760) (MB.MARGINBAR.SIZEFN 100762 . 101124) (
+MB.MARGINBAR.DISPLAYFN 101126 . 103811) (MDESCALE 103813 . 104252) (MSCALE 104254 . 104588) (
+MB.MARGINBAR.SHOWTAB 104590 . 106761) (MB.MARGINBAR.TABTRACK 106763 . 108098) (\TEDIT.TABTYPE.SET 
+108100 . 110807) (MARGINBAR.INIT 110809 . 111696)) (112715 130317 (\TEXTMENU.START 112725 . 115917) (
+\TEXTMENU.DOC.CREATE 115919 . 127443) (TEXTMENU.CLOSEFN 127445 . 130315)) (130627 150691 (
+\TEDITMENU.CREATE 130637 . 130937) (\TEDIT.EXPANDED.MENU 130939 . 131643) (MB.DEFAULTBUTTON.FN 131645
+ . 134517) (\TEDITMENU.RECORD.UNFORMATTED 134519 . 134857) (MB.DEFAULTBUTTON.ACTIONFN 134859 . 150689)
+) (150692 178075 (\TEDIT.CHARLOOKSMENU.CREATE 150702 . 152842) (\TEDIT.EXPANDEDCHARLOOKS.MENU 152844
+ . 153218) (\TEDIT.APPLY.BOLDNESS 153220 . 153505) (\TEDIT.APPLY.CHARLOOKS 153507 . 155438) (
+\TEDIT.APPLY.OLINE 155440 . 155721) (\TEDIT.SHOW.CHARLOOKS 155723 . 157636) (
+\TEDIT.NEUTRALIZE.CHARLOOKS 157638 . 158564) (\TEDIT.FILL.IN.CHARLOOKS.MENU 158566 . 166219) (
+\TEDIT.NEUTRALIZE.CHARLOOKS.MENU 166221 . 169104) (\TEDIT.PARSE.CHARLOOKS.MENU 169106 . 177214) (
+\TEDIT.APPLY.SLOPE 177216 . 177499) (\TEDIT.APPLY.STRIKEOUT 177501 . 177788) (\TEDIT.APPLY.ULINE 
+177790 . 178073)) (178076 210142 (\TEDITPARAMENU.CREATE 178086 . 178466) (\TEDIT.EXPANDEDPARA.MENU 
+178468 . 178788) (\TEDIT.APPLY.PARALOOKS 178790 . 191020) (\TEDIT.SHOW.PARALOOKS 191022 . 202549) (
+\TEDIT.NEUTRALIZE.PARALOOKS.MENU 202551 . 208622) (\TEDIT.RECORD.TABLEADERS 208624 . 210140)) (210143 
+248145 (\TEDIT.SHOW.PAGEFORMATTING 210153 . 226693) (\TEDITPAGEMENU.CREATE 226695 . 227738) (
+\TEDIT.APPLY.PAGEFORMATTING 227740 . 240111) (TEDIT.UNPARSE.PAGEFORMAT 240113 . 248143)) (248450 
+275299 (\TEDIT.MENU.INIT 248460 . 275297)))))
 STOP
diff --git a/library/TEDITMENU.LCOM b/library/TEDITMENU.LCOM
index 372962fd..82a4450c 100644
Binary files a/library/TEDITMENU.LCOM and b/library/TEDITMENU.LCOM differ
diff --git a/library/TEDITSCREEN b/library/TEDITSCREEN
index 420a9e8b..58d30800 100644
--- a/library/TEDITSCREEN
+++ b/library/TEDITSCREEN
@@ -1,19 +1,41 @@
 (DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10)
-(FILECREATED "25-Aug-94 13:26:23" {DSK}<king>export>lispcore>library>TEDITSCREEN.;5 221448 
+(FILECREATED "30-Apr-2021 14:42:15" 
+{DSK}<Users>kaplan>Local>medley3.5>git-medley>library>TEDITSCREEN.;3 221793 
 
-      changes to%:  (FNS \MAIKO.DISPLAYLINE) (VARS TEDITSCREENCOMS) (FILES TEDITDCL)
+      changes to%:  (FNS \FORMATLINE \DISPLAYLINE)
 
-      previous date%: "25-Aug-94 10:55:48" {DSK}<king>export>lispcore>library>TEDITSCREEN.;4)
+      previous date%: "29-Apr-2021 23:17:30" 
+{DSK}<Users>kaplan>Local>medley3.5>git-medley>library>TEDITSCREEN.;2)
 
 
 (* ; "
-Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994 by Venue & Xerox Corporation.  All rights reserved.
+Copyright (c) 1983-1994, 2021 by Venue & Xerox Corporation.
 ")
 
 (PRETTYCOMPRINT TEDITSCREENCOMS)
 
-(RPAQQ TEDITSCREENCOMS ((FILES TEDITDCL) (DECLARE%: EVAL@COMPILE DONTCOPY (CONSTANTS (\SCRATCHLEN 64)) (FILES (LOADCOMP) TEDITDCL)) (FNS \FORMATLINE \TEDIT.NSCHAR.RUN \TEDIT.PURGE.SPACES \DOFORMATTING) (FNS \DISPLAYLINE \MAIKO.DISPLAYLINE \TEDIT.LINECACHE \TEDIT.CREATE.LINECACHE \TEDIT.BLTCHAR) (FNS TEDIT.CR.UPDATESCREEN TEDIT.DELETELINE TEDIT.INSERT.DISPLAYTEXT TEDIT.INSERT.UPDATESCREEN TEDIT.UPDATE.SCREEN \BACKFORMAT \FILLWINDOW \FIXDLINES \FIXILINES \SHOWTEXT \TEDIT.ADJUST.LINES \TEDIT.CLEAR.SCREEN.BELOW.LINE \TEDIT.CLOSEUPLINES \TEDIT.COPY.LINEDESCRIPTOR \TEDIT.FIXCHANGEDLINE \TEDIT.FIXCHANGEDPART \TEDIT.INSERTLINE \TEDIT.LINE.LIST \TEDIT.MARK.LINES.DIRTY \TEDIT.NEXT.LINE.BOTTOM) (VARS (TEDIT.DONT.BREAK.CHARS (QUOTE (8482 8483 8491 8492 8508 8525 8539 8537 8535 9249 9251 9253 9255 9257 9283 9315 9317 9319 9326 9505 9507 9509 9511 9513 9539 9571 9573 9575 9582))) (TEDIT.DONT.LAST.CHARS (QUOTE (8524 8538 8536 8534)))) (GLOBALVARS TEDIT.DONT.BREAK.CHARS TEDIT.DONT.LAST.CHARS) (P (COND ((EQ (MACHINETYPE) (QUOTE MAIKO)) (MOVD (QUOTE \MAIKO.DISPLAYLINE) (QUOTE \DISPLAYLINE))) (T (ADDTOVAR \MAIKO.MOVDS (\MAIKO.DISPLAYLINE \DISPLAYLINE))))))
-)
+(RPAQQ TEDITSCREENCOMS
+       [(FILES TEDITDCL)
+        (DECLARE%: EVAL@COMPILE DONTCOPY (CONSTANTS (\SCRATCHLEN 64))
+               (FILES (LOADCOMP)
+                      TEDITDCL))
+        (FNS \FORMATLINE \TEDIT.NSCHAR.RUN \TEDIT.PURGE.SPACES \DOFORMATTING)
+        (FNS \DISPLAYLINE \MAIKO.DISPLAYLINE \TEDIT.LINECACHE \TEDIT.CREATE.LINECACHE \TEDIT.BLTCHAR)
+        (FNS TEDIT.CR.UPDATESCREEN TEDIT.DELETELINE TEDIT.INSERT.DISPLAYTEXT 
+             TEDIT.INSERT.UPDATESCREEN TEDIT.UPDATE.SCREEN \BACKFORMAT \FILLWINDOW \FIXDLINES 
+             \FIXILINES \SHOWTEXT \TEDIT.ADJUST.LINES \TEDIT.CLEAR.SCREEN.BELOW.LINE 
+             \TEDIT.CLOSEUPLINES \TEDIT.COPY.LINEDESCRIPTOR \TEDIT.FIXCHANGEDLINE 
+             \TEDIT.FIXCHANGEDPART \TEDIT.INSERTLINE \TEDIT.LINE.LIST \TEDIT.MARK.LINES.DIRTY 
+             \TEDIT.NEXT.LINE.BOTTOM)
+        [VARS (TEDIT.DONT.BREAK.CHARS '(8482 8483 8491 8492 8508 8525 8539 8537 8535 9249 9251 9253 
+                                             9255 9257 9283 9315 9317 9319 9326 9505 9507 9509 9511 
+                                             9513 9539 9571 9573 9575 9582))
+              (TEDIT.DONT.LAST.CHARS '(8524 8538 8536 8534]
+        (GLOBALVARS TEDIT.DONT.BREAK.CHARS TEDIT.DONT.LAST.CHARS)
+        (P (COND ((EQ (MACHINETYPE)
+                      'MAIKO)
+                  (MOVD '\MAIKO.DISPLAYLINE '\DISPLAYLINE))
+                 (T (ADDTOVAR \MAIKO.MOVDS (\MAIKO.DISPLAYLINE \DISPLAYLINE))])
 
 (FILESLOAD TEDITDCL)
 (DECLARE%: EVAL@COMPILE DONTCOPY 
@@ -26,16 +48,17 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
 )
 
 
-(FILESLOAD (LOADCOMP) TEDITDCL)
+(FILESLOAD (LOADCOMP)
+       TEDITDCL)
 )
 (DEFINEQ
 
 (\FORMATLINE
-  [LAMBDA (TEXTOBJ FMTSPEC CH#1 OLINE 1STLN)             (* ; "Edited 29-Mar-94 16:20 by jds")
+  [LAMBDA (TEXTOBJ FMTSPEC CH#1 OLINE 1STLN)            (* ; "Edited 30-Apr-2021 14:38 by rmk:")
 
-    (* ;; "Given a starting place, format the next line of text.  Return the LINEDESCRIPTOR;  reusing OLINE if it's given.")
+    (* ;; "Given a starting place, format the next line of text.  Return the LINEDESCRIPTOR;  reusing OLINE if it's given.")
 
-    (* ;; "If CH#1 is past end of document, \FORMATLINE returns an empty line descriptor that is set up right wrt leading and font.  This is used by \FILLWINDOW to create the dummy line at end of document when you hit a CR there.")
+    (* ;; "If CH#1 is past end of document, \FORMATLINE returns an empty line descriptor that is set up right wrt leading and font.  This is used by \FILLWINDOW to create the dummy line at end of document when you hit a CR there.")
 
     (DECLARE (SPECVARS LOOKS CHLIST WLIST FONTWIDTHS CHNO ASCENT DESCENT LOOKNO LINE FONT 
                         INVISIBLERUNS DEVICE SCALE NEWASCENT NEWDESCENT TLEN))
@@ -62,35 +85,35 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
            DEVICE SCALE NEWASCENT NEWDESCENT TABSPEC HARDCOPYMODE ORIGFMTSPEC PREVHYPH PREVDHYPH 
            ORIGCHLIST ORIGWLIST)
 
-     (* ;; "Variables (TLEN = Current character count on the line)")
+     (* ;; "Variables (TLEN = Current character count on the line)")
 
-     (* ;; "(CHNO = Current character # in the text)")
+     (* ;; "(CHNO = Current character # in the text)")
 
-     (* ;; "(DX = width of current char/object)")
+     (* ;; "(DX = width of current char/object)")
 
-     (* ;; "(TX = current right margin) ")
+     (* ;; "(TX = current right margin) ")
 
-     (* ;; "(TXB1 = right margin of the first space/tab/CR in a row of space/tab/CR) ")
+     (* ;; "(TXB1 = right margin of the first space/tab/CR in a row of space/tab/CR) ")
 
-     (* ;; "(CH#B = The CHNO of most recent space/tab)")
+     (* ;; "(CH#B = The CHNO of most recent space/tab)")
 
-     (* ;; "(TXB = right margin of most recent space/tab)")
+     (* ;; "(TXB = right margin of most recent space/tab)")
 
-     (* ;; "(DXB = width of most recent space/tab)")
+     (* ;; "(DXB = width of most recent space/tab)")
 
-     (* ;; "(PREVSP = location on the line of the previous space/tab to this space/tab + 1)")
+     (* ;; "(PREVSP = location on the line of the previous space/tab to this space/tab + 1)")
 
-     (* ;; "(T1SPACE = a space/CR/TAB has been seen)")
+     (* ;; "(T1SPACE = a space/CR/TAB has been seen)")
 
-     (* ;; "(#BLANKS = # of spaces/tabs seen) ")
+     (* ;; "(#BLANKS = # of spaces/tabs seen) ")
 
-     (* ;; " (LOOKNO = Current index into the LOOKS array.  Updated by \TEDIT.LOOKS.UPDATE as characters are read in)")
+     (* ;; " (LOOKNO = Current index into the LOOKS array.  Updated by \TEDIT.LOOKS.UPDATE as characters are read in)")
 
-     (* ;; "(LOOK#B = The LOOKNO of the most recent space/tab)")
+     (* ;; "(LOOK#B = The LOOKNO of the most recent space/tab)")
 
-     (* ;; "(ASCENTB = Ascent at most recent potential line break point)")
+     (* ;; "(ASCENTB = Ascent at most recent potential line break point)")
 
-     (* ;; "(DESCENTB = Descent at most recent potential line break point)")
+     (* ;; "(DESCENTB = Descent at most recent potential line break point)")
 
           (SETQ CH#1 (IMAX CH#1 1))
           [SETQ ORIGCHLIST (SETQ CHLIST (fetch (ARRAYP BASE) of (fetch (THISLINE CHARS)
@@ -103,29 +126,29 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
           (replace (TEXTSTREAM LOOKSUPDATEFN) of TEXTSTREAM with (FUNCTION 
                                                                               \TEDIT.LOOKS.UPDATE))
           (freplace (LINEDESCRIPTOR CHARLIM) of LINE with TEXTLEN)
-                                                             (* ; 
-                                                    "Force each new line to find its true CHARLIM.")
+                                                             (* ; 
+                                                    "Force each new line to find its true CHARLIM.")
           (freplace (LINEDESCRIPTOR DIRTY) of LINE with NIL)
-                                                             (* ; 
-                                                      "And as unchanged since the last formatting.")
+                                                             (* ; 
+                                                      "And as unchanged since the last formatting.")
           (freplace (LINEDESCRIPTOR CHAR1) of LINE with CH#1)
           (freplace (LINEDESCRIPTOR CR\END) of LINE with NIL)
-                                                             (* ; "Assume we won't see a CR.")
+                                                             (* ; "Assume we won't see a CR.")
           (freplace (LINEDESCRIPTOR LHASTABS) of LINE with NIL)
-                                                             (* ; "And has no TABs.")
+                                                             (* ; "And has no TABs.")
           (COND
              [(COND
                  ((AND (ILEQ CH#1 TEXTLEN)
-                       (NOT (ZEROP TEXTLEN)))                (* ; 
-                                              "Only continue if there's really text we can format.")
-                  (\SETUPGETCH CH#1 TEXTOBJ)                 (* ; "Starting place")
-                                                             (* ; "And starting character looks")
+                       (NOT (ZEROP TEXTLEN)))                (* ; 
+                                              "Only continue if there's really text we can format.")
+                  (\SETUPGETCH CH#1 TEXTOBJ)                 (* ; "Starting place")
+                                                             (* ; "And starting character looks")
                   (SETQ CLOOKS (fetch (TEXTSTREAM CURRENTLOOKS) of TEXTSTREAM))
                   (COND
-                     ((fetch CLINVISIBLE of CLOOKS)  (* ; 
-       "We've hit a run of invisible characters.  Skip them, and insert a marker in the line cache")
-                      (add LOOKNO 1)                     (* ; 
-                                                           "Fix the counter of charlooks changes")
+                     ((fetch CLINVISIBLE of CLOOKS)  (* ; 
+       "We've hit a run of invisible characters.  Skip them, and insert a marker in the line cache")
+                      (add LOOKNO 1)                     (* ; 
+                                                           "Fix the counter of charlooks changes")
                       (SETQ PC (fetch (TEXTSTREAM PIECE) of TEXTSTREAM))
                       (\EDITSETA LOOKS LOOKNO (SETQ INVISIBLERUNS (fetch (PIECE PLEN)
                                                                      of PC)))
@@ -155,8 +178,8 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
                   (ILEQ CHNO TEXTLEN)))
               (replace (LINEDESCRIPTOR LHASPROT) of LINE with (fetch CLPROTECTED
                                                                              of CLOOKS))
-                                                             (* ; 
-                                        "Remember if the first character on the line is protected.")
+                                                             (* ; 
+                                        "Remember if the first character on the line is protected.")
               (SETQ ORIGFMTSPEC (SETQ FMTSPEC
                                  (\TEDIT.APPLY.PARASTYLES
                                   [OR FMTSPEC (SETQ FMTSPEC (OR (AND (fetch (TEXTSTREAM PIECE)
@@ -168,18 +191,18 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
                                                                      )
                                                                 (fetch (TEXTOBJ FMTSPEC)
                                                                    of TEXTOBJ]
-                                  PC TEXTOBJ)))              (* ; "Get the paragraph looks")
+                                  PC TEXTOBJ)))              (* ; "Get the paragraph looks")
               (COND
                  ((NEQ ORIGFMTSPEC *TEDIT-CACHED-FMTSPEC*)
 
-                  (* ;; "The cache of character styles for the current paragrpah is invalid; flush it, and note the new paragraph to cache for.")
+                  (* ;; "The cache of character styles for the current paragrpah is invalid; flush it, and note the new paragraph to cache for.")
 
                   (SETQ *TEDIT-CURRENTPARA-CACHE* NIL)
                   (SETQ *TEDIT-CACHED-FMTSPEC* ORIGFMTSPEC)))
               (COND
                  [(SETQ HARDCOPYMODE (fetch FMTHARDCOPY of FMTSPEC))
-                                                             (* ; 
-                                              "This line is a hardcopy line.  Scale things for it.")
+                                                             (* ; 
+                                              "This line is a hardcopy line.  Scale things for it.")
                   [SETQ DEVICE (OR (fetch (TEXTOBJ DISPLAYHCPYDS) of TEXTOBJ)
                                    (replace (TEXTOBJ DISPLAYHCPYDS) of TEXTOBJ
                                       with (OPENIMAGESTREAM '{NODIRCORE} 'INTERPRESS]
@@ -187,8 +210,8 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
                   (SETQ FMTSPEC (\TEDIT.HCPYFMTSPEC FMTSPEC DEVICE))
                   (SETQ DEFAULTTAB (FIXR (FTIMES 36 SCALE)))
                   (SETQ LEFTEDGE (FIXR (FTIMES 8 SCALE]
-                 (T                                          (* ; 
-                                                     "Regular line.  Format at display resolutions")
+                 (T                                          (* ; 
+                                                     "Regular line.  Format at display resolutions")
                     (SETQ DEVICE (fetch (TEXTOBJ DISPLAYCACHEDS) of TEXTOBJ))
                     (SETQ SCALE 1)
                     (SETQ LEFTEDGE 8)))
@@ -197,22 +220,22 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
                  ((type? FONTCLASS (SETQ FONT (fetch CLFONT of CLOOKS)))
                   (SETQ FONT (FONTCOPY (fetch CLFONT of CLOOKS)
                                     'DEVICE
-                                    'DISPLAY]                (* ; 
-                                                           "Grab the initial font for this line")
+                                    'DISPLAY]                (* ; 
+                                                           "Grab the initial font for this line")
               [SETQ ASCENTB (SETQ NEWASCENT (IPLUS (fetch \SFAscent of FONT)
                                                    (OR (fetch CLOFFSET of CLOOKS)
-                                                       0]    (* ; 
-                                                         "The initial ascent, per the initial font")
+                                                       0]    (* ; 
+                                                         "The initial ascent, per the initial font")
               [SETQ DESCENTB (SETQ NEWDESCENT (IDIFFERENCE (fetch \SFDescent of FONT)
                                                      (OR (fetch CLOFFSET of CLOOKS)
-                                                         0]  (* ; 
-                                                           "Initial descent, per the initial font.")
+                                                         0]  (* ; 
+                                                           "Initial descent, per the initial font.")
               [COND
-                 (HARDCOPYMODE                               (* ; 
-                               "If this is a hardcopy line, fetch the hardcopy version of the font")
+                 (HARDCOPYMODE                               (* ; 
+                               "If this is a hardcopy line, fetch the hardcopy version of the font")
                         (SETQ FONT (FONTCOPY (fetch CLFONT of CLOOKS)
                                           'DEVICE DEVICE]
-              (\EDITSETA LOOKS 0 CLOOKS)                     (* ; "Save looks in the line cache")
+              (\EDITSETA LOOKS 0 CLOOKS)                     (* ; "Save looks in the line cache")
               [SETQ 1STLN (OR (IEQP CH#1 1)
                               (AND (fetch (TEXTSTREAM PIECE) of TEXTSTREAM)
                                    (fetch (PIECE PREVPIECE) of (fetch (TEXTSTREAM PIECE)
@@ -226,17 +249,17 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
                                          (fetch (STREAM COFFSET) of TEXTSTREAM))
                                    (IEQP (fetch (TEXTSTREAM PCSTARTPG) of TEXTSTREAM)
                                          (fetch (STREAM CPAGE) of TEXTSTREAM]
-                                                             (* ; 
-                                                 "If this is the start of a paragraph, mark it so.")
+                                                             (* ; 
+                                                 "If this is the start of a paragraph, mark it so.")
               (replace (LINEDESCRIPTOR LMARK) of LINE with NIL)
-                                                             (* ; 
-                              "Start by assuming that we don't want a margin marker for this line.")
+                                                             (* ; 
+                              "Start by assuming that we don't want a margin marker for this line.")
               (replace (LINEDESCRIPTOR 1STLN) of LINE with 1STLN)
-                                                             (* ; 
-                                                         "Are we on the first line of a paragraph?")
+                                                             (* ; 
+                                                         "Are we on the first line of a paragraph?")
               [COND
                  (1STLN 
-                        (* ;; "This is the first line of a paragraph.  Check for special paragraph types, like headings, that get marked in the margin.")
+                        (* ;; "This is the first line of a paragraph.  Check for special paragraph types, like headings, that get marked in the margin.")
 
                         (COND
                            ((EQ (fetch FMTPARATYPE of FMTSPEC)
@@ -257,7 +280,7 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
                                           (COND
                                              (1STLN (fetch 1STLEFTMAR of FMTSPEC))
                                              (T (fetch LEFTMAR of FMTSPEC]
-                                                             (* ; "Set the left margin accordingly")
+                                                             (* ; "Set the left margin accordingly")
               [replace (LINEDESCRIPTOR RIGHTMARGIN) of LINE
                  with (SETQ WIDTH (COND
                                          ((NOT (ZEROP (fetch RIGHTMAR of FMTSPEC)))
@@ -266,31 +289,31 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
                                                                                          WRIGHT)
                                                                                 of TEXTOBJ)
                                                                        8]
-                                                             (* ; 
-                                                       "RIGHTMAR = 0 => follow the window's width.")
+                                                             (* ; 
+                                                       "RIGHTMAR = 0 => follow the window's width.")
               (SETQ TXB1 WIDTH)
               (for old TLEN from TLEN to 254 as old CHNO from CHNO
                  while (ILEQ CHNO TEXTLEN) when (SETQ CH (\BIN TEXTSTREAM))
-                 do                                      (* ; "(The WHILE is there because we may reset TEXTLEN within the loop, and TO TEXTLEN only evaluates it once.)")
+                 do                                      (* ; "(The WHILE is there because we may reset TEXTLEN within the loop, and TO TEXTLEN only evaluates it once.)")
 
-                       (* ;; "The character loop")
+                       (* ;; "The character loop")
 
-                       (* ;; "Get the next character for the line.")
+                       (* ;; "Get the next character for the line.")
 
                        [SETQ DX (COND
-                                   [(SMALLP CH)              (* ; "CH is really a character")
+                                   [(SMALLP CH)              (* ; "CH is really a character")
                                     (COND
                                        ((AND (IGEQ CH 192)
-                                             (ILEQ CH 207))  (* ; 
-                                                     "This is an NS accent character.  Space it 0.")
+                                             (ILEQ CH 207))  (* ; 
+                                                     "This is an NS accent character.  Space it 0.")
                                         (SETQ DX 0))
-                                       (T                    (* ; 
-                                                           "Regular character.  Get it's width.")
+                                       (T                    (* ; 
+                                                           "Regular character.  Get it's width.")
                                           (\FGETCHARWIDTH FONT CH]
-                                   (T                        (* ; "CH is an object")
+                                   (T                        (* ; "CH is an object")
                                       (SETQ BOX (APPLY* (IMAGEOBJPROP CH 'IMAGEBOXFN)
                                                        CH DS TX WIDTH))
-                                                             (* ; "Get its size")
+                                                             (* ; "Get its size")
                                       (SETQ NEWASCENT (IDIFFERENCE (fetch YSIZE of BOX)
                                                              (fetch YDESC of BOX)))
                                       (SETQ NEWDESCENT (fetch YDESC of BOX))
@@ -302,51 +325,51 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
                                                                                     of TEXTSTREAM
                                                                                   ]
 
-                                 (* ;; "The object is several chars wide, but doesn't have a subsidiary stream to pull those chars from.  Build an invisible run to fill the space.")
+                                 (* ;; "The object is several chars wide, but doesn't have a subsidiary stream to pull those chars from.  Build an invisible run to fill the space.")
 
-                                          (add LOOKNO 1) (* ; 
-                                                           "Fix the counter of charlooks changes")
+                                          (add LOOKNO 1) (* ; 
+                                                           "Fix the counter of charlooks changes")
                                           (\EDITSETA LOOKS LOOKNO (SUB1 (fetch (PIECE PLEN)
                                                                            of PC)))
                                           (\RPLPTR CHLIST 0 LMInvisibleRun)
-                                                             (* ; 
-                                       "Note the existence of an invisible run of characters here.")
+                                                             (* ; 
+                                       "Note the existence of an invisible run of characters here.")
                                           (\RPLPTR WLIST 0 0)
                                           (add TLEN 1)
                                           (SETQ CHLIST (\ADDBASE CHLIST 2))
                                           (SETQ WLIST (\ADDBASE WLIST 2))
                                           (add CHNO (SUB1 (fetch (PIECE PLEN) of PC)))
                                           (add INVISIBLERUNS (\EDITELT LOOKS LOOKNO))
-                                                             (* ; 
-                                              "Keep track of how much invisible text we cross over")
+                                                             (* ; 
+                                              "Keep track of how much invisible text we cross over")
                                           ))
                                       (COND
                                          [HARDCOPYMODE (FIXR (FTIMES SCALE (fetch XSIZE
                                                                               of BOX]
                                          (T (fetch XSIZE of BOX] 
-                                                             (* ; "Get CH's X width.")
+                                                             (* ; "Get CH's X width.")
                        [SELCHARQ CH
-                            (SPACE                           (* ; 
-                                "CH is a <Space>.  Remember it, in case we need to break the line.")
+                            (SPACE                           (* ; 
+                                "CH is a <Space>.  Remember it, in case we need to break the line.")
                                    (COND
                                       (GATHERBLANK (SETQ TXB1 TX)
                                              (SETQ GATHERBLANK NIL)))
-                                   (SETQ CH#B CHNO)          (* ; 
-  "put the location # of the previous space/tab in the character array instead of the space itself")
+                                   (SETQ CH#B CHNO)          (* ; 
+  "put the location # of the previous space/tab in the character array instead of the space itself")
                                    (\RPLPTR CHLIST 0 PREVSP)
                                    (\RPLPTR WLIST 0 DX)
                                    (SETQ PREVSP (ADD1 TLEN))
                                    (SETQ T1SPACE T)
                                    (SETQ PREVDHYPH NIL)
-                                   (SETQ PREVHYPH NIL)       (* ; 
-            "We're now past needing any hyphens for line breaking, so forget the last hyphen spot.")
+                                   (SETQ PREVHYPH NIL)       (* ; 
+            "We're now past needing any hyphens for line breaking, so forget the last hyphen spot.")
                                    (add TX DX)
                                    (SETQ TXB TX)
                                    (SETQ DXB DX)
                                    (SETQ LOOK#B LOOKNO)
                                    (COND
-                                      (NEWASCENT             (* ; 
-                                                           "The ascent has changed;  catch it")
+                                      (NEWASCENT             (* ; 
+                                                           "The ascent has changed;  catch it")
                                              (SETQ ASCENT (IMAX ASCENT NEWASCENT))
                                              (SETQ DESCENT (IMAX DESCENT NEWDESCENT))
                                              (SETQ NEWASCENT NIL)))
@@ -354,39 +377,39 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
                                    (SETQ DESCENTB DESCENT)
                                    (SETQ INVISIBLERUNSB INVISIBLERUNS)
                                    (add %#BLANKS 1))
-                            (CR                              (* ; 
-                                                     "Ch is a <Return>.  Force an end to the line.")
-                                (freplace (LINEDESCRIPTOR CHARLIM) of LINE with CHNO)
-                                (COND
-                                   ((AND NEWASCENT (ZEROP ASCENT)
-                                         (ZEROP DESCENT))    (* ; 
-                                                           "The ascent has changed;  catch it")
-                                    (SETQ ASCENT NEWASCENT)
-                                    (SETQ DESCENT NEWDESCENT)))
-                                (SETQ FORCEEND T)
-                                (SETQ PREVDHYPH NIL)
-                                (SETQ PREVHYPH NIL)          (* ; 
-            "We're now past needing any hyphens for line breaking, so forget the last hyphen spot.")
-                                (\RPLPTR CHLIST 0 (CHARCODE CR))
-                                (\RPLPTR WLIST 0 (SETQ DX (IMAX DX 6)))
-                                (COND
-                                   (GATHERBLANK (SETQ TXB1 TX)
-                                          (SETQ GATHERBLANK NIL)))
-                                (SETQ T1SPACE T)
-                                (freplace (LINEDESCRIPTOR CR\END) of LINE with T)
-                                (SETQ TX (IPLUS TX DX))
-                                (replace (LINEDESCRIPTOR LSTLN) of LINE with T)
-                                                             (* ; 
-                                    "This has to be done better when we get non-para breaking CRs.")
-                                (RETURN))
+                            ((CR LF)                         (* ; 
+                                                     "Ch is a <Return>.  Force an end to the line.")
+                                 (freplace (LINEDESCRIPTOR CHARLIM) of LINE with CHNO)
+                                 (COND
+                                    ((AND NEWASCENT (ZEROP ASCENT)
+                                          (ZEROP DESCENT))   (* ; 
+                                                           "The ascent has changed;  catch it")
+                                     (SETQ ASCENT NEWASCENT)
+                                     (SETQ DESCENT NEWDESCENT)))
+                                 (SETQ FORCEEND T)
+                                 (SETQ PREVDHYPH NIL)
+                                 (SETQ PREVHYPH NIL)         (* ; 
+            "We're now past needing any hyphens for line breaking, so forget the last hyphen spot.")
+                                 (\RPLPTR CHLIST 0 (CHARCODE EOL))
+                                 (\RPLPTR WLIST 0 (SETQ DX (IMAX DX 6)))
+                                 (COND
+                                    (GATHERBLANK (SETQ TXB1 TX)
+                                           (SETQ GATHERBLANK NIL)))
+                                 (SETQ T1SPACE T)
+                                 (freplace (LINEDESCRIPTOR CR\END) of LINE with T)
+                                 (SETQ TX (IPLUS TX DX))
+                                 (replace (LINEDESCRIPTOR LSTLN) of LINE with T)
+                                                             (* ; 
+                                    "This has to be done better when we get non-para breaking CRs.")
+                                 (RETURN))
                             (TAB 
-                                 (* ;; "Try to be reasonable with tabs.  This will create trouble when doing fast-case insert/delete, but Pah! for now.")
+                                 (* ;; "Try to be reasonable with tabs.  This will create trouble when doing fast-case insert/delete, but Pah! for now.")
 
                                  (replace (LINEDESCRIPTOR LHASTABS) of LINE with T)
-                                                             (* ; "To disable smart screen update")
+                                                             (* ; "To disable smart screen update")
                                  (COND
-                                    (NEWASCENT               (* ; 
-                                                           "The ascent has changed;  catch it")
+                                    (NEWASCENT               (* ; 
+                                                           "The ascent has changed;  catch it")
                                            (SETQ ASCENT (IMAX ASCENT NEWASCENT))
                                            (SETQ DESCENT (IMAX DESCENT NEWDESCENT))
                                            (SETQ NEWASCENT NIL)))
@@ -394,15 +417,15 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
                                  (SETQ TABPENDING
                                   (\TEDIT.FORMATTABS TEXTOBJ TABSPEC THISLINE CHLIST WLIST TX 
                                          DEFAULTTAB LEFTEDGE TABPENDING 0 NIL))
-                                                             (* ; 
-                           "Figure out which tab stop to use, and what we need to do to get there.")
+                                                             (* ; 
+                           "Figure out which tab stop to use, and what we need to do to get there.")
                                  [COND
-                                    ((FIXP TABPENDING)       (* ; 
-                          "If it returns a number, that is the new TX, adjusted for any prior tabs")
+                                    ((FIXP TABPENDING)       (* ; 
+                          "If it returns a number, that is the new TX, adjusted for any prior tabs")
                                      (SETQ TX TABPENDING)
                                      (SETQ TABPENDING NIL))
-                                    (TABPENDING              (* ; 
-                                                 "Otherwise, look in the PENDINGTAB for the new TX")
+                                    (TABPENDING              (* ; 
+                                                 "Otherwise, look in the PENDINGTAB for the new TX")
                                            (SETQ TX (fetch PTNEWTX of TABPENDING]
                                  (COND
                                     (GATHERBLANK (SETQ TXB1 TX)
@@ -411,56 +434,56 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
                                  (SETQ DX (\GETBASEPTR WLIST 0))
                                  (\TEDIT.PURGE.SPACES (fetch (THISLINE CHARS) of THISLINE
                                                                  )
-                                        PREVSP)              (* ; 
-                       "All the spaces before a tab don't take part in justification from here on.")
-                                 (SETQ %#BLANKS 0)           (* ; 
-                    "Also reset the count of spaces on this line, so we widen later spaces enough.")
+                                        PREVSP)              (* ; 
+                       "All the spaces before a tab don't take part in justification from here on.")
+                                 (SETQ %#BLANKS 0)           (* ; 
+                    "Also reset the count of spaces on this line, so we widen later spaces enough.")
                                  (SETQ PREVSP 0)
                                  (SETQ T1SPACE T)
                                  (SETQ TX (IPLUS TX DX))
-                                 (SETQ TXB TX)               (* ; 
-                            "Remember the world in case this is the 'space' before the line breaks")
+                                 (SETQ TXB TX)               (* ; 
+                            "Remember the world in case this is the 'space' before the line breaks")
                                  (SETQ DXB DX)
                                  (SETQ LOOK#B LOOKNO)
                                  (SETQ ASCENTB ASCENT)
                                  (SETQ DESCENTB DESCENT)
                                  (SETQ PREVDHYPH NIL)
-                                 (SETQ PREVHYPH NIL)         (* ; 
-            "We're now past needing any hyphens for line breaking, so forget the last hyphen spot.")
+                                 (SETQ PREVHYPH NIL)         (* ; 
+            "We're now past needing any hyphens for line breaking, so forget the last hyphen spot.")
                                  (SETQ INVISIBLERUNSB INVISIBLERUNS))
                             (PROGN (COND
                                       ((AND (EQ CH (CHARCODE "0,377"))
                                             (NOT (ffetch (TEXTOBJ TXTNONSCHARS) of TEXTOBJ)))
 
-                                       (* ;; 
-                         "Character-set change character.  This suggests undetected NS characters.")
+                                       (* ;; 
+                         "Character-set change character.  This suggests undetected NS characters.")
 
                                        (\TEDIT.NSCHAR.RUN CHNO TEXTOBJ TEXTSTREAM)
-                                                             (* ; 
-                                                  "Leaves us ready to BIN again at the same place.")
+                                                             (* ; 
+                                                  "Leaves us ready to BIN again at the same place.")
 
-                                       (* ;; "Back up the cache pointers and counters so that when we go to the top of the loop we're where we are now.")
+                                       (* ;; "Back up the cache pointers and counters so that when we go to the top of the loop we're where we are now.")
 
                                        (SETQ CHLIST (\ADDBASE CHLIST -2))
                                        (SETQ WLIST (\ADDBASE WLIST -2))
                                        (add CHNO -1)
                                        (add TLEN -1)
                                        (SETQ TEXTLEN (fetch (TEXTOBJ TEXTLEN) of TEXTOBJ))
-                                                             (* ; 
-                             "Because moving to NS characters changes the TEXTLEN for the shorter.")
+                                                             (* ; 
+                             "Because moving to NS characters changes the TEXTLEN for the shorter.")
                                        )
                                       (T 
-                                         (* ;; "Not a formatting character, so gather")
+                                         (* ;; "Not a formatting character, so gather")
 
-                                         (SETQ GATHERBLANK T)(* ; "Blanks are interesting again.")
+                                         (SETQ GATHERBLANK T)(* ; "Blanks are interesting again.")
                                          (COND
                                             ((IGREATERP (SETQ TX (IPLUS TX DX))
-                                                    WIDTH)   (* ; 
-                                 "We're past the right margin;  stop formatting at the last blank.")
+                                                    WIDTH)   (* ; 
+                                 "We're past the right margin;  stop formatting at the last blank.")
                                              (SETQ FORCEEND T)
                                              [COND
-                                                (PREVDHYPH   (* ; 
-                             "There's a hyphen we can break at.  Go back there and break the line.")
+                                                (PREVDHYPH   (* ; 
+                             "There's a hyphen we can break at.  Go back there and break the line.")
                                                        (freplace (LINEDESCRIPTOR CHARLIM)
                                                           of LINE with CH#B)
                                                        (\RPLPTR ORIGCHLIST (LLSH (SUB1 PREVDHYPH)
@@ -475,8 +498,8 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
                                                        (SETQ DESCENT DESCENTB)
                                                        (SETQ LOOKNO LOOK#B)
                                                        (SETQ INVISIBLERUNS INVISIBLERUNSB))
-                                                (PREVHYPH    (* ; 
-                             "There's a hyphen we can break at.  Go back there and break the line.")
+                                                (PREVHYPH    (* ; 
+                             "There's a hyphen we can break at.  Go back there and break the line.")
                                                        (freplace (LINEDESCRIPTOR CHARLIM)
                                                           of LINE with CH#B)
                                                        (SETQ TX TXB)
@@ -485,8 +508,8 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
                                                        (SETQ DESCENT DESCENTB)
                                                        (SETQ LOOKNO LOOK#B)
                                                        (SETQ INVISIBLERUNS INVISIBLERUNSB))
-                                                (T1SPACE     (* ; 
-                        "There's a breaking point on this line.  Go back there and break the line.")
+                                                (T1SPACE     (* ; 
+                        "There's a breaking point on this line.  Go back there and break the line.")
                                                        (freplace (LINEDESCRIPTOR CHARLIM)
                                                           of LINE with CH#B)
                                                        (SETQ TX TXB)
@@ -500,24 +523,24 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
                                                     with (IMAX (SUB1 CHNO)
                                                                    CH#1))
                                                  (SETQ TX (IDIFFERENCE TX DX))
-                                                             (* ; 
-                                         "No spaces on this line;  break it before this character.")
+                                                             (* ; 
+                                         "No spaces on this line;  break it before this character.")
 
-                                                 (* ;; "Check line break character.")
+                                                 (* ;; "Check line break character.")
 
                                                  (while (OR (MEMBER (\GETBASEPTR CHLIST -2)
                                                                        TEDIT.DONT.LAST.CHARS)
                                                                 (MEMBER CH TEDIT.DONT.BREAK.CHARS))
                                                     do 
 
-                                                          (* ;; 
-                                           "This character ch doesn't appear at first of lines. or")
+                                                          (* ;; 
+                                           "This character ch doesn't appear at first of lines. or")
 
-                                                          (* ;; 
-                                           "Previous character doesn't appear at the end of lines.")
+                                                          (* ;; 
+                                           "Previous character doesn't appear at the end of lines.")
 
-                                                          (* ;; 
-                                                        "So,move previous character to next line.")
+                                                          (* ;; 
+                                                        "So,move previous character to next line.")
 
                                                           (SETQ CHLIST (\ADDBASE CHLIST -2))
                                                           (SETQ WLIST (\ADDBASE WLIST -2))
@@ -527,60 +550,60 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
                                                  (freplace (LINEDESCRIPTOR CHARLIM) of LINE
                                                     with (IMAX (SUB1 CHNO)
                                                                    CH#1)))
-                                                (T           (* ; 
-                                                  "Can't split BEFORE the first thing on the line!")
+                                                (T           (* ; 
+                                                  "Can't split BEFORE the first thing on the line!")
                                                    (freplace (LINEDESCRIPTOR CHARLIM)
                                                       of LINE with CHNO)
                                                    (\RPLPTR CHLIST 0 CH)
                                                    (\RPLPTR WLIST 0 DX)
                                                    (COND
                                                       (NEWASCENT 
-                                                             (* ; 
-                                                           "The ascent has changed;  catch it")
+                                                             (* ; 
+                                                           "The ascent has changed;  catch it")
                                                              (SETQ ASCENT (IMAX ASCENT NEWASCENT))
                                                              (SETQ DESCENT (IMAX DESCENT NEWDESCENT))
                                                              (SETQ NEWASCENT NIL]
                                              (RETURN))
-                                            (T               (* ; "Not past the rightmargin yet...")
+                                            (T               (* ; "Not past the rightmargin yet...")
                                                (COND
-                                                  (NEWASCENT (* ; 
-                                                           "The ascent has changed;  catch it")
+                                                  (NEWASCENT (* ; 
+                                                           "The ascent has changed;  catch it")
                                                          (SETQ ASCENT (IMAX ASCENT NEWASCENT))
                                                          (SETQ DESCENT (IMAX DESCENT NEWDESCENT))
                                                          (SETQ NEWASCENT NIL)))
                                                (\RPLPTR CHLIST 0 CH)
                                                (\RPLPTR WLIST 0 DX)
                                                (SELCHARQ CH
-                                                    (%.      (* ; "Check for decimal tabs")
+                                                    (%.      (* ; "Check for decimal tabs")
                                                         (COND
                                                            ((AND TABPENDING (NOT (FIXP TABPENDING))
                                                                  (EQ (fetch PTTYPE of 
                                                                                            TABPENDING
                                                                             )
                                                                      'DECIMAL))
-                                                             (* ; 
-                           "Figure out which tab stop to use, and what we need to do to get there.")
+                                                             (* ; 
+                           "Figure out which tab stop to use, and what we need to do to get there.")
                                                             (add (fetch (PENDINGTAB PTTABX)
                                                                         of TABPENDING)
                                                                    DX)
-                                                             (* ; 
-             "Adjust the tab stop's X value so that the LEFT edge of the decimal point goes there.")
+                                                             (* ; 
+             "Adjust the tab stop's X value so that the LEFT edge of the decimal point goes there.")
                                                             (SETQ TABPENDING
                                                              (\TEDIT.FORMATTABS TEXTOBJ TABSPEC 
                                                                     THISLINE CHLIST WLIST TX 
                                                                     DEFAULTTAB LEFTEDGE TABPENDING 0
                                                                     T))
-                                                             (* ; 
-                                                  "Tab over to the LEFT side of the decimal point.")
+                                                             (* ; 
+                                                  "Tab over to the LEFT side of the decimal point.")
                                                             [COND
                                                                ((FIXP TABPENDING)
-                                                             (* ; 
-                          "If it returns a number, that is the new TX, adjusted for any prior tabs")
+                                                             (* ; 
+                          "If it returns a number, that is the new TX, adjusted for any prior tabs")
                                                                 (SETQ TX TABPENDING)
                                                                 (SETQ TABPENDING NIL))
                                                                (TABPENDING 
-                                                             (* ; 
-                                                 "Otherwise, look in the PENDINGTAB for the new TX")
+                                                             (* ; 
+                                                 "Otherwise, look in the PENDINGTAB for the new TX")
                                                                       (SETQ TX (fetch PTNEWTX
                                                                                   of TABPENDING]
                                                             (COND
@@ -591,23 +614,23 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
                                                              (fetch (THISLINE CHARS) of
                                                                                          THISLINE)
                                                              PREVSP)
-                                                             (* ; 
-                       "All the spaces before a tab don't take part in justification from here on.")
+                                                             (* ; 
+                       "All the spaces before a tab don't take part in justification from here on.")
                                                             (SETQ %#BLANKS 0)
-                                                             (* ; 
-                    "Also reset the count of spaces on this line, so we widen later spaces enough.")
+                                                             (* ; 
+                    "Also reset the count of spaces on this line, so we widen later spaces enough.")
                                                             (SETQ PREVSP 0)
                                                             (SETQ T1SPACE T)
                                                             (SETQ TXB TX)
-                                                             (* ; 
-                            "Remember the world in case this is the 'space' before the line breaks")
+                                                             (* ; 
+                            "Remember the world in case this is the 'space' before the line breaks")
                                                             (SETQ DXB DX)
                                                             (SETQ LOOK#B LOOKNO)
                                                             (SETQ ASCENTB ASCENT)
                                                             (SETQ DESCENTB DESCENT)
                                                             (SETQ INVISIBLERUNSB INVISIBLERUNS))))
                                                     ((- "357,045") 
-                                                             (* ; "Hyphen, M-dash")
+                                                             (* ; "Hyphen, M-dash")
                                                          (SETQ PREVHYPH (ADD1 TLEN))
                                                          (SETQ PREVDHYPH NIL)
                                                          (SETQ TXB1 (SETQ TXB TX))
@@ -618,11 +641,11 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
                                                          (SETQ DESCENTB DESCENT)
                                                          (SETQ INVISIBLERUNSB INVISIBLERUNS))
                                                     ("357,042" 
-                                                             (* ; "non-breaking hyphen")
+                                                             (* ; "non-breaking hyphen")
                                                                (\RPLPTR CHLIST 0 (CHARCODE "-")))
                                                     ("357,043" 
-                                                             (* ; "Discretionary hyphen")
-                                                             (* ; "And isn't actually displayed.")
+                                                             (* ; "Discretionary hyphen")
+                                                             (* ; "And isn't actually displayed.")
                                                                (SETQ PREVDHYPH (ADD1 TLEN))
                                                                (SETQ PREVHYPH NIL)
                                                                (SETQ TXB1 (SETQ TXB TX))
@@ -632,48 +655,48 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
                                                                (SETQ ASCENTB ASCENT)
                                                                (SETQ DESCENTB DESCENT)
                                                                (\RPLPTR WLIST 0 0)
-                                                             (* ; 
-                                                        "Unless we use it, the prevhyph is 0 wide.")
+                                                             (* ; 
+                                                        "Unless we use it, the prevhyph is 0 wide.")
                                                                (\RPLPTR CHLIST 0 NIL)
                                                                (add TX (IMINUS DX))
                                                                (SETQ INVISIBLERUNSB INVISIBLERUNS))
                                                     ("357,041" 
-                                                             (* ; "non-breaking space."))
+                                                             (* ; "non-breaking space."))
                                                     NIL]
-                       (SETQ CHLIST (\ADDBASE CHLIST 2))     (* ; 
-                                                "Move the pointers forward for the next character.")
-                       (SETQ WLIST (\ADDBASE WLIST 2)))      (* ; "End of char loop")
+                       (SETQ CHLIST (\ADDBASE CHLIST 2))     (* ; 
+                                                "Move the pointers forward for the next character.")
+                       (SETQ WLIST (\ADDBASE WLIST 2)))      (* ; "End of char loop")
               (COND
                  ((AND (IEQP TLEN 255)
-                       (ILESSP CHNO TEXTLEN))                (* ; 
-                                                         "This line is too long for us to format??")
+                       (ILESSP CHNO TEXTLEN))                (* ; 
+                                                         "This line is too long for us to format??")
                   (TEDIT.PROMPTPRINT TEXTOBJ "Line too long to format." T)))
               (COND
-                 (TABPENDING                                 (* ; 
-                                                       "There is a TAB outstanding.  Go handle it.")
+                 (TABPENDING                                 (* ; 
+                                                       "There is a TAB outstanding.  Go handle it.")
                         (add (fetch (PENDINGTAB PTTABX) of TABPENDING)
-                               DX)                           (* ; 
-                        "Adjust the tab stop's X value so that the LEFT edge of the CR goes there.")
+                               DX)                           (* ; 
+                        "Adjust the tab stop's X value so that the LEFT edge of the CR goes there.")
                         (SETQ TABPENDING
                          (\TEDIT.FORMATTABS TEXTOBJ TABSPEC THISLINE CHLIST WLIST TX DEFAULTTAB 
                                 LEFTEDGE TABPENDING 0 T))
 
-                        (* ;; "Finish up processing the outstanding TAB.  We get back the new X position, with that taken into account.")
+                        (* ;; "Finish up processing the outstanding TAB.  We get back the new X position, with that taken into account.")
 
                         (SETQ TX TABPENDING)
                         (SETQ TABPENDING NIL)
                         (\TEDIT.PURGE.SPACES (fetch (THISLINE CHARS) of THISLINE)
-                               PREVSP)                       (* ; 
-                                            "Don't use the spaces before the TAB in justification.")
+                               PREVSP)                       (* ; 
+                                            "Don't use the spaces before the TAB in justification.")
                         (SETQ PREVSP 0]
-             (T                                              (* ; 
-             "No text to go in this line;  set Ascent/Descent to the default font from the window.")
+             (T                                              (* ; 
+             "No text to go in this line;  set Ascent/Descent to the default font from the window.")
                 [SETQ PC (AND (IGREATERP TEXTLEN 0)
                               (\CHTOPC TEXTLEN (fetch (TEXTOBJ PCTB) of TEXTOBJ]
-                                                             (* ; 
-                                  "Grab the last real part of the document, to get paragraph looks")
-                (\EDITSETA LOOKS 0 CLOOKS)                   (* ; 
-                                   "Set up the initial looks so that \DISPLAYLINE doesn't complain")
+                                                             (* ; 
+                                  "Grab the last real part of the document, to get paragraph looks")
+                (\EDITSETA LOOKS 0 CLOOKS)                   (* ; 
+                                   "Set up the initial looks so that \DISPLAYLINE doesn't complain")
                 (SETQ FONT (OR (AND (fetch (TEXTOBJ CARETLOOKS) of TEXTOBJ)
                                     (fetch CLFONT of (fetch (TEXTOBJ CARETLOOKS)
                                                                 of TEXTOBJ)))
@@ -682,14 +705,14 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
                                                                 of TEXTOBJ)))
                                DEFAULTFONT))
 
-                (* ;; "The font we use is preferably the caret looks, else the default for this edit, else the system default")
+                (* ;; "The font we use is preferably the caret looks, else the default for this edit, else the system default")
 
                 (SETQ ASCENT (FONTPROP FONT 'ASCENT))
                 (SETQ DESCENT (FONTPROP FONT 'DESCENT))
                 (SETQ FMTSPEC (OR FMTSPEC (AND PC (fetch (PIECE PPARALOOKS) of PC))
                                   (fetch (TEXTOBJ FMTSPEC) of TEXTOBJ)))
-                                                             (* ; 
-                                                           "Use the preceding paragraph's looks")
+                                                             (* ; 
+                                                           "Use the preceding paragraph's looks")
                 (SETQ 1STLN (OR (NOT PC)
                                 (fetch (PIECE PPARALAST) of PC)))
                 (replace (LINEDESCRIPTOR 1STLN) of LINE with 1STLN)
@@ -718,31 +741,31 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
                                                                                         )
                                                                          of TEXTOBJ)))
                                         DEFAULTFONT)
-                                 'HEIGHT]                    (* ; 
-                                                          "Line's height (or 12 for an empty line)")
+                                 'HEIGHT]                    (* ; 
+                                                          "Line's height (or 12 for an empty line)")
           (replace (LINEDESCRIPTOR ASCENT) of LINE with ASCENT)
           (replace (LINEDESCRIPTOR DESCENT) of LINE with DESCENT)
           (freplace (LINEDESCRIPTOR CHARTOP) of LINE with CHNO)
           [COND
              (FORCEEND NIL)
              (T (SETQ CHNO (SUB1 CHNO))
-                (SETQ TLEN (SUB1 TLEN]                       (* ; 
-                        "If we ran off the end of the text, then keep true space left on the line.")
+                (SETQ TLEN (SUB1 TLEN]                       (* ; 
+                        "If we ran off the end of the text, then keep true space left on the line.")
           (freplace (LINEDESCRIPTOR LXLIM) of LINE with TX)
           [freplace (LINEDESCRIPTOR SPACELEFT) of LINE with (COND
                                                                            (FORCEEND 
-                                                             (* ; 
-                              "The line was forced to end.  Back up to start of last blank section")
+                                                             (* ; 
+                              "The line was forced to end.  Back up to start of last blank section")
                                                                                   (IDIFFERENCE WIDTH
                                                                                          TXB1))
                                                                            (GATHERBLANK 
-                                                             (* ; 
-                                              "Otherwise, use the rightmost character on the line.")
+                                                             (* ; 
+                                              "Otherwise, use the rightmost character on the line.")
                                                                                   (IDIFFERENCE WIDTH
                                                                                          TX))
                                                                            (T 
 
-                                         (* ;; "The line ended with a run of white space.  Ignore it for purposes of deciding how much more we can fit on the line.")
+                                         (* ;; "The line ended with a run of white space.  Ignore it for purposes of deciding how much more we can fit on the line.")
 
                                                                               (IDIFFERENCE WIDTH TXB1
                                                                                      ]
@@ -1061,9 +1084,9 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
 (DEFINEQ
 
 (\DISPLAYLINE
-  [LAMBDA (TEXTOBJ LINE WINDOW)                          (* ; "Edited 29-Mar-94 15:26 by jds")
+  [LAMBDA (TEXTOBJ LINE WINDOW)                         (* ; "Edited 30-Apr-2021 14:41 by rmk:")
 
-    (* ;; "Display the line of text LINE in the edit window where it belongs.")
+    (* ;; "Display the line of text LINE in the edit window where it belongs.")
 
     (PROG ((CH 0)
            (CHLIST (fetch (THISLINE CHARS) of (fetch (TEXTOBJ THISLINE) of TEXTOBJ)))
@@ -1084,8 +1107,8 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
            DISPLAYDATA DDPILOTBBT DDWIDTHCACHE DDOFFSETCACHE CURY LHEIGHT SCALE)
           [SETQ LHEIGHT (COND
                            ((fetch (LINEDESCRIPTOR PREVLINE) of LINE)
-                                                             (* ; 
-                                  "So if theres a base-to-base measure, we clear everything right.")
+                                                             (* ; 
+                                  "So if theres a base-to-base measure, we clear everything right.")
                             (IMAX (IDIFFERENCE (fetch (LINEDESCRIPTOR YBOT)
                                                   of (fetch (LINEDESCRIPTOR PREVLINE)
                                                             of LINE))
@@ -1093,9 +1116,9 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
                                   (fetch (LINEDESCRIPTOR LHEIGHT) of LINE)))
                            (T (fetch (LINEDESCRIPTOR LHEIGHT) of LINE]
           (COND
-             (HARDCOPYMODE                                   (* ; 
-                                                     "This is a hardcopy-mode line.  Scale things.")
-                                                             (* ; "(SETQ DS HCPYDS)")
+             (HARDCOPYMODE                                   (* ; 
+                                                     "This is a hardcopy-mode line.  Scale things.")
+                                                             (* ; "(SETQ DS HCPYDS)")
                     (SETQ SCALE (DSPSCALE NIL HCPYDS)))
              (T (SETQ SCALE 1)))
           (SETQ CACHE (\TEDIT.LINECACHE (fetch (TEXTOBJ DISPLAYCACHE) of TEXTOBJ)
@@ -1106,8 +1129,8 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
                                 (T (fetch (LINEDESCRIPTOR RIGHTMARGIN) of LINE)))
                              LHEIGHT))
           (COND
-             ((NEQ CACHE OLDCACHE)                           (* ; 
-               "We changed the bitmaps because this line was bigger--update the displaystream, too")
+             ((NEQ CACHE OLDCACHE)                           (* ; 
+               "We changed the bitmaps because this line was bigger--update the displaystream, too")
               (DSPDESTINATION CACHE DS)
               (DSPCLIPPINGREGION (create REGION
                                         LEFT _ 0
@@ -1116,11 +1139,11 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
                                         HEIGHT _ (fetch BITMAPHEIGHT of CACHE))
                      DS)))
           (BITBLT NIL 0 0 CACHE 0 0 NIL NIL 'TEXTURE 'REPLACE WHITESHADE)
-                                                             (* ; "Clear the line cache")
+                                                             (* ; "Clear the line cache")
           (COND
-             (HARDCOPYMODE                                   (* ; 
-                                                     "This is a hardcopy-mode line.  Scale things.")
-                                                             (* ; "(SETQ DS HCPYDS)")
+             (HARDCOPYMODE                                   (* ; 
+                                                     "This is a hardcopy-mode line.  Scale things.")
+                                                             (* ; "(SETQ DS HCPYDS)")
                     (SETQ SCALE (DSPSCALE NIL HCPYDS)))
              (T (SETQ SCALE 1)))
           [COND
@@ -1130,12 +1153,12 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
                    (IGEQ (fetch (LINEDESCRIPTOR YBOT) of LINE)
                          (fetch (TEXTOBJ WBOTTOM) of TEXTOBJ)))
 
-              (* ;; "Only display the line of it contains text (CHAR1 > 0), appears before the end of the test, and is on-screen.")
+              (* ;; "Only display the line of it contains text (CHAR1 > 0), appears before the end of the test, and is on-screen.")
 
               (COND
                  ((NEQ (fetch (THISLINE DESC) of THISLINE)
-                       LINE)                                 (* ; 
-                                                          "No image cache -- re-format and display")
+                       LINE)                                 (* ; 
+                                                          "No image cache -- re-format and display")
                   (\FORMATLINE TEXTOBJ NIL (fetch (LINEDESCRIPTOR CHAR1) of LINE)
                          LINE)))
               (MOVETO (fetch (LINEDESCRIPTOR LEFTMARGIN) of LINE)
@@ -1145,65 +1168,65 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
               (SETQ DDPILOTBBT (ffetch DDPILOTBBT of DISPLAYDATA))
               (SETQ XOFFSET (fetch DDXOFFSET of DISPLAYDATA))
 
-              (* ;; "The X position of the left edge of the window, since \TEDIT.BLTCHAR works on the screen bitmap itself.")
+              (* ;; "The X position of the left edge of the window, since \TEDIT.BLTCHAR works on the screen bitmap itself.")
 
               (SETQ CLIPLEFT (fetch DDClippingLeft of DISPLAYDATA))
-                                                             (* ; 
-                     "The left and right edges of the clipping region for the text display window.")
+                                                             (* ; 
+                     "The left and right edges of the clipping region for the text display window.")
               (SETQ CLIPRIGHT (fetch DDClippingRight of DISPLAYDATA))
               (SETQ OFONT (DSPFONT (fetch CLFONT of (SETQ OLOOKS (\EDITELT LOOKS 0)))
-                                 DS))                        (* ; "The starting font")
+                                 DS))                        (* ; "The starting font")
               (SETQ DDWIDTHCACHE (ffetch DDWIDTHSCACHE of DISPLAYDATA))
-                                                             (* ; 
-                                                           "Cache the character-image widths")
+                                                             (* ; 
+                                                           "Cache the character-image widths")
               (SETQ DDOFFSETCACHE (ffetch DDOFFSETSCACHE of DISPLAYDATA))
-                                                             (* ; 
-                                                          "And the offset-into-strike-bitmap array")
+                                                             (* ; 
+                                                          "And the offset-into-strike-bitmap array")
               (SETQ LOOKSTARTX (fetch (LINEDESCRIPTOR LEFTMARGIN) of LINE))
-                                                             (* ; 
-                                                  "Starting X position for the current-looks text.")
+                                                             (* ; 
+                                                  "Starting X position for the current-looks text.")
               (AND (fetch CLOFFSET of OLOOKS)
                    (RELMOVETO 0 (FIXR (FTIMES SCALE (fetch CLOFFSET of OLOOKS)))
-                          DS))                               (* ; 
-                                                      "Any sub- or superscripting at start of line")
+                          DS))                               (* ; 
+                                                      "Any sub- or superscripting at start of line")
               (bind (LOOKNO _ 1)
                      DX
                      (TX _ (IPLUS XOFFSET (fetch (LINEDESCRIPTOR LEFTMARGIN) of LINE)))
                  for I from 0 to (fetch (THISLINE LEN) of THISLINE)
                  do 
 
-                       (* ;; "Display the line character by character")
+                       (* ;; "Display the line character by character")
 
-                       (SETQ CH (\EDITELT CHLIST I))         (* ; 
-                                                      "Grab the character (or IMAGEOBJ) to display")
-                       (SETQ DX (\EDITELT WLIST I))          (* ; "And its width")
+                       (SETQ CH (\EDITELT CHLIST I))         (* ; 
+                                                      "Grab the character (or IMAGEOBJ) to display")
+                       (SETQ DX (\EDITELT WLIST I))          (* ; "And its width")
                        [SELECTC CH
-                           (LMInvisibleRun                   (* ; 
-                                        "An INVISIBLE run -- skip it, and skip over the char count")
+                           (LMInvisibleRun                   (* ; 
+                                        "An INVISIBLE run -- skip it, and skip over the char count")
                                 (add LOOKNO 1))
-                           (LMLooksChange                    (* ; "A LOOKS change")
+                           (LMLooksChange                    (* ; "A LOOKS change")
                                           (replace DDXPOSITION of DISPLAYDATA
                                              with (IDIFFERENCE TX XOFFSET))
-                                                             (* ; 
-                                            "Make the displaystream reflect our current X position")
+                                                             (* ; 
+                                            "Make the displaystream reflect our current X position")
                                           (TEDIT.MODIFYLOOKS LINE LOOKSTARTX DS OLOOKS
                                                  (fetch (LINEDESCRIPTOR DESCENT) of LINE))
-                                                             (* ; 
-                "Make any necessary changes to the preceding characters (underline, strike-out &c)")
+                                                             (* ; 
+                "Make any necessary changes to the preceding characters (underline, strike-out &c)")
                                           (DSPFONT (fetch CLFONT of (SETQ OLOOKS
                                                                              (\EDITELT LOOKS LOOKNO))
                                                           )
-                                                 DS)         (* ; "Set the new font")
-                                          (add LOOKNO 1) (* ; "Grab the next set of char looks")
+                                                 DS)         (* ; "Set the new font")
+                                          (add LOOKNO 1) (* ; "Grab the next set of char looks")
                                           (AND (fetch CLOFFSET of OLOOKS)
                                                (RELMOVETO 0 (fetch CLOFFSET of OLOOKS)
-                                                      DS))   (* ; "Account for super/subscripting")
+                                                      DS))   (* ; "Account for super/subscripting")
                                           (SETQ LOOKSTARTX (IDIFFERENCE TX XOFFSET))
-                                                             (* ; 
-                                     "Remember the starting Xpos for possible later underlining &c")
+                                                             (* ; 
+                                     "Remember the starting Xpos for possible later underlining &c")
                                           )
-                           ((CHARCODE (TAB %#^I))            (* ; 
-                                "TAB: use the width from the cache to decide the right formatting.")
+                           ((CHARCODE (TAB %#^I))            (* ; 
+                                "TAB: use the width from the cache to decide the right formatting.")
                                 [COND
                                    ((OR (IEQP CH (CHARCODE %#^I))
                                         (fetch CLLEADER of OLOOKS)
@@ -1228,53 +1251,53 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
                                                                       SCALE))
                                                          DISPLAYDATA DDPILOTBBT CLIPRIGHT))
                                                        ((OR TERMSA HARDCOPYMODE)
-                                                             (* ; 
-                                                           "Using special instrns from TERMSA")
+                                                             (* ; 
+                                                           "Using special instrns from TERMSA")
                                                         (\DSPPRINTCHAR DS (CHARCODE %.)))
-                                                       (T    (* ; "Native charcodes")
+                                                       (T    (* ; "Native charcodes")
                                                           (\TEDIT.BLTCHAR (CHARCODE %.)
                                                                  DS
                                                                  (IDIFFERENCE TTX DOTWIDTH)
                                                                  DISPLAYDATA DDPILOTBBT CLIPRIGHT)))
                                                    (add TTX DOTWIDTH])
-                           (13                               (* ; "It's a CR")
-                               NIL)
-                           (NIL                              (* ; "NIL signifies a character we've suppressed as part of line formatting (e.g., a discretionary hyphen we didn't use to break the line).  Show it as a thin black line.")
+                           ((CHARCODE (EOL LF CR))           (* ; "It's a CR")
+                                NIL)
+                           (NIL                              (* ; "NIL signifies a character we've suppressed as part of line formatting (e.g., a discretionary hyphen we didn't use to break the line).  Show it as a thin black line.")
                                 (BLTSHADE BLACKSHADE DS TX 0 1 100 'PAINT))
                            (COND
-                              [(SMALLP CH)                   (* ; 
-                                                           "Normal character -- just display it.")
+                              [(SMALLP CH)                   (* ; 
+                                                           "Normal character -- just display it.")
                                (COND
                                   (HARDCOPYMODE (\TEDIT.BLTCHAR CH DS (FIXR (FQUOTIENT TX SCALE))
                                                        DISPLAYDATA DDPILOTBBT CLIPRIGHT))
-                                  ((OR TERMSA HARDCOPYMODE)  (* ; 
-                                                           "Using special instrns from TERMSA")
+                                  ((OR TERMSA HARDCOPYMODE)  (* ; 
+                                                           "Using special instrns from TERMSA")
                                    (\DSPPRINTCHAR DS CH))
-                                  (T                         (* ; "Native charcodes")
+                                  (T                         (* ; "Native charcodes")
                                      (\TEDIT.BLTCHAR CH DS TX DISPLAYDATA DDPILOTBBT CLIPRIGHT]
-                              (T                             (* ; "CH is an object.")
+                              (T                             (* ; "CH is an object.")
                                  (MOVETO (IDIFFERENCE (FIXR (FQUOTIENT TX SCALE))
                                                 XOFFSET)
                                         (SETQ CURY (DSPYPOSITION NIL DS))
-                                        DS)                  (* ; 
-                                              "Go to the base line, left edge of the image region.")
+                                        DS)                  (* ; 
+                                              "Go to the base line, left edge of the image region.")
                                  (APPLY* (IMAGEOBJPROP CH 'DISPLAYFN)
                                         CH DS 'DISPLAY (fetch (TEXTOBJ STREAMHINT) of TEXTOBJ
                                                               ))
-                                                             (* ; 
-                                                           "Tell him to display himself here.")
+                                                             (* ; 
+                                                           "Tell him to display himself here.")
                                  (DSPFONT (fetch CLFONT of OLOOKS)
                                         DS)
                                  (MOVETO (IDIFFERENCE (FIXR (FQUOTIENT TX SCALE))
                                                 XOFFSET)
-                                        CURY DS)             (* ; 
-                                                           "Move to after the object's image")
+                                        CURY DS)             (* ; 
+                                                           "Move to after the object's image")
                                  ]
-                       (add TX DX)                       (* ; "Update our X position")
+                       (add TX DX)                       (* ; "Update our X position")
                  finally (replace DDXPOSITION of DISPLAYDATA
                                 with (IDIFFERENCE (FIXR (FQUOTIENT TX SCALE))
-                                                XOFFSET))    (* ; 
-                                      "Make any necessary looks mods to the last run of characters")
+                                                XOFFSET))    (* ; 
+                                      "Make any necessary looks mods to the last run of characters")
                        (TEDIT.MODIFYLOOKS LINE LOOKSTARTX DS OLOOKS (fetch (LINEDESCRIPTOR 
                                                                                       DESCENT)
                                                                        of LINE]
@@ -1282,22 +1305,22 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
                  (fetch (TEXTOBJ WRIGHT) of TEXTOBJ)
                  LHEIGHT
                  'INPUT
-                 'REPLACE)                                   (* ; 
-                        "Paint the cached image on the screen (this lessens flicker during update)")
+                 'REPLACE)                                   (* ; 
+                        "Paint the cached image on the screen (this lessens flicker during update)")
           (COND
              ((fetch (FMTSPEC FMTREVISED) of (fetch (LINEDESCRIPTOR LFMTSPEC)
                                                         of LINE))
-                                                             (* ; 
-                                                     "This paragraph has been revised, so mark it.")
+                                                             (* ; 
+                                                     "This paragraph has been revised, so mark it.")
               (\TEDIT.MARK.REVISION TEXTOBJ (fetch (LINEDESCRIPTOR LFMTSPEC) of LINE)
                      WINDOWDS LINE)))
           (SELECTQ (fetch (LINEDESCRIPTOR LMARK) of LINE)
-              (GREY                                          (* ; 
-              "This line has some property that isn't visible to the user.  Tell him to be careful")
+              (GREY                                          (* ; 
+              "This line has some property that isn't visible to the user.  Tell him to be careful")
                     (BITBLT NIL 0 0 WINDOWDS 0 (fetch (LINEDESCRIPTOR YBASE) of LINE)
                            6 6 'TEXTURE 'PAINT 42405))
-              (SOLID                                         (* ; 
-              "This line has some property that isn't visible to the user.  Tell him to be careful")
+              (SOLID                                         (* ; 
+              "This line has some property that isn't visible to the user.  Tell him to be careful")
                      (BITBLT NIL 0 0 WINDOWDS 0 (fetch (LINEDESCRIPTOR YBASE) of LINE)
                             6 6 'TEXTURE 'PAINT BLACKSHADE))
               (BITBLT NIL 0 0 WINDOWDS 0 (fetch (LINEDESCRIPTOR YBASE) of LINE)
@@ -2933,8 +2956,9 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
           (RETURN NEWYBOT])
 )
 
-(RPAQQ TEDIT.DONT.BREAK.CHARS (8482 8483 8491 8492 8508 8525 8539 8537 8535 9249 9251 9253 9255 9257 9283 9315 9317 9319 9326 9505 9507 9509 9511 9513 9539 9571 9573 9575 9582)
-)
+(RPAQQ TEDIT.DONT.BREAK.CHARS (8482 8483 8491 8492 8508 8525 8539 8537 8535 9249 9251 9253 9255 
+                                        9257 9283 9315 9317 9319 9326 9505 9507 9509 9511 9513 9539 
+                                        9571 9573 9575 9582))
 
 (RPAQQ TEDIT.DONT.LAST.CHARS (8524 8538 8536 8534))
 (DECLARE%: DOEVAL@COMPILE DONTCOPY
@@ -2942,20 +2966,24 @@ Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
 (GLOBALVARS TEDIT.DONT.BREAK.CHARS TEDIT.DONT.LAST.CHARS)
 )
 
-(COND ((EQ (MACHINETYPE) (QUOTE MAIKO)) (MOVD (QUOTE \MAIKO.DISPLAYLINE) (QUOTE \DISPLAYLINE))) (T (ADDTOVAR \MAIKO.MOVDS (\MAIKO.DISPLAYLINE \DISPLAYLINE))))
+[COND
+   ((EQ (MACHINETYPE)
+        'MAIKO)
+    (MOVD '\MAIKO.DISPLAYLINE '\DISPLAYLINE))
+   (T (ADDTOVAR \MAIKO.MOVDS (\MAIKO.DISPLAYLINE \DISPLAYLINE))]
 (PUTPROPS TEDITSCREEN COPYRIGHT ("Venue & Xerox Corporation" 1983 1984 1985 1986 1987 1988 1989 1990 
-1991 1992 1993 1994))
+1991 1992 1993 1994 2021))
 (DECLARE%: DONTCOPY
-  (FILEMAP (NIL (1875 75847 (\FORMATLINE 1885 . 55593) (\TEDIT.NSCHAR.RUN 55595 . 62412) (
-\TEDIT.PURGE.SPACES 62414 . 62872) (\DOFORMATTING 62874 . 75845)) (75848 106348 (\DISPLAYLINE 75858 . 
-93778) (\MAIKO.DISPLAYLINE 93780 . 102348) (\TEDIT.LINECACHE 102350 . 103101) (\TEDIT.CREATE.LINECACHE
- 103103 . 103847) (\TEDIT.BLTCHAR 103849 . 106346)) (106349 220804 (TEDIT.CR.UPDATESCREEN 106359 . 
-107610) (TEDIT.DELETELINE 107612 . 108646) (TEDIT.INSERT.DISPLAYTEXT 108648 . 123887) (
-TEDIT.INSERT.UPDATESCREEN 123889 . 130641) (TEDIT.UPDATE.SCREEN 130643 . 131861) (\BACKFORMAT 131863
- . 136174) (\FILLWINDOW 136176 . 151280) (\FIXDLINES 151282 . 158519) (\FIXILINES 158521 . 166496) (
-\SHOWTEXT 166498 . 169754) (\TEDIT.ADJUST.LINES 169756 . 177223) (\TEDIT.CLEAR.SCREEN.BELOW.LINE 
-177225 . 177955) (\TEDIT.CLOSEUPLINES 177957 . 186473) (\TEDIT.COPY.LINEDESCRIPTOR 186475 . 192041) (
-\TEDIT.FIXCHANGEDLINE 192043 . 203222) (\TEDIT.FIXCHANGEDPART 203224 . 215651) (\TEDIT.INSERTLINE 
-215653 . 216473) (\TEDIT.LINE.LIST 216475 . 216801) (\TEDIT.MARK.LINES.DIRTY 216803 . 218489) (
-\TEDIT.NEXT.LINE.BOTTOM 218491 . 220802)))))
+  (FILEMAP (NIL (2111 76103 (\FORMATLINE 2121 . 55849) (\TEDIT.NSCHAR.RUN 55851 . 62668) (
+\TEDIT.PURGE.SPACES 62670 . 63128) (\DOFORMATTING 63130 . 76101)) (76104 106607 (\DISPLAYLINE 76114 . 
+94037) (\MAIKO.DISPLAYLINE 94039 . 102607) (\TEDIT.LINECACHE 102609 . 103360) (\TEDIT.CREATE.LINECACHE
+ 103362 . 104106) (\TEDIT.BLTCHAR 104108 . 106605)) (106608 221063 (TEDIT.CR.UPDATESCREEN 106618 . 
+107869) (TEDIT.DELETELINE 107871 . 108905) (TEDIT.INSERT.DISPLAYTEXT 108907 . 124146) (
+TEDIT.INSERT.UPDATESCREEN 124148 . 130900) (TEDIT.UPDATE.SCREEN 130902 . 132120) (\BACKFORMAT 132122
+ . 136433) (\FILLWINDOW 136435 . 151539) (\FIXDLINES 151541 . 158778) (\FIXILINES 158780 . 166755) (
+\SHOWTEXT 166757 . 170013) (\TEDIT.ADJUST.LINES 170015 . 177482) (\TEDIT.CLEAR.SCREEN.BELOW.LINE 
+177484 . 178214) (\TEDIT.CLOSEUPLINES 178216 . 186732) (\TEDIT.COPY.LINEDESCRIPTOR 186734 . 192300) (
+\TEDIT.FIXCHANGEDLINE 192302 . 203481) (\TEDIT.FIXCHANGEDPART 203483 . 215910) (\TEDIT.INSERTLINE 
+215912 . 216732) (\TEDIT.LINE.LIST 216734 . 217060) (\TEDIT.MARK.LINES.DIRTY 217062 . 218748) (
+\TEDIT.NEXT.LINE.BOTTOM 218750 . 221061)))))
 STOP
diff --git a/library/TEDITSCREEN.LCOM b/library/TEDITSCREEN.LCOM
index d0935626..9e18859e 100644
Binary files a/library/TEDITSCREEN.LCOM and b/library/TEDITSCREEN.LCOM differ
diff --git a/loadups/full.dribble b/loadups/full.dribble
index 3c8930cd..907d71fb 100644
--- a/loadups/full.dribble
+++ b/loadups/full.dribble
@@ -1,5 +1,5 @@
 
-Full loadup started at 29-Apr-2021 09:48:51 while connected to 
+Full loadup started at 30-Apr-2021 14:49:55 while connected to 
 {DSK}<Users>kaplan>Local>medley3.5>git-medley>
 
 loading POSTSCRIPTSTREAM
@@ -69,9 +69,9 @@ compiled on 18-May-2018 09:16:59
 File created 20-Apr-2018 08:07:35
 TEDITCOMMANDCOMS
 
-{DSK}<Users>kaplan>Local>medley3.5>git-medley>library>TEDITSCREEN.LCOM;1
-compiled on 18-May-2018 09:18:38
-File created 25-Aug-94 13:26:23
+{DSK}<Users>kaplan>Local>medley3.5>git-medley>library>TEDITSCREEN.LCOM;4
+compiled on 30-Apr-2021 14:42:15
+File created 30-Apr-2021 14:42:15
 TEDITSCREENCOMS
 
 {DSK}<Users>kaplan>Local>medley3.5>git-medley>library>TEDITABBREV.LCOM;1
@@ -94,9 +94,9 @@ compiled on 18-May-2018 09:17:41
 File created 29-Jan-99 17:34:39
 TEDITHISTORYCOMS
 
-{DSK}<Users>kaplan>Local>medley3.5>git-medley>library>TEDITFILE.LCOM;1
-compiled on 18-May-2018 09:17:06
-File created 19-May-2001 11:45:53
+{DSK}<Users>kaplan>Local>medley3.5>git-medley>library>TEDITFILE.LCOM;5
+compiled on 30-Apr-2021 14:46:41
+File created 30-Apr-2021 14:46:41
 TEDITFILECOMS
 
 {DSK}<Users>kaplan>Local>medley3.5>git-medley>library>TEDITWINDOW.LCOM;1
@@ -139,9 +139,9 @@ compiled on 18-May-2018 09:18:32
 File created 25-Aug-94 10:55:28
 TEDITPAGECOMS
 
-{DSK}<Users>kaplan>Local>medley3.5>git-medley>library>TEDITMENU.LCOM;1
-compiled on  4-Jan-2021 13:48:55
-File created  4-Jan-2021 13:48:43
+{DSK}<Users>kaplan>Local>medley3.5>git-medley>library>TEDITMENU.LCOM;4
+compiled on 29-Apr-2021 22:44:22
+File created 29-Apr-2021 22:44:22
 TEDITMENUCOMS
 
 {DSK}<Users>kaplan>Local>medley3.5>git-medley>library>TEDITFNKEYS.LCOM;1
diff --git a/loadups/full.sysout b/loadups/full.sysout
index be1ed1a8..70b6b81c 100644
Binary files a/loadups/full.sysout and b/loadups/full.sysout differ
