diff --git a/library/tedit/TEDIT-STREAM b/library/tedit/TEDIT-STREAM
index de978046..a90a0fa7 100644
--- a/library/tedit/TEDIT-STREAM
+++ b/library/tedit/TEDIT-STREAM
@@ -1,12 +1,13 @@
 (DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10)
 
-(FILECREATED " 2-Dec-2025 17:50:45" {WMEDLEY}<library>tedit>TEDIT-STREAM.;930 194007 
+(FILECREATED "26-Jan-2026 23:58:48" {WMEDLEY}<library>tedit>TEDIT-STREAM.;936 194450 
 
       :EDIT-BY rmk
 
-      :CHANGES-TO (FNS OPENTEXTSTREAM \TEDIT.OPENTEXTFILE)
+      :CHANGES-TO (VARS TEDIT-STREAMCOMS)
+                  (FNS TEDIT.IMAGESTREAM.OPEN \TEDIT.STREAMINIT \TEDIT.TEXTINIT)
 
-      :PREVIOUS-DATE "19-Oct-2025 15:09:09" {WMEDLEY}<library>TEDIT>TEDIT-STREAM.;927)
+      :PREVIOUS-DATE "14-Jan-2026 14:32:01" {WMEDLEY}<library>tedit>TEDIT-STREAM.;933)
 
 
 (PRETTYCOMPRINT TEDIT-STREAMCOMS)
@@ -43,7 +44,9 @@
         (FNS \TEDIT.REOPENTEXTSTREAM \TEDIT.OPENTEXTSTREAM.PIECES \TEDIT.OPENTEXTSTREAM.PROPS 
              \TEDIT.OPENTEXTSTREAM.SETUP.SEL \TEDIT.OPENTEXTSTREAM.WINDOW 
              \TEDIT.OPENTEXTSTREAM.DEFAULTLOOKS \TEDIT.OPENTEXTFILE \TEDIT.CREATE.TEXTSTREAM 
-             \TEDIT.REOPEN.STREAM \TEDIT.TEXTINIT)
+             \TEDIT.REOPEN.STREAM)
+        (FNS \TEDIT.STREAMINIT TEDIT.IMAGESTREAM.OPEN)
+        (ALISTS (IMAGESTREAMTYPES TEDIT))
         
         (* ;; "Is this being used:")
 
