diff --git a/library/tedit/TEDIT-FNKEYS b/library/tedit/TEDIT-FNKEYS
index d4a6abf3..107b533a 100644
--- a/library/tedit/TEDIT-FNKEYS
+++ b/library/tedit/TEDIT-FNKEYS
@@ -1,12 +1,12 @@
-(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10)
+(DEFINE-FILE-INFO :PACKAGE "INTERLISP" :READTABLE "INTERLISP" :BASE 10)
 
-(FILECREATED " 8-Feb-2026 19:54:41" {WMEDLEY}<library>tedit>TEDIT-FNKEYS.;318 109228 
+(FILECREATED "16-May-2026 22:20:12" {MEDLEY}<library>TEDIT>TEDIT-FNKEYS.;319 109301 
 
       :EDIT-BY rmk
 
-      :CHANGES-TO (VARS TEDIT.BASIC.CHARBINDINGS ORIG.TEDIT.CHARACTIONS)
+      :CHANGES-TO (FNS TEDIT.SETSYNTAX)
 
-      :PREVIOUS-DATE "24-Nov-2025 08:40:56" {WMEDLEY}<library>tedit>TEDIT-FNKEYS.;317)
+      :PREVIOUS-DATE " 8-Feb-2026 19:54:41" {MEDLEY}<library>TEDIT>TEDIT-FNKEYS.;318)
 
 
 (PRETTYCOMPRINT TEDIT-FNKEYSCOMS)