@@ -83,7 +86,7 @@
                      (ADDVARS (INSPECTMACROS (TEXTOBJ \TEDIT.TEXTOBJ.PROPNAMES 
                                                     \TEDIT.TEXTOBJ.PROPFETCHFN 
                                                     \TEDIT.TEXTOBJ.PROPSTOREFN]
-        (DECLARE%: DONTEVAL@LOAD DOCOPY (P (\TEDIT.TEXTINIT)))
+        (DECLARE%: DONTEVAL@LOAD DOCOPY (P (\TEDIT.STREAMINIT)))
         (DECLARE%: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY COMPILERVARS (ADDVARS (NLAMA)
                                                                              (NLAML)
                                                                              (LAMA TEXTPROP])
@@ -158,8 +161,7 @@
                                                              "The current selection within the text")
                    LASTARROWX                                (* ; 
                        "X for next arrow up or arrow down. Was: Scratch space for the selection code")
-                   NIL                                       (* ; 
-                                                      "Was MOVESEL: Source for the next MOVE of text")
+                   SECONDARYSEL                              (* ; "Holds secondary selection and operation just before the mouse leaves a window. Was MOVESEL: Source for the next MOVE of text")
                    NIL                                       (* ; 
                                                            "Was SHIFTEDSEL: Source for the next COPY")
                    NIL                                       (* ; 
@@ -1519,7 +1521,8 @@
     (\TEDIT.OPENTEXTSTREAM.DEFAULTLOOKS TEXTOBJ])
 
 (\TEDIT.OPENTEXTSTREAM.SETUP.SEL
-  [LAMBDA (TSTREAM)                                          (* ; "Edited 21-Apr-2025 20:14 by rmk")
+  [LAMBDA (TSTREAM)                                          (* ; "Edited 10-Jan-2026 23:53 by rmk")
+                                                             (* ; "Edited 21-Apr-2025 20:14 by rmk")
                                                              (* ; "Edited  6-Apr-2025 14:24 by rmk")
                                                              (* ; "Edited 17-Feb-2025 08:56 by rmk")
                                                              (* ; "Edited 25-Nov-2024 14:33 by rmk")
@@ -1562,20 +1565,22 @@
                                   (OR (CADR SELPROP)
                                       0)
                                   (OR (CADDR SELPROP)
-                                      'LEFT))
+                                      'LEFT)
+                                  'NORMAL)
                     elseif (FIXP SELPROP)
-                      then (\TEDIT.UPDATE.SEL SEL SELPROP 0 'LEFT)
+                      then (\TEDIT.UPDATE.SEL SEL SELPROP 0 'LEFT 'NORMAL)
                     elseif (FGETTOBJ TEXTOBJ TXTAPPENDONLY)
                       then 
                            (* ;; "Default to after the last character")
 
                            (\TEDIT.UPDATE.SEL SEL (FGETTOBJ TEXTOBJ TEXTLEN)
                                   0
-                                  'RIGHT)
+                                  'RIGHT
+                                  'NORMAL)
                     else 
                          (* ;; "Default to before the first character. UPDATE.SEL screws up the CHLIM=CH#+DCH invariant when DCH=0, it adds 1,  But UPDATE.SEL adds 1 when DCH=0.  That's wrong for the initial caret, so brute-force fix it here.  Maybe it's wrong in general?")
 
-                         (\TEDIT.UPDATE.SEL SEL 1 0 'LEFT)
+                         (\TEDIT.UPDATE.SEL SEL 1 0 'LEFT 'NORMAL)
                          (FSETSEL SEL CHLIM 1))
                   [FSETTOBJ TEXTOBJ CARETLOOKS (if (FGETSEL SEL SET)
                                                    then      (* ; 
@@ -1751,9 +1756,12 @@
                 (* ;; "Return the new value for the stream:")
 
                 NEWSTREAM])
+)
+(DEFINEQ
 
-(\TEDIT.TEXTINIT
-  [LAMBDA NIL                                                (* ; "Edited 23-Sep-2025 21:03 by rmk")
+(\TEDIT.STREAMINIT
+  [LAMBDA NIL                                                (* ; "Edited 26-Jan-2026 16:06 by rmk")
+                                                             (* ; "Edited 23-Sep-2025 21:03 by rmk")
                                                              (* ; "Edited 20-Sep-2025 08:48 by rmk")
                                                              (* ; "Edited 18-Sep-2025 14:52 by rmk")
                                                              (* ; "Edited 10-Jul-2025 11:28 by rmk")
@@ -1807,14 +1815,6 @@
                                 IMSCALE _ [FUNCTION (LAMBDA NIL 1]
                                 IMCOLOR _ (FUNCTION \TEDIT.TEXTCOLOR)))
 
-    (* ;; "Do we need TEXT here?")
-
-    (FONTPROFILE.ADDDEVICE 'TEXT 'DISPLAY)
-    (ADDTOVAR IMAGESTREAMTYPES (TEXT (FONTCREATE \CREATEDISPLAYFONT)
-                                     (CREATECHARSET \CREATECHARSET.DISPLAY)))
-    (ADDTOVAR IMAGESTREAMTYPES (TEDIT (FONTCREATE \CREATEDISPLAYFONT)
-                                      (CREATECHARSET \CREATECHARSET.DISPLAY)))
-
     (* ;; "Maybe more functions later. The INCODE and BACK functions possibly need to count.  If \TEXTBACKFILEPTR takes a count variable, the extra level wouldn't be needed.  But INCCODE wants to go through the BIN opcode")
 
     (MAKE-EXTERNALFORMAT :TEXTSTREAM (FUNCTION \TEDIT.TEXTINCCODEFN)
@@ -1881,8 +1881,15 @@
                                                              (* ; 
                            "Some other kind of stream, so punt to the old handler (if there is one):")
                                       (APPLY* *TEDIT-OLD-STREAM-ERROR-HANDLER* CONDITION])
+
+(TEDIT.IMAGESTREAM.OPEN
+  [LAMBDA (FILE OPTIONS)                                     (* ; "Edited 26-Jan-2026 23:55 by rmk")
+    (OPENTEXTSTREAM FILE NIL OPTIONS])
 )
 
+(ADDTOVAR IMAGESTREAMTYPES (TEDIT (OPENSTREAM TEDIT.IMAGESTREAM.OPEN)
+                                  (CREATECHARSET \CREATECHARSET.DISPLAY)))
+
 
 
 (* ;; "Is this being used:")
@@ -3140,7 +3147,7 @@
 )
 (DECLARE%: DONTEVAL@LOAD DOCOPY 
 
-(\TEDIT.TEXTINIT)
+(\TEDIT.STREAMINIT)
 )
 (DECLARE%: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY COMPILERVARS 
 
@@ -3151,34 +3158,34 @@
 (ADDTOVAR LAMA TEXTPROP)
 )
 (DECLARE%: DONTCOPY
-  (FILEMAP (NIL (36705 67564 (\TEDIT.TEXTBIN 36715 . 47508) (\TEDIT.TEXTPEEKBIN 47510 . 53060) (
-\TEDIT.TEXTBACKFILEPTR 53062 . 58735) (\TEDIT.TEXTBOUT 58737 . 63354) (\TEDIT.INSTALL.FILEBUFFER 63356
- . 67562)) (68462 72753 (\TEDIT.TEXTOUTCHARFN 68472 . 70028) (\TEDIT.TEXTINCCODEFN 70030 . 70769) (
-\TEDIT.TEXTBACKCCODEFN 70771 . 71363) (\TEDIT.TEXTFORMATBYTESTREAM 71365 . 72202) (
-\TEDIT.TEXTFORMATBYTESTRING 72204 . 72751)) (72800 84875 (OPENTEXTSTREAM 72810 . 79786) (
-COPYTEXTSTREAM 79788 . 84098) (TEDIT.STREAMCHANGEDP 84100 . 84402) (TXTFILE 84404 . 84873)) (84876 
-116145 (\TEDIT.REOPENTEXTSTREAM 84886 . 86238) (\TEDIT.OPENTEXTSTREAM.PIECES 86240 . 91168) (
-\TEDIT.OPENTEXTSTREAM.PROPS 91170 . 92272) (\TEDIT.OPENTEXTSTREAM.SETUP.SEL 92274 . 97515) (
-\TEDIT.OPENTEXTSTREAM.WINDOW 97517 . 100308) (\TEDIT.OPENTEXTSTREAM.DEFAULTLOOKS 100310 . 102249) (
-\TEDIT.OPENTEXTFILE 102251 . 104383) (\TEDIT.CREATE.TEXTSTREAM 104385 . 105532) (\TEDIT.REOPEN.STREAM 
-105534 . 107870) (\TEDIT.TEXTINIT 107872 . 116143)) (116183 117371 (\TEDIT.TTYBOUT 116193 . 117369)) (
-117489 139172 (\TEDIT.TEXTCLOSEF 117499 . 118823) (\TEDIT.TEXTDSPFONT 118825 . 120023) (
-\TEDIT.TEXTEOFP 120025 . 121780) (\TEDIT.TEXTGETEOFPTR 121782 . 122105) (\TEDIT.TEXTSETEOFPTR 122107
- . 123394) (\TEDIT.TEXTGETFILEPTR 123396 . 126231) (\TEDIT.TEXTSETFILEINFO 126233 . 126741) (
-\TEDIT.TEXTOPENF 126743 . 127674) (\TEDIT.TEXTSETEOF 127676 . 128292) (\TEDIT.TEXTSETFILEPTR 128294 . 
-130404) (\TEDIT.TEXTDSPXPOSITION 130406 . 133109) (\TEDIT.TEXTDSPYPOSITION 133111 . 133852) (
-\TEDIT.TEXTLEFTMARGIN 133854 . 134445) (\TEDIT.TEXTCOLOR 134447 . 135030) (\TEDIT.TEXTRIGHTMARGIN 
-135032 . 138321) (\TEDIT.TEXTDSPCHARWIDTH 138323 . 138627) (\TEDIT.TEXTDSPSTRINGWIDTH 138629 . 138935)
- (\TEDIT.TEXTDSPLINEFEED 138937 . 139170)) (139210 151823 (\TEDIT.NTHCHARCODE 139220 . 140671) (
-\TEDIT.PIECE.NTHCHARCODE 140673 . 144583) (\TEDIT.RPLCHARCODE 144585 . 146043) (
-\TEDIT.PIECE.RPLCHARCODE 146045 . 151468) (\TEDIT.NTHCHARLOOKS 151470 . 151821)) (152870 173964 (
-\TEDIT.DELETE.SELPIECES 152880 . 156505) (\TEDIT.INSERTCH 156507 . 164546) (\TEDIT.INSERTCH.HISTORY 
-164548 . 168012) (\TEDIT.INSERTEOL 168014 . 169839) (\TEDIT.INSERTCH.INSERTION 169841 . 172678) (
-\TEDIT.INSERTCH.EXTEND 172680 . 173962)) (173965 175469 (\TEDIT.NEXTCHANGEABLE.CHNO 173975 . 174690) (
-\TEDIT.LASTCHANGEABLE.CHNO 174692 . 175467)) (175470 177174 (\SETUPGETCH 175480 . 177172)) (177232 
-181690 (\TEDIT.INSTALL.PIECE 177242 . 181688)) (181728 191194 (TEXTPROP 181738 . 182085) (GETTEXTPROP 
-182087 . 182331) (PUTTEXTPROP 182333 . 182590) (GETTEXTPROPS 182592 . 183036) (PUTTEXTPROPS 183038 . 
-183942) (TEXTPROP.ADD 183944 . 184207) (\TEDIT.TEXTPROP 184209 . 191192)) (191195 193572 (
-\TEDIT.TEXTOBJ.PROPNAMES 191205 . 192464) (\TEDIT.TEXTOBJ.PROPFETCHFN 192466 . 192982) (
-\TEDIT.TEXTOBJ.PROPSTOREFN 192984 . 193570)))))
+  (FILEMAP (NIL (36872 67731 (\TEDIT.TEXTBIN 36882 . 47675) (\TEDIT.TEXTPEEKBIN 47677 . 53227) (
+\TEDIT.TEXTBACKFILEPTR 53229 . 58902) (\TEDIT.TEXTBOUT 58904 . 63521) (\TEDIT.INSTALL.FILEBUFFER 63523
+ . 67729)) (68629 72920 (\TEDIT.TEXTOUTCHARFN 68639 . 70195) (\TEDIT.TEXTINCCODEFN 70197 . 70936) (
+\TEDIT.TEXTBACKCCODEFN 70938 . 71530) (\TEDIT.TEXTFORMATBYTESTREAM 71532 . 72369) (
+\TEDIT.TEXTFORMATBYTESTRING 72371 . 72918)) (72967 85042 (OPENTEXTSTREAM 72977 . 79953) (
+COPYTEXTSTREAM 79955 . 84265) (TEDIT.STREAMCHANGEDP 84267 . 84569) (TXTFILE 84571 . 85040)) (85043 
+108248 (\TEDIT.REOPENTEXTSTREAM 85053 . 86405) (\TEDIT.OPENTEXTSTREAM.PIECES 86407 . 91335) (
+\TEDIT.OPENTEXTSTREAM.PROPS 91337 . 92439) (\TEDIT.OPENTEXTSTREAM.SETUP.SEL 92441 . 97891) (
+\TEDIT.OPENTEXTSTREAM.WINDOW 97893 . 100684) (\TEDIT.OPENTEXTSTREAM.DEFAULTLOOKS 100686 . 102625) (
+\TEDIT.OPENTEXTFILE 102627 . 104759) (\TEDIT.CREATE.TEXTSTREAM 104761 . 105908) (\TEDIT.REOPEN.STREAM 
+105910 . 108246)) (108249 116436 (\TEDIT.STREAMINIT 108259 . 116253) (TEDIT.IMAGESTREAM.OPEN 116255 . 
+116434)) (116624 117812 (\TEDIT.TTYBOUT 116634 . 117810)) (117930 139613 (\TEDIT.TEXTCLOSEF 117940 . 
+119264) (\TEDIT.TEXTDSPFONT 119266 . 120464) (\TEDIT.TEXTEOFP 120466 . 122221) (\TEDIT.TEXTGETEOFPTR 
+122223 . 122546) (\TEDIT.TEXTSETEOFPTR 122548 . 123835) (\TEDIT.TEXTGETFILEPTR 123837 . 126672) (
+\TEDIT.TEXTSETFILEINFO 126674 . 127182) (\TEDIT.TEXTOPENF 127184 . 128115) (\TEDIT.TEXTSETEOF 128117
+ . 128733) (\TEDIT.TEXTSETFILEPTR 128735 . 130845) (\TEDIT.TEXTDSPXPOSITION 130847 . 133550) (
+\TEDIT.TEXTDSPYPOSITION 133552 . 134293) (\TEDIT.TEXTLEFTMARGIN 134295 . 134886) (\TEDIT.TEXTCOLOR 
+134888 . 135471) (\TEDIT.TEXTRIGHTMARGIN 135473 . 138762) (\TEDIT.TEXTDSPCHARWIDTH 138764 . 139068) (
+\TEDIT.TEXTDSPSTRINGWIDTH 139070 . 139376) (\TEDIT.TEXTDSPLINEFEED 139378 . 139611)) (139651 152264 (
+\TEDIT.NTHCHARCODE 139661 . 141112) (\TEDIT.PIECE.NTHCHARCODE 141114 . 145024) (\TEDIT.RPLCHARCODE 
+145026 . 146484) (\TEDIT.PIECE.RPLCHARCODE 146486 . 151909) (\TEDIT.NTHCHARLOOKS 151911 . 152262)) (
+153311 174405 (\TEDIT.DELETE.SELPIECES 153321 . 156946) (\TEDIT.INSERTCH 156948 . 164987) (
+\TEDIT.INSERTCH.HISTORY 164989 . 168453) (\TEDIT.INSERTEOL 168455 . 170280) (\TEDIT.INSERTCH.INSERTION
+ 170282 . 173119) (\TEDIT.INSERTCH.EXTEND 173121 . 174403)) (174406 175910 (\TEDIT.NEXTCHANGEABLE.CHNO
+ 174416 . 175131) (\TEDIT.LASTCHANGEABLE.CHNO 175133 . 175908)) (175911 177615 (\SETUPGETCH 175921 . 
+177613)) (177673 182131 (\TEDIT.INSTALL.PIECE 177683 . 182129)) (182169 191635 (TEXTPROP 182179 . 
+182526) (GETTEXTPROP 182528 . 182772) (PUTTEXTPROP 182774 . 183031) (GETTEXTPROPS 183033 . 183477) (
+PUTTEXTPROPS 183479 . 184383) (TEXTPROP.ADD 184385 . 184648) (\TEDIT.TEXTPROP 184650 . 191633)) (
+191636 194013 (\TEDIT.TEXTOBJ.PROPNAMES 191646 . 192905) (\TEDIT.TEXTOBJ.PROPFETCHFN 192907 . 193423) 
+(\TEDIT.TEXTOBJ.PROPSTOREFN 193425 . 194011)))))
 STOP
diff --git a/library/tedit/TEDIT-STREAM.LCOM b/library/tedit/TEDIT-STREAM.LCOM
index d9bbf246..f94131b3 100644
Binary files a/library/tedit/TEDIT-STREAM.LCOM and b/library/tedit/TEDIT-STREAM.LCOM differ