@@ -1354,7 +1354,8 @@
         'FN])
 
 (TEDIT.SETSYNTAX
-  [LAMBDA (CHAR CLASS RDTBL)                                 (* ; "Edited 12-Nov-2025 14:44 by rmk")
+  [LAMBDA (CHAR CLASS RDTBL)                                 (* ; "Edited 16-May-2026 22:19 by rmk")
+                                                             (* ; "Edited 12-Nov-2025 14:44 by rmk")
                                                              (* ; "Edited 13-Mar-2025 21:52 by rmk")
                                                              (* ; "Edited 24-Dec-2023 09:17 by rmk")
                                                              (* ; "Edited 31-Mar-87 10:00 by jds")
@@ -1374,7 +1375,7 @@
     (PROG1 (TEDIT.GETSYNTAX CHAR RDTBL)
         (\SETSYNCODE (fetch READSA of RDTBL)
                CHAR
-               (OR (CADR (ASSOC CLASS \TEDIT.TTCCODES))
+               (OR (CDR (ASSOC CLASS \TEDIT.TTCCODES))
                    (\TEDIT.TTC NONE))))])
 
 (TEDIT.GETFUNCTION
@@ -1989,30 +1990,30 @@
 (RPAQ TEDIT.WORDBOUND.READTABLE (\TEDIT.WORDBOUND.READTABLE))
 )
 (DECLARE%: DONTCOPY
-  (FILEMAP (NIL (5054 23319 (TEDIT.INSTALL.CHARBINDINGS 5064 . 7915) (TEDIT.CLEAR.CHARBINDINGS 7917 . 
-10937) (TEDIT.GET.CHARACTION 10939 . 13720) (TEDIT.GET.CHARBINDING 13722 . 15899) (
-TEDIT.GET.ALL.CHARBINDINGS 15901 . 18400) (TEDIT.CHARBINDINGS.INVERT 18402 . 19681) (
-TEDIT.GET.ALL.CHARACTIONS 19683 . 22005) (TEDIT.CONFLICTING.CHARBINDINGS 22007 . 23317)) (23379 33434 
-(\TEDIT.KEY.CHARLOOKS 23389 . 24581) (\TEDIT.KEY.QUAD 24583 . 26676) (\TEDIT.DEFAULTSSEL 26678 . 27289
-) (\TEDIT.SETDEFAULT.FROM.SEL 27291 . 27968) (\TEDIT.KEY.SIZE 27970 . 29166) (\TEDIT.SUBSCRIPTSEL 
-29168 . 29371) (\TEDIT.SUPERSCRIPTSEL 29373 . 29577) (\TEDIT.KEY.TRANSFORM 29579 . 31576) (
-\TEDIT.KEY.OPENLINE 31578 . 32032) (\TEDIT.KEY.FAMILYN 32034 . 33432)) (33435 33724 (CAP-CASECODE 
-33445 . 33722)) (33758 37190 (\TEDIT.SHOWCARETLOOKS 33768 . 36283) (\TEDIT.DESCRIBEFONT 36285 . 37188)
-) (37221 52194 (\TEDIT.ONECHAR.BACKWARD 37231 . 38378) (\TEDIT.ONECHAR.FORWARD 38380 . 39616) (
-\TEDIT.ONELINE.UP 39618 . 42579) (\TEDIT.ONELINE.DOWN 42581 . 44238) (\TEDIT.ONELINE.MOVE 44240 . 
-46527) (\TEDIT.ONEWORD.BACKWARD 46529 . 47717) (\TEDIT.ONEWORD.FORWARD 47719 . 48906) (
-\TEDIT.LINE.BEGIN 48908 . 49987) (\TEDIT.LINE.END 49989 . 51226) (\TEDIT.DOCUMENT.BEGIN 51228 . 51587)
- (\TEDIT.DOCUMENT.END 51589 . 52192)) (52195 55503 (\TEDIT.LINEDELETE.FORWARD 52205 . 53314) (
-\TEDIT.LINEDELETE.BACKWARD 53316 . 54455) (\TEDIT.LINEDELETE 54457 . 55501)) (55504 58032 (
-\TEDIT.KEY.NEST 55514 . 58030)) (58033 59315 (\TEDIT.KEY.WRAP 58043 . 59313)) (59406 67454 (
-\TEDIT.KEY.FIND 59416 . 64594) (\TEDIT.KEY.FIND.SEARCHSTRING 64596 . 65736) (\TEDIT.GET.TARGET.STRING 
-65738 . 67452)) (67485 70117 (\TEDIT.KEY.SUBSTITUTE 67495 . 67716) (\TEDIT.MANPAGE 67718 . 68965) (
-\TEDIT.CALL.ED 68967 . 69797) (\TEDIT.SELECT.ALL 69799 . 70115)) (70144 75834 (\TEDIT.CLIPBOARD 70154
- . 71909) (\TEDIT.COPYTOCLIPBOARD 71911 . 72691) (\TEDIT.EXTRACTTOCLIPBOARD 72693 . 72888) (
-\TEDIT.WRITE.SEL 72890 . 75832)) (76000 88507 (\TEDIT.READTABLE 76010 . 76946) (
-\TEDIT.WORDBOUND.READTABLE 76948 . 79996) (TEDIT.GETSYNTAX 79998 . 81227) (TEDIT.SETSYNTAX 81229 . 
-82543) (TEDIT.GETFUNCTION 82545 . 84018) (TEDIT.SETFUNCTION 84020 . 86176) (TEDIT.WORDGET 86178 . 
-86439) (TEDIT.WORDSET 86441 . 87181) (TEDIT.ATOMBOUND.READTABLE 87183 . 88505)) (88608 95596 (
-TEDIT.BUTTONS.BUILD 88618 . 93864) (TEDIT.BUTTONBITMAP.FILL 93866 . 95594)) (98061 98649 (
-\TEDIT.TTCCLASS 98071 . 98647)))))
+  (FILEMAP (NIL (5019 23284 (TEDIT.INSTALL.CHARBINDINGS 5029 . 7880) (TEDIT.CLEAR.CHARBINDINGS 7882 . 
+10902) (TEDIT.GET.CHARACTION 10904 . 13685) (TEDIT.GET.CHARBINDING 13687 . 15864) (
+TEDIT.GET.ALL.CHARBINDINGS 15866 . 18365) (TEDIT.CHARBINDINGS.INVERT 18367 . 19646) (
+TEDIT.GET.ALL.CHARACTIONS 19648 . 21970) (TEDIT.CONFLICTING.CHARBINDINGS 21972 . 23282)) (23344 33399 
+(\TEDIT.KEY.CHARLOOKS 23354 . 24546) (\TEDIT.KEY.QUAD 24548 . 26641) (\TEDIT.DEFAULTSSEL 26643 . 27254
+) (\TEDIT.SETDEFAULT.FROM.SEL 27256 . 27933) (\TEDIT.KEY.SIZE 27935 . 29131) (\TEDIT.SUBSCRIPTSEL 
+29133 . 29336) (\TEDIT.SUPERSCRIPTSEL 29338 . 29542) (\TEDIT.KEY.TRANSFORM 29544 . 31541) (
+\TEDIT.KEY.OPENLINE 31543 . 31997) (\TEDIT.KEY.FAMILYN 31999 . 33397)) (33400 33689 (CAP-CASECODE 
+33410 . 33687)) (33723 37155 (\TEDIT.SHOWCARETLOOKS 33733 . 36248) (\TEDIT.DESCRIBEFONT 36250 . 37153)
+) (37186 52159 (\TEDIT.ONECHAR.BACKWARD 37196 . 38343) (\TEDIT.ONECHAR.FORWARD 38345 . 39581) (
+\TEDIT.ONELINE.UP 39583 . 42544) (\TEDIT.ONELINE.DOWN 42546 . 44203) (\TEDIT.ONELINE.MOVE 44205 . 
+46492) (\TEDIT.ONEWORD.BACKWARD 46494 . 47682) (\TEDIT.ONEWORD.FORWARD 47684 . 48871) (
+\TEDIT.LINE.BEGIN 48873 . 49952) (\TEDIT.LINE.END 49954 . 51191) (\TEDIT.DOCUMENT.BEGIN 51193 . 51552)
+ (\TEDIT.DOCUMENT.END 51554 . 52157)) (52160 55468 (\TEDIT.LINEDELETE.FORWARD 52170 . 53279) (
+\TEDIT.LINEDELETE.BACKWARD 53281 . 54420) (\TEDIT.LINEDELETE 54422 . 55466)) (55469 57997 (
+\TEDIT.KEY.NEST 55479 . 57995)) (57998 59280 (\TEDIT.KEY.WRAP 58008 . 59278)) (59371 67419 (
+\TEDIT.KEY.FIND 59381 . 64559) (\TEDIT.KEY.FIND.SEARCHSTRING 64561 . 65701) (\TEDIT.GET.TARGET.STRING 
+65703 . 67417)) (67450 70082 (\TEDIT.KEY.SUBSTITUTE 67460 . 67681) (\TEDIT.MANPAGE 67683 . 68930) (
+\TEDIT.CALL.ED 68932 . 69762) (\TEDIT.SELECT.ALL 69764 . 70080)) (70109 75799 (\TEDIT.CLIPBOARD 70119
+ . 71874) (\TEDIT.COPYTOCLIPBOARD 71876 . 72656) (\TEDIT.EXTRACTTOCLIPBOARD 72658 . 72853) (
+\TEDIT.WRITE.SEL 72855 . 75797)) (75965 88580 (\TEDIT.READTABLE 75975 . 76911) (
+\TEDIT.WORDBOUND.READTABLE 76913 . 79961) (TEDIT.GETSYNTAX 79963 . 81192) (TEDIT.SETSYNTAX 81194 . 
+82616) (TEDIT.GETFUNCTION 82618 . 84091) (TEDIT.SETFUNCTION 84093 . 86249) (TEDIT.WORDGET 86251 . 
+86512) (TEDIT.WORDSET 86514 . 87254) (TEDIT.ATOMBOUND.READTABLE 87256 . 88578)) (88681 95669 (
+TEDIT.BUTTONS.BUILD 88691 . 93937) (TEDIT.BUTTONBITMAP.FILL 93939 . 95667)) (98134 98722 (
+\TEDIT.TTCCLASS 98144 . 98720)))))
 STOP
diff --git a/library/tedit/TEDIT-FNKEYS.LCOM b/library/tedit/TEDIT-FNKEYS.LCOM
index e2989380..257e0202 100644
Binary files a/library/tedit/TEDIT-FNKEYS.LCOM and b/library/tedit/TEDIT-FNKEYS.LCOM differ
diff --git a/library/tedit/TEDIT-WINDOW b/library/tedit/TEDIT-WINDOW
index 587c8563..0fff1bdc 100644
--- a/library/tedit/TEDIT-WINDOW
+++ b/library/tedit/TEDIT-WINDOW
@@ -1,12 +1,12 @@
 (DEFINE-FILE-INFO :PACKAGE "INTERLISP" :READTABLE "INTERLISP" :BASE 10)
 
-(FILECREATED "16-May-2026 10:11:27" {MEDLEY}<library>TEDIT>TEDIT-WINDOW.;908 236338 
+(FILECREATED "17-May-2026 11:40:35" {MEDLEY}<library>tedit>TEDIT-WINDOW.;910 237074 
 
       :EDIT-BY rmk
 
-      :CHANGES-TO (FNS \TEDIT.CLOSEPANE \TEDIT.CURSORINFN)
+      :CHANGES-TO (FNS \TEDIT.BUTTONEVENTFN)
 
-      :PREVIOUS-DATE "15-May-2026 12:53:42" {MEDLEY}<library>TEDIT>TEDIT-WINDOW.;906)
+      :PREVIOUS-DATE "16-May-2026 13:42:57" {MEDLEY}<library>tedit>TEDIT-WINDOW.;909)
 
 
 (PRETTYCOMPRINT TEDIT-WINDOWCOMS)
@@ -1178,8 +1178,7 @@
 (DEFINEQ
 
 (\TEDIT.BUTTONEVENTFN
-  [LAMBDA (PANE)                                             (* ; "Edited 15-May-2026 12:31 by rmk")
-                                                             (* ; "Edited 13-May-2026 13:26 by rmk")
+  [LAMBDA (PANE)                                             (* ; "Edited 17-May-2026 11:38 by rmk")
                                                              (* ; "Edited 15-Jan-2026 00:39 by rmk")
                                                              (* ; "Edited 11-Jan-2026 08:30 by rmk")
                                                              (* ; "Edited  6-May-2025 20:35 by rmk")
@@ -1208,155 +1207,166 @@
     (* ;; "Handle mouse buttons that are clicked in a TEdit pane.  ")
 
     (TOTOPW PANE)
-    (RESETLST                                                (* ; 
-                             "Getting TTYPROC here allows HELP in debugging.  It's the Tedit process")
-        (bind (TTYPROC _ (TTY.PROCESS))
-              (TSTREAM _ (PANETEXTSTREAM PANE))
-              (X _ (LASTMOUSEX PANE))
-              (Y _ (LASTMOUSEY PANE))
-              (DS _ (WINDOWPROP PANE 'DSP))
-              (OLDX _ MIN.SMALLP)
-              (OLDY _ MIN.SMALLP)
-              (PREG _ (PANEREGION PANE))
-              TEXTOBJ CURSEL NEWSEL CUROPERATION NEWOPERATION PENDINGDEL READONLY SECSEL REGIONTYPE
-           declare (SPECVARS CURSEL) first 
+    (CL:WHEN (MOUSESTATE (OR LEFT MIDDLE RIGHT))
+
+        (* ;; "If no button is down, we got control on button-up transition, so ignore it.")
+
+        (RESETLST                                            (* ; 
+                                                      "Getting TTYPROC here allows HELP in debugging")
+            (bind (TTYPROC _ (TTY.PROCESS))
+                  (TSTREAM _ (PANETEXTSTREAM PANE))
+                  (X _ (LASTMOUSEX PANE))
+                  (Y _ (LASTMOUSEY PANE))
+                  (DS _ (WINDOWPROP PANE 'DSP))
+                  (OLDX _ MIN.SMALLP)
+                  (OLDY _ MIN.SMALLP)
+                  (PREG _ (PANEREGION PANE))
+                  TEXTOBJ CURSEL NEWSEL CUROPERATION NEWOPERATION PENDINGDEL READONLY SECSEL
+               declare (SPECVARS CURSEL) first 
 
                                       (* ;; "Pick off and return from a bunch of peripheral situations, then fall through to the complexities of normal text selection.")
 
-                                           (CL:UNLESS TSTREAM (RETURN))
-                                           (SETQ TEXTOBJ (TEXTOBJ! (FGETTSTR TSTREAM TEXTOBJ)))
-                                           (CL:WHEN (OR (\TEDIT.BUTTONEVENTFN.INTITLE Y PANE TEXTOBJ)
-                                                        (\TEDIT.BUTTONEVENTFN.INACTIVE TEXTOBJ PANE)
-                                                        (\TEDIT.PANE.SPLIT TEXTOBJ PANE))
-                                                  (RETURN)) 
+                                               (CL:UNLESS TSTREAM (RETURN))
+                                               (SETQ TEXTOBJ (TEXTOBJ! (FGETTSTR TSTREAM TEXTOBJ)))
+                                               (CL:WHEN (FGETTOBJ TEXTOBJ EDITFINISHEDFLG)
+                                                      (RETURN))
+                                               (CL:WHEN (OR (\TEDIT.BUTTONEVENTFN.INTITLE Y PANE 
+                                                                   TEXTOBJ)
+                                                            (\TEDIT.BUTTONEVENTFN.INACTIVE TEXTOBJ 
+                                                                   PANE)
+                                                            (\TEDIT.PANE.SPLIT TEXTOBJ PANE))
+                                                      (RETURN)) 
 
-                                           (* ;; "")
+                                               (* ;; "")
 
-                                           (* ;; 
+                                               (* ;; 
               "The usual case -- a valid click in this pane.  And there's nothing else going on now.")
 
                                          (* ;; "Make sure the caret isn't being displayed, then change to the special tall one so it is easier to see during typein")
 
-                                           (\CARET.DOWN)
-                                           [RESETSAVE (\TEDIT.CARET TEXTOBJ BXHICARET)
-                                                  `(\TEDIT.CARET ,TEXTOBJ ,BXCARET] 
+                                               (\CARET.DOWN)
+                                               [RESETSAVE (\TEDIT.CARET TEXTOBJ BXHICARET)
+                                                      `(\TEDIT.CARET ,TEXTOBJ ,BXCARET] 
 
-                                           (* ;; "")
+                                               (* ;; "")
 
-                                           (SETQ READONLY (FGETTOBJ TEXTOBJ TXTREADONLY))
-                                           (SETQ NEWOPERATION (\TEDIT.BUTTONEVENTFN.GETOPERATION
-                                                               READONLY NIL)) 
+                                               (SETQ READONLY (FGETTOBJ TEXTOBJ TXTREADONLY))
+                                               (SETQ NEWOPERATION (\TEDIT.BUTTONEVENTFN.GETOPERATION
+                                                                   READONLY NIL)) 
 
-                                           (* ;; "")
+                                               (* ;; "")
 
-                                           (if (SETQ CURSEL (FGETTOBJ TEXTOBJ SECONDARYSEL))
-                                               then          (* ; 
+                                               (if (SETQ CURSEL (FGETTOBJ TEXTOBJ SECONDARYSEL))
+                                                   then      (* ; 
                                                        "Mouse moved out and came back...and clicked.")
-                                                    (SETQ CUROPERATION (FGETSEL CURSEL SELOPERATION))
-                                                             (* ; "Shift keys of secondary selection")
-                                                    (SETQ PENDINGDEL (EQ CUROPERATION 'PENDINGDEL))
-                                                    (CL:UNLESS (EQ NEWOPERATION CUROPERATION)
+                                                        (SETQ CUROPERATION (FGETSEL CURSEL 
+                                                                                  SELOPERATION))
+                                                        (SETQ PENDINGDEL (EQ CUROPERATION
+                                                                             'PENDINGDEL))
+                                                        (CL:UNLESS (EQ NEWOPERATION CUROPERATION)
                                                              (* ; 
-                                                 "If shift keys have changed, turn off old secondary")
-                                                        (\TEDIT.SECONDARYSEL.OFF TSTREAM))
-                                                    (CL:WHEN (EQ NEWOPERATION 'NORMAL)
-                                                             (* ; "Go back to normalpicik FILES?")
-                                                        (CL:UNLESS (SETQ CURSEL (
+                                                    "Shift keys have changed, turn off old secondary")
+                                                            (\TEDIT.SEL.OFF TSTREAM CURSEL))
+                                                        (CL:WHEN (EQ NEWOPERATION 'NORMAL)
+                                                             (* ; "")
+                                                            (CL:UNLESS (SETQ CURSEL (
                                                                      \TEDIT.BUTTONEVENTFN.CURSEL.INIT
-                                                                                 'NORMAL TSTREAM))
-                                                               (RETURN)))
-                                             elseif (SETQ CURSEL (\TEDIT.BUTTONEVENTFN.CURSEL.INIT
-                                                                  NEWOPERATION TSTREAM))
-                                               then (SETQ CUROPERATION (FGETSEL CURSEL SELOPERATION))
-                                             else (RETURN))
-                                           (SETQ NEWSEL (\TEDIT.COPYSEL CURSEL)) 
+                                                                                     NEWOPERATION 
+                                                                                     TSTREAM))
+                                                                   (RETURN)))
+                                                 elseif (SETQ CURSEL (
+                                                                     \TEDIT.BUTTONEVENTFN.CURSEL.INIT
+                                                                      NEWOPERATION TSTREAM))
+                                                   then (SETQ CUROPERATION 'NORMAL)
+                                                 else (RETURN))
+                                               (SETQ NEWSEL (\TEDIT.COPYSEL CURSEL)) 
                                                              (* ; 
                                                       "Gets line-chains and consistent initial looks")
-                                           (FSETTOBJ TEXTOBJ LASTARROWX NIL)
-                                           (SETQ REGIONTYPE (\TEDIT.REGIONTYPE CURSEL TEXTOBJ))
-           eachtime (BLOCK)                                  (* ; "Give other processes a chance")
-                 (GETMOUSESTATE)                             (* ; 
+                                               (FSETTOBJ TEXTOBJ LASTARROWX NIL)
+               eachtime (BLOCK)                              (* ; "Give other processes a chance")
+                     (GETMOUSESTATE)                         (* ; 
                                                              "And get the new mouse and key info")
-                 (\TEDIT.CURSORMOVEDFN PANE)
-                 (SETQ NEWOPERATION (\TEDIT.BUTTONEVENTFN.GETOPERATION READONLY CUROPERATION))
-                 (FSETTOBJ TEXTOBJ SECONDARYSEL CURSEL) 
+                     (\TEDIT.CURSORMOVEDFN PANE)
+                     (SETQ NEWOPERATION (\TEDIT.BUTTONEVENTFN.GETOPERATION READONLY CUROPERATION))
+                     (FSETTOBJ TEXTOBJ SECONDARYSEL CURSEL) 
 
-                 (* ;; "We're done if keys and buttons are up")
+                     (* ;; "We're done if keys and buttons are up")
  until (AND (EQ NEWOPERATION 'NORMAL)
             (ALLBUTTONSUP)) unless (AND (IEQP OLDX (SETQ X (LASTMOUSEX DS)))
                                         (IEQP OLDY (SETQ Y (LASTMOUSEY DS)))
                                         (EQ CUROPERATION NEWOPERATION))
-           do (CL:UNLESS (INSIDEP (PANEREGION PANE PREG)
-                                X Y)                         (* ; 
-                   "Left the window, relinquish control until a button click or cursor comes back in")
-                  (RETURN)) 
+               do (CL:UNLESS (INSIDEP (PANEREGION PANE PREG)
+                                    X Y)                     (* ; 
+                                                     "Left the window, stay in the loop if scrolling")
+                      (CL:UNLESS (IN/SCROLL/BAR? PANE LASTMOUSEX LASTMOUSEY)
+                             (RETURN))
+                      (SCROLL.HANDLER PANE)) 
 
-              (* ;; "")
+                  (* ;; "")
 
-              (* ;; "Polling loop, track the mouse until the buttons and modifier keys come up, i.e. NORMAL Nothing to do until the mouse moves or the operation changes. .")
+                  (* ;; "Polling loop, track the mouse until the buttons and modifier keys come up, i.e. NORMAL Nothing to do until the mouse moves or the operation changes. .")
 
-              (* ;; "First and always: CURSEL is ON at this point and matches the display. NEWSEL may not be well-defined.")
+                  (* ;; "First and always: CURSEL is ON at this point and matches the display. NEWSEL may not be well-defined.")
 
-              (* ;; "Ready to track the selection.")
+                  (* ;; "Ready to track the selection.")
 
-              (SETQ OLDX X)
-              (SETQ OLDY Y)
-              (CL:UNLESS (EQ NEWOPERATION CUROPERATION)      (* ; "Keys changed ")
-                  (\TEDIT.SEL.OFF TSTREAM CURSEL)            (* ; "Switch to new highlighting")
-                  (\TEDIT.SET.SEL.LOOKS CURSEL NEWOPERATION)
-                  (\TEDIT.SET.SEL.LOOKS NEWSEL NEWOPERATION)
-                  (CL:WHEN (EQ NEWOPERATION 'NORMAL)
+                  (SETQ OLDX X)
+                  (SETQ OLDY Y)
+                  (CL:UNLESS (EQ NEWOPERATION CUROPERATION)  (* ; "Keys changed ")
+                      (\TEDIT.SEL.OFF TSTREAM CURSEL)        (* ; "Switch to new highlighting")
+                      (\TEDIT.SET.SEL.LOOKS CURSEL NEWOPERATION)
+                      (\TEDIT.SET.SEL.LOOKS NEWSEL NEWOPERATION)
+                      (CL:WHEN (EQ NEWOPERATION 'NORMAL)
 
-                      (* ;; "Switching from e.g. COPY to NORMAL with button down. Since we didn't start out NORMAL, the original normal selection is still on the screen.  We take it down here, and establish the current (off) CURSEL as the new restoration selection")
+                          (* ;; "Switching from e.g. COPY to NORMAL with button down. Since we didn't start out NORMAL, the original normal selection is still on the screen.  We take it down here, and establish the current (off) CURSEL as the new restoration selection")
 
-                      (\TEDIT.SEL.OFF TSTREAM CURSEL)
-                      (\TEDIT.COPYSEL CURSEL (TEXTSEL TEXTOBJ)))
-                  (\TEDIT.SEL.ON TSTREAM CURSEL)
-                  (SETQ CUROPERATION NEWOPERATION)) 
+                          (\TEDIT.SEL.OFF TSTREAM CURSEL)
+                          (\TEDIT.COPYSEL CURSEL (TEXTSEL TEXTOBJ)))
+                      (\TEDIT.SEL.ON TSTREAM CURSEL)
+                      (SETQ CUROPERATION NEWOPERATION)) 
 
-              (* ;; "Update NEWSEL each time around. Note that \TEDIT.XYTOSEL fixes but doesn't show the selection, we do that here. MOUSEREGION is set by \TEDITCURSORMOVEDFN, below.")
+                  (* ;; "Update NEWSEL each time around. Note that \TEDIT.XYTOSEL fixes but doesn't show the selection, we do that here. MOUSEREGION is set by \TEDITCURSORMOVEDFN, below.")
 
-              (if (\TEDIT.MOUSESTATE RIGHT)
-                  then                                       (* ; 
+                  (if (\TEDIT.MOUSESTATE RIGHT)
+                      then                                   (* ; 
                                                            "Right button: NEWSEL extends last CURSEL")
-                       (\TEDIT.XYTOSEL X Y NEWSEL TSTREAM CUROPERATION PANE 'RIGHT CURSEL REGIONTYPE)
-                       (CL:WHEN (FGETSEL NEWSEL SET)
-                           (CL:WHEN (AND TEDIT.EXTEND.PENDING.DELETE (NOT PENDINGDEL)
-                                         (EQ CUROPERATION 'NORMAL)
-                                         (NOT (FGETTOBJ TEXTOBJ TXTREADONLY)))
+                           (\TEDIT.XYTOSEL X Y NEWSEL TSTREAM CUROPERATION PANE 'RIGHT CURSEL)
+                           (CL:WHEN (FGETSEL NEWSEL SET)
+                               (CL:WHEN (AND TEDIT.EXTEND.PENDING.DELETE (NOT PENDINGDEL)
+                                             (EQ CUROPERATION 'NORMAL)
+                                             (NOT (FGETTOBJ TEXTOBJ TXTREADONLY)))
 
-                               (* ;; "Switch to simulation of Laurel bluependingdelete: Black, deletes on type-in. Coerce CURSEL and display for pending looks.  Otherwise, CURSEL is already BPD and stays on to avoid flicker in extending")
+                                 (* ;; "Switch to simulation of Laurel bluependingdelete: Black, deletes on type-in. Coerce CURSEL and display for pending looks.  Otherwise, CURSEL is already BPD and stays on to avoid flicker in extending")
 
-                               (\TEDIT.SEL.OFF TSTREAM CURSEL)
+                                   (\TEDIT.SEL.OFF TSTREAM CURSEL)
                                                              (* ; 
                                                              "Take down old looks, change, re-show")
-                               (\TEDIT.SET.SEL.LOOKS CURSEL 'PENDINGDEL)
-                               (\TEDIT.SET.SEL.LOOKS NEWSEL 'PENDINGDEL)
-                               (\TEDIT.SEL.ON TSTREAM CURSEL)
-                               (SETQ PENDINGDEL T))
-                           [\TEDIT.EXTEND.SEL NEWSEL CURSEL TSTREAM (MEMB CUROPERATION
-                                                                          '(COPY COPYLOOKS]) 
+                                   (\TEDIT.SET.SEL.LOOKS CURSEL 'PENDINGDEL)
+                                   (\TEDIT.SET.SEL.LOOKS NEWSEL 'PENDINGDEL)
+                                   (\TEDIT.SEL.ON TSTREAM CURSEL)
+                                   (SETQ PENDINGDEL T))
+                               [\TEDIT.EXTEND.SEL NEWSEL CURSEL TSTREAM (MEMB CUROPERATION
+                                                                              '(COPY COPYLOOKS]) 
                                                              (* ; "No valid selection, go to cleanup")
-                else (if (\TEDIT.MOUSESTATE LEFT)
-                         then                                (* ; "Left selects char/point. ")
-                              (\TEDIT.XYTOSEL X Y NEWSEL TSTREAM CUROPERATION PANE 'LEFT CURSEL 
-                                     REGIONTYPE)
-                       elseif (\TEDIT.MOUSESTATE MIDDLE)
-                         then                                (* ; "Middle selects word/line")
-                              (\TEDIT.XYTOSEL X Y NEWSEL TSTREAM CUROPERATION PANE 'MIDDLE CURSEL 
-                                     REGIONTYPE))
-                     (CL:WHEN (AND (FGETSEL NEWSEL SET)
-                                   (\TEDIT.SEL.CHANGED? NEWSEL CURSEL)
-                                   (OR (NOT (ALLBUTTONSUP))
-                                       (FGETSEL NEWSEL SELOBJ)))
+                    else (if (\TEDIT.MOUSESTATE LEFT)
+                             then                            (* ; "Left selects char/point. ")
+                                  (\TEDIT.XYTOSEL X Y NEWSEL TSTREAM CUROPERATION PANE 'LEFT CURSEL)
+                           elseif (\TEDIT.MOUSESTATE MIDDLE)
+                             then                            (* ; "Middle selects word/line")
+                                  (\TEDIT.XYTOSEL X Y NEWSEL TSTREAM CUROPERATION PANE 'MIDDLE CURSEL
+                                         ))
+                         (CL:WHEN (AND (FGETSEL NEWSEL SET)
+                                       (\TEDIT.SEL.CHANGED? NEWSEL CURSEL)
+                                       (OR (NOT (ALLBUTTONSUP))
+                                           (FGETSEL NEWSEL SELOBJ)))
 
-                         (* ;; "Selection has changed while at least one button is down. Take down current CURSEL highlighting, switch to NEWSEL.  If the mouse condition is removed, the secondary selection can be lost if the mouse moves while the operation keys are still down.  But if the copy isn't done when NEWSEL picks out an object, the object will be lost. ")
+                             (* ;; "Selection has changed while at least one button is down. Take down current CURSEL highlighting, switch to NEWSEL.  If the mouse condition is removed, the secondary selection can be lost if the mouse moves while the operation keys are still down.  But if the copy isn't done when NEWSEL picks out an object, the object will be lost. ")
 
-                         (\TEDIT.SEL.OFF TSTREAM CURSEL)
-                         (\TEDIT.COPYSEL NEWSEL CURSEL)
-                         (\TEDIT.SEL.ON TSTREAM CURSEL))) 
+                             (\TEDIT.SEL.OFF TSTREAM CURSEL)
+                             (\TEDIT.COPYSEL NEWSEL CURSEL)
+                             (\TEDIT.SEL.ON TSTREAM CURSEL))) 
 
-              (* ;; "CURSEL now matches the display and CUROPERATION.")
+                  (* ;; "CURSEL now matches the display and CUROPERATION.")
  finally 
 
        (* ;; "Out of Polling loop")
@@ -1373,7 +1383,7 @@
                   'NORMAL)                                   (* ; "Restore TEXTSEL")
            (\TEDIT.SEL.ON TSTREAM)
            (RETURN))
-       (\TEDIT.BUTTONEVENTFN.DOOPERATION CURSEL CUROPERATION TSTREAM PANE PENDINGDEL TTYPROC)))])
+       (\TEDIT.BUTTONEVENTFN.DOOPERATION CURSEL CUROPERATION TSTREAM PANE PENDINGDEL TTYPROC))))])
 
 (\TEDIT.BUTTONEVENTFN.DOOPERATION
   [LAMBDA (CURSEL CUROPERATION TSTREAM PANE PENDINGDEL TTYPROC)
@@ -2565,7 +2575,7 @@
                else (WINDOWPROP PRIMARYPANE 'SAVED-TYPED-REGION WHOLEREGION)))])
 
 (\TEDIT.CLOSEPANE
-  [LAMBDA (PANE DONTCLOSEW)                                  (* ; "Edited 16-May-2026 10:11 by rmk")
+  [LAMBDA (PANE DONTCLOSEW)                                  (* ; "Edited 16-May-2026 13:42 by rmk")
                                                              (* ; "Edited  9-May-2025 00:22 by rmk")
                                                              (* ; "Edited  6-May-2025 16:04 by rmk")
 
@@ -2574,14 +2584,12 @@
     (LET* ((TEXTOBJ (TEXTOBJ PANE))
            (PANEWINDOW (PANEWINDOW PANE))
            (SEL (TEXTSEL TEXTOBJ)))
-          (\TEDIT.SETCARET SEL PANE TEXTOBJ 'OFF)
-          (WINDOWPROP PANEWINDOW 'PROCESS.EXITFN NIL)
-          (WINDOWPROP PANEWINDOW 'PROCESS.IDLEFN NIL)        (* ; "Restore any disarmed interrupts.")
+          (\TEDIT.SETCARET SEL PANE TEXTOBJ 'OFF)            (* ; "Restore any disarmed interrupts.")
           (DETACHWINDOW PANEWINDOW)
           (\TEDIT.UNLINKPANE PANE)
-          (for PROP in '(CURSOROUTFN CURSORINFN CURSORMOVEDFN BUTTONEVENTFN RIGHTBUTTONFN SCROLLFN 
-                               AFTERMOVEFN REPAINTFN WINDOWENTRYFN NEWREGIONFN)
-             do (WINDOWPROP PANEWINDOW PROP NIL))
+          (for PROP in '(PROCESS.EXITFN PROCESS.IDLEFN CURSOROUTFN CURSORINFN CURSORMOVEDFN 
+                               BUTTONEVENTFN RIGHTBUTTONFN SCROLLFN AFTERMOVEFN REPAINTFN 
+                               WINDOWENTRYFN NEWREGIONFN) do (WINDOWPROP PANEWINDOW PROP NIL))
           (for PROP in '(CLOSEFN RESHAPEFN) do (WINDOWDELPROP PANEWINDOW 'CLOSEFN
                                                       (FUNCTION TEDIT.DEACTIVATE.WINDOW))
                                                (WINDOWDELPROP PANEWINDOW 'RESHAPEFN
@@ -3715,36 +3723,36 @@
 (RPAQ? TEDIT.TITLED.ICON.TEMPLATE (create TITLEDICON ICON _ TEDITICON MASK _ TEDITMASK TITLEREG _ 
                                          TEDIT.ICON.TITLE.REGION))
 (DECLARE%: DONTCOPY
-  (FILEMAP (NIL (17144 18040 (TEDIT.DEFER.UPDATES 17154 . 18038)) (18041 46572 (\TEDIT.WINDOW.CREATE 
-18051 . 24914) (\TEDIT.WINDOW.GETREGION 24916 . 30509) (\TEDIT.WINDOW.SETUP 30511 . 35018) (
-\TEDIT.MINIMAL.WINDOW.SETUP 35020 . 43204) (\TEDIT.CLEARPANE 43206 . 43923) (\TEDIT.FILL.PANES 43925
- . 46570)) (46573 71761 (\TEDIT.CURSORMOVEDFN 46583 . 52110) (\TEDIT.CURSOROUTFN 52112 . 52909) (
-\TEDIT.CURSORINFN 52911 . 54370) (\TEDIT.ACTIVE.WINDOWP 54372 . 55442) (\TEDIT.EXPANDFN 55444 . 56007)
- (\TEDIT.MAINW 56009 . 57289) (\TEDIT.MAINSTREAM 57291 . 57625) (\TEDIT.PRIMARYPANE 57627 . 58397) (
-\TEDIT.PANELIST 58399 . 58895) (\TEDIT.NEWREGIONFN 58897 . 61413) (\TEDIT.SET.WINDOW.EXTENT 61415 . 
-66397) (\TEDIT.SHRINK.ICONCREATE 66399 . 69132) (\TEDIT.SHRINKFN 69134 . 69543) (\TEDIT.PANEREGION 
-69545 . 71759)) (71793 106377 (\TEDIT.BUTTONEVENTFN 71803 . 85969) (\TEDIT.BUTTONEVENTFN.DOOPERATION 
-85971 . 93442) (\TEDIT.BUTTONEVENTFN.GETOPERATION 93444 . 95286) (\TEDIT.BUTTONEVENTFN.CURSEL.INIT 
-95288 . 98958) (\TEDIT.BUTTONEVENTFN.INACTIVE 98960 . 101390) (\TEDIT.BUTTONEVENTFN.INTITLE 101392 . 
-103227) (\TEDIT.COPYINSERTFN 103229 . 104361) (\TEDIT.FOREIGN.COPY 104363 . 106375)) (106378 123941 (
-\TEDIT.PANE.SPLIT 106388 . 110336) (\TEDIT.SPLITW 110338 . 118397) (\TEDIT.UNSPLITW 118399 . 122598) (
-\TEDIT.LINKPANES 122600 . 123363) (\TEDIT.UNLINKPANE 123365 . 123939)) (125375 126266 (TEDITWINDOWP 
-125385 . 126264)) (126303 129406 (TEDIT.GETINPUT 126313 . 128756) (\TEDIT.MAKEFILENAME 128758 . 129404
-)) (129455 137538 (TEDIT.PROMPTWINDOW 129465 . 129779) (TEDIT.PROMPTPRINT 129781 . 132748) (
-TEDIT.PROMPTCLEAR 132750 . 134585) (TEDIT.PROMPTFLASH 134587 . 135845) (\TEDIT.PROMPT.PAGEFULLFN 
-135847 . 137536)) (137776 148354 (\TEDIT.FILENAME 137786 . 138558) (\TEDIT.DEFAULT.TITLE 138560 . 
-140939) (\TEDIT.WINDOW.TITLE 140941 . 143110) (\TEDIT.LIKELY.FILENAME 143112 . 145836) (
-\TEDIT.UPDATE.TITLE 145838 . 148352)) (148397 161244 (TEDIT.DEACTIVATE.WINDOW 148407 . 154223) (
-\TEDIT.RESHAPEFN 154225 . 156310) (\TEDIT.REPAINTFN 156312 . 156536) (\TEDIT.CLOSESPLITS 156538 . 
-158983) (\TEDIT.CLOSEPANE 158985 . 161242)) (161245 204044 (\TEDIT.SCROLLFN 161255 . 163486) (
-\TEDIT.SCROLLCH.TOP 163488 . 165599) (\TEDIT.SCROLLCH.BOTTOM 165601 . 169931) (\TEDIT.SCROLLUP 169933
- . 175659) (\TEDIT.TOPLINE.YTOP 175661 . 177330) (\TEDIT.SCROLLDOWN 177332 . 184371) (
-\TEDIT.SCROLL.CARET 184373 . 187211) (\TEDIT.VISIBLECARETP 187213 . 189507) (\TEDIT.VISIBLECHARP 
-189509 . 190600) (\TEDIT.BITMAPLINES 190602 . 194522) (\TEDIT.SETPANE.TOPLINE 194524 . 195136) (
-\TEDIT.SHIFTLINES 195138 . 204042)) (204045 214914 (\TEDIT.ONSCREEN? 204055 . 208606) (
-\TEDIT.ONSCREEN.REGION 208608 . 212259) (\TEDIT.AFTERMOVEFN 212261 . 213158) (OFFSCREENP 213160 . 
-214912)) (214956 217770 (\TEDIT.PROCIDLEFN 214966 . 216626) (\TEDIT.PROCENTRYFN 216628 . 217073) (
-\TEDIT.PROCEXITFN 217075 . 217768)) (217849 231074 (\TEDIT.DOWNCARET 217859 . 218652) (
-\TEDIT.FLASHCARET 218654 . 220765) (\TEDIT.UPCARET 220767 . 221871) (TEDIT.NORMALIZECARET 221873 . 
-225091) (\TEDIT.SETCARET 225093 . 230444) (\TEDIT.CARET 230446 . 231072)))))
+  (FILEMAP (NIL (17130 18026 (TEDIT.DEFER.UPDATES 17140 . 18024)) (18027 46558 (\TEDIT.WINDOW.CREATE 
+18037 . 24900) (\TEDIT.WINDOW.GETREGION 24902 . 30495) (\TEDIT.WINDOW.SETUP 30497 . 35004) (
+\TEDIT.MINIMAL.WINDOW.SETUP 35006 . 43190) (\TEDIT.CLEARPANE 43192 . 43909) (\TEDIT.FILL.PANES 43911
+ . 46556)) (46559 71747 (\TEDIT.CURSORMOVEDFN 46569 . 52096) (\TEDIT.CURSOROUTFN 52098 . 52895) (
+\TEDIT.CURSORINFN 52897 . 54356) (\TEDIT.ACTIVE.WINDOWP 54358 . 55428) (\TEDIT.EXPANDFN 55430 . 55993)
+ (\TEDIT.MAINW 55995 . 57275) (\TEDIT.MAINSTREAM 57277 . 57611) (\TEDIT.PRIMARYPANE 57613 . 58383) (
+\TEDIT.PANELIST 58385 . 58881) (\TEDIT.NEWREGIONFN 58883 . 61399) (\TEDIT.SET.WINDOW.EXTENT 61401 . 
+66383) (\TEDIT.SHRINK.ICONCREATE 66385 . 69118) (\TEDIT.SHRINKFN 69120 . 69529) (\TEDIT.PANEREGION 
+69531 . 71745)) (71779 107168 (\TEDIT.BUTTONEVENTFN 71789 . 86760) (\TEDIT.BUTTONEVENTFN.DOOPERATION 
+86762 . 94233) (\TEDIT.BUTTONEVENTFN.GETOPERATION 94235 . 96077) (\TEDIT.BUTTONEVENTFN.CURSEL.INIT 
+96079 . 99749) (\TEDIT.BUTTONEVENTFN.INACTIVE 99751 . 102181) (\TEDIT.BUTTONEVENTFN.INTITLE 102183 . 
+104018) (\TEDIT.COPYINSERTFN 104020 . 105152) (\TEDIT.FOREIGN.COPY 105154 . 107166)) (107169 124732 (
+\TEDIT.PANE.SPLIT 107179 . 111127) (\TEDIT.SPLITW 111129 . 119188) (\TEDIT.UNSPLITW 119190 . 123389) (
+\TEDIT.LINKPANES 123391 . 124154) (\TEDIT.UNLINKPANE 124156 . 124730)) (126166 127057 (TEDITWINDOWP 
+126176 . 127055)) (127094 130197 (TEDIT.GETINPUT 127104 . 129547) (\TEDIT.MAKEFILENAME 129549 . 130195
+)) (130246 138329 (TEDIT.PROMPTWINDOW 130256 . 130570) (TEDIT.PROMPTPRINT 130572 . 133539) (
+TEDIT.PROMPTCLEAR 133541 . 135376) (TEDIT.PROMPTFLASH 135378 . 136636) (\TEDIT.PROMPT.PAGEFULLFN 
+136638 . 138327)) (138567 149145 (\TEDIT.FILENAME 138577 . 139349) (\TEDIT.DEFAULT.TITLE 139351 . 
+141730) (\TEDIT.WINDOW.TITLE 141732 . 143901) (\TEDIT.LIKELY.FILENAME 143903 . 146627) (
+\TEDIT.UPDATE.TITLE 146629 . 149143)) (149188 161980 (TEDIT.DEACTIVATE.WINDOW 149198 . 155014) (
+\TEDIT.RESHAPEFN 155016 . 157101) (\TEDIT.REPAINTFN 157103 . 157327) (\TEDIT.CLOSESPLITS 157329 . 
+159774) (\TEDIT.CLOSEPANE 159776 . 161978)) (161981 204780 (\TEDIT.SCROLLFN 161991 . 164222) (
+\TEDIT.SCROLLCH.TOP 164224 . 166335) (\TEDIT.SCROLLCH.BOTTOM 166337 . 170667) (\TEDIT.SCROLLUP 170669
+ . 176395) (\TEDIT.TOPLINE.YTOP 176397 . 178066) (\TEDIT.SCROLLDOWN 178068 . 185107) (
+\TEDIT.SCROLL.CARET 185109 . 187947) (\TEDIT.VISIBLECARETP 187949 . 190243) (\TEDIT.VISIBLECHARP 
+190245 . 191336) (\TEDIT.BITMAPLINES 191338 . 195258) (\TEDIT.SETPANE.TOPLINE 195260 . 195872) (
+\TEDIT.SHIFTLINES 195874 . 204778)) (204781 215650 (\TEDIT.ONSCREEN? 204791 . 209342) (
+\TEDIT.ONSCREEN.REGION 209344 . 212995) (\TEDIT.AFTERMOVEFN 212997 . 213894) (OFFSCREENP 213896 . 
+215648)) (215692 218506 (\TEDIT.PROCIDLEFN 215702 . 217362) (\TEDIT.PROCENTRYFN 217364 . 217809) (
+\TEDIT.PROCEXITFN 217811 . 218504)) (218585 231810 (\TEDIT.DOWNCARET 218595 . 219388) (
+\TEDIT.FLASHCARET 219390 . 221501) (\TEDIT.UPCARET 221503 . 222607) (TEDIT.NORMALIZECARET 222609 . 
+225827) (\TEDIT.SETCARET 225829 . 231180) (\TEDIT.CARET 231182 . 231808)))))
 STOP
diff --git a/library/tedit/TEDIT-WINDOW.LCOM b/library/tedit/TEDIT-WINDOW.LCOM
index 52afa373..bebc2491 100644
Binary files a/library/tedit/TEDIT-WINDOW.LCOM and b/library/tedit/TEDIT-WINDOW.LCOM differ
