diff --git a/lispusers/MACINTERFACE.LCOM.~46~ b/lispusers/MACINTERFACE.LCOM.~46~
deleted file mode 100644
index e1341dda..00000000
Binary files a/lispusers/MACINTERFACE.LCOM.~46~ and /dev/null differ
diff --git a/lispusers/MACINTERFACE.~28~ b/lispusers/MACINTERFACE.~28~
deleted file mode 100644
index 2440b53d..00000000
--- a/lispusers/MACINTERFACE.~28~
+++ /dev/null
@@ -1 +0,0 @@
-(DEFINE-FILE-INFO READTABLE "INTERLISP" PACKAGE "INTERLISP")
(FILECREATED "18-May-2020 20:12:57" 
{DSK}<Users>kaplan>Local>medley3.5>lispcore>lispusers>MACINTERFACE.;28 8463   

      changes to%:  (FNS MACWINDOW)

      previous date%: "18-May-2020 17:27:13" 
{DSK}<Users>kaplan>Local>medley3.5>lispcore>lispusers>MACINTERFACE.;27)


(PRETTYCOMPRINT MACINTERFACECOMS)

(RPAQQ MACINTERFACECOMS
       [(FNS INTITLEBAR INCORNER MACWINDOW.BUTTONEVENTFN MACWINDOW)
        (FNS MACINT\TEDIT.BUTTONEVENTFN MACINT\SEDIT-BUTTONEVENTFN MACINT-ADD-EXEC 
             MACINT-DEBUGGER-BUTTON-EVENT MACINT-\ITEM.WINDOW.BUTTON.HANDLER MACINT-SNAPW)
        (INITVARS (MACINTERFACECORNERMARGIN 25))
        (P (MOVD? '\TEDIT.BUTTONEVENTFN 'MACORIG\TEDIT.BUTTONEVENTFN)
           (MOVD 'MACINT\TEDIT.BUTTONEVENTFN '\TEDIT.BUTTONEVENTFN))
        (P (MOVD? 'SEDIT::BUTTONEVENTFN 'MACORIG\SEDIT-BUTTONEVENTFN)
           (MOVD 'MACINT\SEDIT-BUTTONEVENTFN 'SEDIT::BUTTONEVENTFN))
        (P (MOVD? 'ADD-EXEC 'MACORIG-ADD-EXEC)
           (MOVD 'MACINT-ADD-EXEC 'ADD-EXEC))
        (P (MOVD? 'DBG::DEBUGGER-BUTTON-EVENT 'MACORIG-DEBUGGER-BUTTON-EVENT)
           (MOVD 'MACINT-DEBUGGER-BUTTON-EVENT 'DBG::DEBUGGER-BUTTON-EVENT))
        (P (MOVD? '\ITEM.WINDOW.BUTTON.HANDLER 'MACORIG-\ITEM.WINDOW.BUTTON.HANDLER)
           (MOVD 'MACINT-\ITEM.WINDOW.BUTTON.HANDLER '\ITEM.WINDOW.BUTTON.HANDLER))
        (P (MOVD? 'SNAPW 'MACORIG-SNAPW)
           (MOVD 'MACINT-SNAPW 'SNAPW))
        (DECLARE%: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY COMPILERVARS (ADDVARS (NLAMA)
                                                                             (NLAML)
                                                                             (LAMA MACINT-ADD-EXEC])
(DEFINEQ

(INTITLEBAR
  [LAMBDA (WINDOW)                                      (* ; "Edited  3-May-2020 20:38 by rmk:")
    (IGREATERP (LASTMOUSEY WINDOW)
           (FETCH TOP OF (DSPCLIPPINGREGION NIL WINDOW])

(INCORNER
  [LAMBDA (WINDOW MARGIN)                               (* ; "Edited 13-May-2020 14:26 by rmk:")
                                                            (* ; "Edited 10-May-2020 12:41 by rmk:")
                                                            (* ; "Edited  3-May-2020 20:43 by rmk:")
    (CL:UNLESS MARGIN (SETQ MARGIN MACINTERFACECORNERMARGIN))
    (LET ((CR (DSPCLIPPINGREGION NIL WINDOW))
          (X (LASTMOUSEX WINDOW))
          (Y (LASTMOUSEY WINDOW)))
         (IF (ILEQ (IABS (IDIFFERENCE X (FETCH LEFT OF CR)))
                       MARGIN)
             THEN 

                   (* ;; "GREATERP puts it in title bar")

                   (IF (IGREATERP Y (FETCH TOP OF CR))
                       THEN 'LEFTTOP
                     ELSEIF (ILEQ (IABS (IDIFFERENCE Y (FETCH BOTTOM OF CR)))
                                      MARGIN)
                       THEN 'LEFTBOTTOM)
           ELSEIF (ILEQ (IABS (IDIFFERENCE X (FETCH RIGHT OF CR)))
                            MARGIN)
             THEN (IF (IGREATERP Y (FETCH TOP OF CR))
                          THEN 'RIGHTTOP
                        ELSEIF (ILEQ (IABS (IDIFFERENCE Y (FETCH BOTTOM OF CR)))
                                         MARGIN)
                          THEN 'RIGHTBOTTOM])

(MACWINDOW.BUTTONEVENTFN
  [LAMBDA (WINDOW)                                      (* ; "Edited 10-May-2020 03:35 by rmk:")
                                                            (* ; "Edited  3-May-2020 21:18 by rmk:")
    (CL:WHEN (MOUSESTATE (ONLY LEFT))
        (TOTOPW WINDOW)
        (LET (REGION (CORNER (INCORNER WINDOW)))
             (IF CORNER
                 THEN 

                       (* ;; 
                     "The upper corners may be in the title bar, near the side, so test this first")

                       (SETQ REGION (WINDOWPROP WINDOW 'REGION))
                       [LET ((LEFT (FETCH LEFT OF REGION))
                             (RIGHT (FETCH RIGHT OF REGION))
                             (TOP (FETCH TOP OF REGION))
                             (BOTTOM (FETCH BOTTOM OF REGION)))
                            (SHAPEW WINDOW (GETREGION NIL NIL NIL NIL NIL
                                                  (SELECTQ CORNER
                                                      (RIGHTBOTTOM (LIST LEFT TOP RIGHT BOTTOM))
                                                      (LEFTBOTTOM (LIST RIGHT TOP LEFT BOTTOM))
                                                      (RIGHTTOP (LIST LEFT BOTTOM RIGHT TOP))
                                                      (LEFTTOP (LIST RIGHT BOTTOM LEFT TOP))
                                                      (SHOULDNT]
                       T
               ELSEIF (INTITLEBAR WINDOW)
                 THEN (MOVEW WINDOW)
                       T)))])

(MACWINDOW
  [LAMBDA (WINDOW)                                      (* ; "Edited 18-May-2020 20:11 by rmk:")
                                                            (* ; "Edited 10-May-2020 14:20 by rmk:")

    (* ;; "This can be applied to windows that have been created with an unknown or unmodifiable buttoneventfn.")
                                                        (* ; "Edited  3-May-2020 21:17 by rmk:")
    (CL:UNLESS (WINDOWPROP WINDOW 'PREMACBUTTONEVENTFN)
        (WINDOWPROP WINDOW 'PREMACBUTTONEVENTFN (WINDOWPROP WINDOW 'BUTTONEVENTFN))
        (WINDOWPROP WINDOW 'BUTTONEVENTFN (FUNCTION MACWINDOW.BUTTONEVENTFN)))
    WINDOW])
)
(DEFINEQ

(MACINT\TEDIT.BUTTONEVENTFN
  [LAMBDA (WINDOW)                                      (* ; "Edited 10-May-2020 03:31 by rmk:")
    (CL:WHEN (LISTP WINDOW)
        (SETQ WINDOW (CAR WINDOW)))
    (OR (MACWINDOW.BUTTONEVENTFN WINDOW)
        (MACORIG\TEDIT.BUTTONEVENTFN WINDOW])

(MACINT\SEDIT-BUTTONEVENTFN
  [LAMBDA (WINDOW)                                      (* ; "Edited 10-May-2020 03:31 by rmk:")
    (OR (MACWINDOW.BUTTONEVENTFN WINDOW)
        (MACORIG\SEDIT-BUTTONEVENTFN WINDOW])

(MACINT-ADD-EXEC
  [LAMBDA U                                             (* ; "Edited 10-May-2020 03:31 by rmk:")
    (LET [(PROC (APPLY (FUNCTION MACORIG-ADD-EXEC)
                       (FOR N FROM 1 TO U COLLECT (ARG U N]

         (* ;; "For some reason, the window may not be there immediately")

         (DISMISS 100)
         (MACWINDOW (PROCESSPROP PROC 'WINDOW))
         PROC])

(MACINT-DEBUGGER-BUTTON-EVENT
  [LAMBDA (WINDOW)                                      (* ; "Edited 10-May-2020 03:31 by rmk:")
    (OR (MACWINDOW.BUTTONEVENTFN WINDOW)
        (MACORIG-DEBUGGER-BUTTON-EVENT WINDOW])

(MACINT-\ITEM.WINDOW.BUTTON.HANDLER
  [LAMBDA (WINDOW)                                      (* ; "Edited 16-May-2020 22:35 by rmk:")
                                                            (* ; "Edited 10-May-2020 03:31 by rmk:")
    (OR (MACWINDOW.BUTTONEVENTFN WINDOW)
        (MACORIG-\ITEM.WINDOW.BUTTON.HANDLER WINDOW])

(MACINT-SNAPW
  [LAMBDA NIL                                           (* ; "Edited 18-May-2020 17:20 by rmk:")
    (LET ((W (MACORIG-SNAPW)))
         [WINDOWPROP W 'BUTTONEVENTFN (FUNCTION (LAMBDA (W)
                                                  (TOTOPW W)
                                                  (MOVEW W]
         W])
)

(RPAQ? MACINTERFACECORNERMARGIN 25)

(MOVD? '\TEDIT.BUTTONEVENTFN 'MACORIG\TEDIT.BUTTONEVENTFN)

(MOVD 'MACINT\TEDIT.BUTTONEVENTFN '\TEDIT.BUTTONEVENTFN)

(MOVD? 'SEDIT::BUTTONEVENTFN 'MACORIG\SEDIT-BUTTONEVENTFN)

(MOVD 'MACINT\SEDIT-BUTTONEVENTFN 'SEDIT::BUTTONEVENTFN)

(MOVD? 'ADD-EXEC 'MACORIG-ADD-EXEC)

(MOVD 'MACINT-ADD-EXEC 'ADD-EXEC)

(MOVD? 'DBG::DEBUGGER-BUTTON-EVENT 'MACORIG-DEBUGGER-BUTTON-EVENT)

(MOVD 'MACINT-DEBUGGER-BUTTON-EVENT 'DBG::DEBUGGER-BUTTON-EVENT)

(MOVD? '\ITEM.WINDOW.BUTTON.HANDLER 'MACORIG-\ITEM.WINDOW.BUTTON.HANDLER)

(MOVD 'MACINT-\ITEM.WINDOW.BUTTON.HANDLER '\ITEM.WINDOW.BUTTON.HANDLER)

(MOVD? 'SNAPW 'MACORIG-SNAPW)

(MOVD 'MACINT-SNAPW 'SNAPW)
(DECLARE%: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY COMPILERVARS 

(ADDTOVAR NLAMA )

(ADDTOVAR NLAML )

(ADDTOVAR LAMA MACINT-ADD-EXEC)
)
(DECLARE%: DONTCOPY
  (FILEMAP (NIL (1747 5706 (INTITLEBAR 1757 . 1977) (INCORNER 1979 . 3394) (MACWINDOW.BUTTONEVENTFN 3396
 . 5018) (MACWINDOW 5020 . 5704)) (5707 7601 (MACINT\TEDIT.BUTTONEVENTFN 5717 . 6008) (
MACINT\SEDIT-BUTTONEVENTFN 6010 . 6237) (MACINT-ADD-EXEC 6239 . 6663) (MACINT-DEBUGGER-BUTTON-EVENT 
6665 . 6896) (MACINT-\ITEM.WINDOW.BUTTON.HANDLER 6898 . 7250) (MACINT-SNAPW 7252 . 7599)))))
STOP
\ No newline at end of file
diff --git a/lispusers/MACINTERFACE.~30~ b/lispusers/MACINTERFACE.~30~
deleted file mode 100644
index 8e3318e0..00000000
--- a/lispusers/MACINTERFACE.~30~
+++ /dev/null
@@ -1 +0,0 @@
-(DEFINE-FILE-INFO READTABLE "INTERLISP" PACKAGE "INTERLISP")
(FILECREATED "23-May-2020 08:54:49" 
{DSK}<Users>kaplan>Local>medley3.5>lispcore>lispusers>MACINTERFACE.;30 9079   

      changes to%:  (FNS MACWINDOW.BUTTONEVENTFN MACWINDOW)

      previous date%: "18-May-2020 17:27:13" 
{DSK}<Users>kaplan>Local>medley3.5>lispcore>lispusers>MACINTERFACE.;27)


(PRETTYCOMPRINT MACINTERFACECOMS)

(RPAQQ MACINTERFACECOMS
       [(FNS INTITLEBAR INCORNER MACWINDOW.BUTTONEVENTFN MACWINDOW)
        (FNS MACINT\TEDIT.BUTTONEVENTFN MACINT\SEDIT-BUTTONEVENTFN MACINT-ADD-EXEC 
             MACINT-DEBUGGER-BUTTON-EVENT MACINT-\ITEM.WINDOW.BUTTON.HANDLER MACINT-SNAPW)
        (INITVARS (MACINTERFACECORNERMARGIN 25))
        (P (MOVD? '\TEDIT.BUTTONEVENTFN 'MACORIG\TEDIT.BUTTONEVENTFN)
           (MOVD 'MACINT\TEDIT.BUTTONEVENTFN '\TEDIT.BUTTONEVENTFN))
        (P (MOVD? 'SEDIT::BUTTONEVENTFN 'MACORIG\SEDIT-BUTTONEVENTFN)
           (MOVD 'MACINT\SEDIT-BUTTONEVENTFN 'SEDIT::BUTTONEVENTFN))
        (P (MOVD? 'ADD-EXEC 'MACORIG-ADD-EXEC)
           (MOVD 'MACINT-ADD-EXEC 'ADD-EXEC))
        (P (MOVD? 'DBG::DEBUGGER-BUTTON-EVENT 'MACORIG-DEBUGGER-BUTTON-EVENT)
           (MOVD 'MACINT-DEBUGGER-BUTTON-EVENT 'DBG::DEBUGGER-BUTTON-EVENT))
        (P (MOVD? '\ITEM.WINDOW.BUTTON.HANDLER 'MACORIG-\ITEM.WINDOW.BUTTON.HANDLER)
           (MOVD 'MACINT-\ITEM.WINDOW.BUTTON.HANDLER '\ITEM.WINDOW.BUTTON.HANDLER))
        (P (MOVD? 'SNAPW 'MACORIG-SNAPW)
           (MOVD 'MACINT-SNAPW 'SNAPW))
        (DECLARE%: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY COMPILERVARS (ADDVARS (NLAMA)
                                                                             (NLAML)
                                                                             (LAMA MACINT-ADD-EXEC])
(DEFINEQ

(INTITLEBAR
  [LAMBDA (WINDOW)                                      (* ; "Edited  3-May-2020 20:38 by rmk:")
    (IGREATERP (LASTMOUSEY WINDOW)
           (FETCH TOP OF (DSPCLIPPINGREGION NIL WINDOW])

(INCORNER
  [LAMBDA (WINDOW MARGIN)                               (* ; "Edited 13-May-2020 14:26 by rmk:")
                                                            (* ; "Edited 10-May-2020 12:41 by rmk:")
                                                            (* ; "Edited  3-May-2020 20:43 by rmk:")
    (CL:UNLESS MARGIN (SETQ MARGIN MACINTERFACECORNERMARGIN))
    (LET ((CR (DSPCLIPPINGREGION NIL WINDOW))
          (X (LASTMOUSEX WINDOW))
          (Y (LASTMOUSEY WINDOW)))
         (IF (ILEQ (IABS (IDIFFERENCE X (FETCH LEFT OF CR)))
                       MARGIN)
             THEN 

                   (* ;; "GREATERP puts it in title bar")

                   (IF (IGREATERP Y (FETCH TOP OF CR))
                       THEN 'LEFTTOP
                     ELSEIF (ILEQ (IABS (IDIFFERENCE Y (FETCH BOTTOM OF CR)))
                                      MARGIN)
                       THEN 'LEFTBOTTOM)
           ELSEIF (ILEQ (IABS (IDIFFERENCE X (FETCH RIGHT OF CR)))
                            MARGIN)
             THEN (IF (IGREATERP Y (FETCH TOP OF CR))
                          THEN 'RIGHTTOP
                        ELSEIF (ILEQ (IABS (IDIFFERENCE Y (FETCH BOTTOM OF CR)))
                                         MARGIN)
                          THEN 'RIGHTBOTTOM])

(MACWINDOW.BUTTONEVENTFN
  [LAMBDA (WINDOW)                                      (* ; "Edited 23-May-2020 08:34 by rmk:")
                                                            (* ; "Edited 10-May-2020 03:35 by rmk:")
                                                            (* ; "Edited  3-May-2020 21:18 by rmk:")
    (IF (MOUSESTATE (ONLY LEFT))
        THEN (TOTOPW WINDOW)
              (LET (REGION (CORNER (INCORNER WINDOW)))
                   (IF CORNER
                       THEN 

                             (* ;; 
                     "The upper corners may be in the title bar, near the side, so test this first")

                             (SETQ REGION (WINDOWPROP WINDOW 'REGION))
                             [LET ((LEFT (FETCH LEFT OF REGION))
                                   (RIGHT (FETCH RIGHT OF REGION))
                                   (TOP (FETCH TOP OF REGION))
                                   (BOTTOM (FETCH BOTTOM OF REGION)))
                                  (SHAPEW WINDOW (GETREGION NIL NIL NIL NIL NIL
                                                        (SELECTQ CORNER
                                                            (RIGHTBOTTOM (LIST LEFT TOP RIGHT BOTTOM))
                                                            (LEFTBOTTOM (LIST RIGHT TOP LEFT BOTTOM))
                                                            (RIGHTTOP (LIST LEFT BOTTOM RIGHT TOP))
                                                            (LEFTTOP (LIST RIGHT BOTTOM LEFT TOP))
                                                            (SHOULDNT]
                             T
                     ELSEIF (INTITLEBAR WINDOW)
                       THEN (MOVEW WINDOW)
                             T
                     ELSEIF (WINDOWPROP WINDOW 'PREMACBUTTONEVENTFN)
                       THEN (APPLY* (WINDOWPROP WINDOW 'PREMACBUTTONEVENTFN)
                                       WINDOW)))
      ELSEIF (WINDOWPROP WINDOW 'PREMACBUTTONEVENTFN)
        THEN (APPLY* (WINDOWPROP WINDOW 'PREMACBUTTONEVENTFN)
                        WINDOW])

(MACWINDOW
  [LAMBDA (WINDOW)                                      (* ; "Edited 18-May-2020 20:11 by rmk:")
                                                            (* ; "Edited 10-May-2020 14:20 by rmk:")

    (* ;; "This can be applied to windows that have been created with an unknown or unmodifiable buttoneventfn.")
                                                        (* ; "Edited  3-May-2020 21:17 by rmk:")
    (CL:UNLESS (WINDOWPROP WINDOW 'PREMACBUTTONEVENTFN)
        (WINDOWPROP WINDOW 'PREMACBUTTONEVENTFN (WINDOWPROP WINDOW 'BUTTONEVENTFN))
        (WINDOWPROP WINDOW 'BUTTONEVENTFN (FUNCTION MACWINDOW.BUTTONEVENTFN)))
    WINDOW])
)
(DEFINEQ

(MACINT\TEDIT.BUTTONEVENTFN
  [LAMBDA (WINDOW)                                      (* ; "Edited 10-May-2020 03:31 by rmk:")
    (CL:WHEN (LISTP WINDOW)
        (SETQ WINDOW (CAR WINDOW)))
    (OR (MACWINDOW.BUTTONEVENTFN WINDOW)
        (MACORIG\TEDIT.BUTTONEVENTFN WINDOW])

(MACINT\SEDIT-BUTTONEVENTFN
  [LAMBDA (WINDOW)                                      (* ; "Edited 10-May-2020 03:31 by rmk:")
    (OR (MACWINDOW.BUTTONEVENTFN WINDOW)
        (MACORIG\SEDIT-BUTTONEVENTFN WINDOW])

(MACINT-ADD-EXEC
  [LAMBDA U                                             (* ; "Edited 10-May-2020 03:31 by rmk:")
    (LET [(PROC (APPLY (FUNCTION MACORIG-ADD-EXEC)
                       (FOR N FROM 1 TO U COLLECT (ARG U N]

         (* ;; "For some reason, the window may not be there immediately")

         (DISMISS 100)
         (MACWINDOW (PROCESSPROP PROC 'WINDOW))
         PROC])

(MACINT-DEBUGGER-BUTTON-EVENT
  [LAMBDA (WINDOW)                                      (* ; "Edited 10-May-2020 03:31 by rmk:")
    (OR (MACWINDOW.BUTTONEVENTFN WINDOW)
        (MACORIG-DEBUGGER-BUTTON-EVENT WINDOW])

(MACINT-\ITEM.WINDOW.BUTTON.HANDLER
  [LAMBDA (WINDOW)                                      (* ; "Edited 16-May-2020 22:35 by rmk:")
                                                            (* ; "Edited 10-May-2020 03:31 by rmk:")
    (OR (MACWINDOW.BUTTONEVENTFN WINDOW)
        (MACORIG-\ITEM.WINDOW.BUTTON.HANDLER WINDOW])

(MACINT-SNAPW
  [LAMBDA NIL                                           (* ; "Edited 18-May-2020 17:20 by rmk:")
    (LET ((W (MACORIG-SNAPW)))
         [WINDOWPROP W 'BUTTONEVENTFN (FUNCTION (LAMBDA (W)
                                                  (TOTOPW W)
                                                  (MOVEW W]
         W])
)

(RPAQ? MACINTERFACECORNERMARGIN 25)

(MOVD? '\TEDIT.BUTTONEVENTFN 'MACORIG\TEDIT.BUTTONEVENTFN)

(MOVD 'MACINT\TEDIT.BUTTONEVENTFN '\TEDIT.BUTTONEVENTFN)

(MOVD? 'SEDIT::BUTTONEVENTFN 'MACORIG\SEDIT-BUTTONEVENTFN)

(MOVD 'MACINT\SEDIT-BUTTONEVENTFN 'SEDIT::BUTTONEVENTFN)

(MOVD? 'ADD-EXEC 'MACORIG-ADD-EXEC)

(MOVD 'MACINT-ADD-EXEC 'ADD-EXEC)

(MOVD? 'DBG::DEBUGGER-BUTTON-EVENT 'MACORIG-DEBUGGER-BUTTON-EVENT)

(MOVD 'MACINT-DEBUGGER-BUTTON-EVENT 'DBG::DEBUGGER-BUTTON-EVENT)

(MOVD? '\ITEM.WINDOW.BUTTON.HANDLER 'MACORIG-\ITEM.WINDOW.BUTTON.HANDLER)

(MOVD 'MACINT-\ITEM.WINDOW.BUTTON.HANDLER '\ITEM.WINDOW.BUTTON.HANDLER)

(MOVD? 'SNAPW 'MACORIG-SNAPW)

(MOVD 'MACINT-SNAPW 'SNAPW)
(DECLARE%: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY COMPILERVARS 

(ADDTOVAR NLAMA )

(ADDTOVAR NLAML )

(ADDTOVAR LAMA MACINT-ADD-EXEC)
)
(DECLARE%: DONTCOPY
  (FILEMAP (NIL (1771 6322 (INTITLEBAR 1781 . 2001) (INCORNER 2003 . 3418) (MACWINDOW.BUTTONEVENTFN 3420
 . 5634) (MACWINDOW 5636 . 6320)) (6323 8217 (MACINT\TEDIT.BUTTONEVENTFN 6333 . 6624) (
MACINT\SEDIT-BUTTONEVENTFN 6626 . 6853) (MACINT-ADD-EXEC 6855 . 7279) (MACINT-DEBUGGER-BUTTON-EVENT 
7281 . 7512) (MACINT-\ITEM.WINDOW.BUTTON.HANDLER 7514 . 7866) (MACINT-SNAPW 7868 . 8215)))))
STOP
\ No newline at end of file
diff --git a/lispusers/MACINTERFACE.~31~ b/lispusers/MACINTERFACE.~31~
deleted file mode 100644
index dd681bfe..00000000
--- a/lispusers/MACINTERFACE.~31~
+++ /dev/null
@@ -1 +0,0 @@
-(DEFINE-FILE-INFO READTABLE "INTERLISP" PACKAGE "INTERLISP")
(FILECREATED "28-May-2020 18:02:27" 
{DSK}<Users>kaplan>Local>medley3.5>lispcore>lispusers>MACINTERFACE.;31 11583  

      changes to%:  (VARS MACINTERFACECOMS)
                    (FNS MACWINDOW.BUTTONEVENTFN.ANYWHERE MACWINDOW)

      previous date%: "23-May-2020 08:54:49" 
{DSK}<Users>kaplan>Local>medley3.5>lispcore>lispusers>MACINTERFACE.;30)


(PRETTYCOMPRINT MACINTERFACECOMS)

(RPAQQ MACINTERFACECOMS
       [(FNS INTITLEBAR INCORNER MACWINDOW.BUTTONEVENTFN MACWINDOW.BUTTONEVENTFN.ANYWHERE MACWINDOW)
        (FNS MACINT\TEDIT.BUTTONEVENTFN MACINT\SEDIT-BUTTONEVENTFN MACINT-ADD-EXEC 
             MACINT-DEBUGGER-BUTTON-EVENT MACINT-\ITEM.WINDOW.BUTTON.HANDLER MACINT-SNAPW)
        (INITVARS (MACINTERFACECORNERMARGIN 25))
        (P (MOVD? '\TEDIT.BUTTONEVENTFN 'MACORIG\TEDIT.BUTTONEVENTFN)
           (MOVD 'MACINT\TEDIT.BUTTONEVENTFN '\TEDIT.BUTTONEVENTFN))
        (P (MOVD? 'SEDIT::BUTTONEVENTFN 'MACORIG\SEDIT-BUTTONEVENTFN)
           (MOVD 'MACINT\SEDIT-BUTTONEVENTFN 'SEDIT::BUTTONEVENTFN))
        (P (MOVD? 'ADD-EXEC 'MACORIG-ADD-EXEC)
           (MOVD 'MACINT-ADD-EXEC 'ADD-EXEC))
        (P (MOVD? 'DBG::DEBUGGER-BUTTON-EVENT 'MACORIG-DEBUGGER-BUTTON-EVENT)
           (MOVD 'MACINT-DEBUGGER-BUTTON-EVENT 'DBG::DEBUGGER-BUTTON-EVENT))
        (P (MOVD? '\ITEM.WINDOW.BUTTON.HANDLER 'MACORIG-\ITEM.WINDOW.BUTTON.HANDLER)
           (MOVD 'MACINT-\ITEM.WINDOW.BUTTON.HANDLER '\ITEM.WINDOW.BUTTON.HANDLER))
        (P (MOVD? 'SNAPW 'MACORIG-SNAPW)
           (MOVD 'MACINT-SNAPW 'SNAPW))
        (DECLARE%: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY COMPILERVARS (ADDVARS (NLAMA)
                                                                             (NLAML)
                                                                             (LAMA MACINT-ADD-EXEC])
(DEFINEQ

(INTITLEBAR
  [LAMBDA (WINDOW)                                      (* ; "Edited  3-May-2020 20:38 by rmk:")
    (IGREATERP (LASTMOUSEY WINDOW)
           (FETCH TOP OF (DSPCLIPPINGREGION NIL WINDOW])

(INCORNER
  [LAMBDA (WINDOW MARGIN)                               (* ; "Edited 13-May-2020 14:26 by rmk:")
                                                            (* ; "Edited 10-May-2020 12:41 by rmk:")
                                                            (* ; "Edited  3-May-2020 20:43 by rmk:")
    (CL:UNLESS MARGIN (SETQ MARGIN MACINTERFACECORNERMARGIN))
    (LET ((CR (DSPCLIPPINGREGION NIL WINDOW))
          (X (LASTMOUSEX WINDOW))
          (Y (LASTMOUSEY WINDOW)))
         (IF (ILEQ (IABS (IDIFFERENCE X (FETCH LEFT OF CR)))
                       MARGIN)
             THEN 

                   (* ;; "GREATERP puts it in title bar")

                   (IF (IGREATERP Y (FETCH TOP OF CR))
                       THEN 'LEFTTOP
                     ELSEIF (ILEQ (IABS (IDIFFERENCE Y (FETCH BOTTOM OF CR)))
                                      MARGIN)
                       THEN 'LEFTBOTTOM)
           ELSEIF (ILEQ (IABS (IDIFFERENCE X (FETCH RIGHT OF CR)))
                            MARGIN)
             THEN (IF (IGREATERP Y (FETCH TOP OF CR))
                          THEN 'RIGHTTOP
                        ELSEIF (ILEQ (IABS (IDIFFERENCE Y (FETCH BOTTOM OF CR)))
                                         MARGIN)
                          THEN 'RIGHTBOTTOM])

(MACWINDOW.BUTTONEVENTFN
  [LAMBDA (WINDOW)                                      (* ; "Edited 23-May-2020 08:34 by rmk:")
                                                            (* ; "Edited 10-May-2020 03:35 by rmk:")
                                                            (* ; "Edited  3-May-2020 21:18 by rmk:")
    (IF (MOUSESTATE (ONLY LEFT))
        THEN (TOTOPW WINDOW)
              (LET (REGION (CORNER (INCORNER WINDOW)))
                   (IF CORNER
                       THEN 

                             (* ;; 
                     "The upper corners may be in the title bar, near the side, so test this first")

                             (SETQ REGION (WINDOWPROP WINDOW 'REGION))
                             [LET ((LEFT (FETCH LEFT OF REGION))
                                   (RIGHT (FETCH RIGHT OF REGION))
                                   (TOP (FETCH TOP OF REGION))
                                   (BOTTOM (FETCH BOTTOM OF REGION)))
                                  (SHAPEW WINDOW (GETREGION NIL NIL NIL NIL NIL
                                                        (SELECTQ CORNER
                                                            (RIGHTBOTTOM (LIST LEFT TOP RIGHT BOTTOM))
                                                            (LEFTBOTTOM (LIST RIGHT TOP LEFT BOTTOM))
                                                            (RIGHTTOP (LIST LEFT BOTTOM RIGHT TOP))
                                                            (LEFTTOP (LIST RIGHT BOTTOM LEFT TOP))
                                                            (SHOULDNT]
                             T
                     ELSEIF (INTITLEBAR WINDOW)
                       THEN (MOVEW WINDOW)
                             T
                     ELSEIF (WINDOWPROP WINDOW 'PREMACBUTTONEVENTFN)
                       THEN (APPLY* (WINDOWPROP WINDOW 'PREMACBUTTONEVENTFN)
                                       WINDOW)))
      ELSEIF (WINDOWPROP WINDOW 'PREMACBUTTONEVENTFN)
        THEN (APPLY* (WINDOWPROP WINDOW 'PREMACBUTTONEVENTFN)
                        WINDOW])

(MACWINDOW.BUTTONEVENTFN.ANYWHERE
  [LAMBDA (WINDOW)                                      (* ; "Edited 28-May-2020 18:00 by rmk:")
                                                            (* ; "Edited 23-May-2020 08:34 by rmk:")
                                                            (* ; "Edited 10-May-2020 03:35 by rmk:")
                                                            (* ; "Edited  3-May-2020 21:18 by rmk:")

    (* ;; "Move if left-click anywhere, not just titlebar")

    (IF (MOUSESTATE (ONLY LEFT))
        THEN (TOTOPW WINDOW)
              (LET (REGION (CORNER (INCORNER WINDOW)))
                   (IF CORNER
                       THEN 

                             (* ;; 
                     "The upper corners may be in the title bar, near the side, so test this first")

                             (SETQ REGION (WINDOWPROP WINDOW 'REGION))
                             [LET ((LEFT (FETCH LEFT OF REGION))
                                   (RIGHT (FETCH RIGHT OF REGION))
                                   (TOP (FETCH TOP OF REGION))
                                   (BOTTOM (FETCH BOTTOM OF REGION)))
                                  (SHAPEW WINDOW (GETREGION NIL NIL NIL NIL NIL
                                                        (SELECTQ CORNER
                                                            (RIGHTBOTTOM (LIST LEFT TOP RIGHT BOTTOM))
                                                            (LEFTBOTTOM (LIST RIGHT TOP LEFT BOTTOM))
                                                            (RIGHTTOP (LIST LEFT BOTTOM RIGHT TOP))
                                                            (LEFTTOP (LIST RIGHT BOTTOM LEFT TOP))
                                                            (SHOULDNT]
                             T
                     ELSE (MOVEW WINDOW)
                           T))
      ELSEIF (WINDOWPROP WINDOW 'PREMACBUTTONEVENTFN)
        THEN (APPLY* (WINDOWPROP WINDOW 'PREMACBUTTONEVENTFN)
                        WINDOW])

(MACWINDOW
  [LAMBDA (WINDOW ANYWHERE)                             (* ; "Edited 28-May-2020 17:58 by rmk:")
                                                            (* ; "Edited 18-May-2020 20:11 by rmk:")
                                                            (* ; "Edited 10-May-2020 14:20 by rmk:")

    (* ;; "This can be applied to windows that have been created with an unknown or unmodifiable buttoneventfn.")
                                                        (* ; "Edited  3-May-2020 21:17 by rmk:")
    (CL:UNLESS (WINDOWPROP WINDOW 'PREMACBUTTONEVENTFN)
        (WINDOWPROP WINDOW 'PREMACBUTTONEVENTFN (WINDOWPROP WINDOW 'BUTTONEVENTFN))
        (WINDOWPROP WINDOW 'BUTTONEVENTFN (IF ANYWHERE
                                              THEN (FUNCTION MACWINDOW.BUTTONEVENTFN.ANYWHERE)
                                            ELSE (FUNCTION MACWINDOW.BUTTONEVENTFN))))
    WINDOW])
)
(DEFINEQ

(MACINT\TEDIT.BUTTONEVENTFN
  [LAMBDA (WINDOW)                                      (* ; "Edited 10-May-2020 03:31 by rmk:")
    (CL:WHEN (LISTP WINDOW)
        (SETQ WINDOW (CAR WINDOW)))
    (OR (MACWINDOW.BUTTONEVENTFN WINDOW)
        (MACORIG\TEDIT.BUTTONEVENTFN WINDOW])

(MACINT\SEDIT-BUTTONEVENTFN
  [LAMBDA (WINDOW)                                      (* ; "Edited 10-May-2020 03:31 by rmk:")
    (OR (MACWINDOW.BUTTONEVENTFN WINDOW)
        (MACORIG\SEDIT-BUTTONEVENTFN WINDOW])

(MACINT-ADD-EXEC
  [LAMBDA U                                             (* ; "Edited 10-May-2020 03:31 by rmk:")
    (LET [(PROC (APPLY (FUNCTION MACORIG-ADD-EXEC)
                       (FOR N FROM 1 TO U COLLECT (ARG U N]

         (* ;; "For some reason, the window may not be there immediately")

         (DISMISS 100)
         (MACWINDOW (PROCESSPROP PROC 'WINDOW))
         PROC])

(MACINT-DEBUGGER-BUTTON-EVENT
  [LAMBDA (WINDOW)                                      (* ; "Edited 10-May-2020 03:31 by rmk:")
    (OR (MACWINDOW.BUTTONEVENTFN WINDOW)
        (MACORIG-DEBUGGER-BUTTON-EVENT WINDOW])

(MACINT-\ITEM.WINDOW.BUTTON.HANDLER
  [LAMBDA (WINDOW)                                      (* ; "Edited 16-May-2020 22:35 by rmk:")
                                                            (* ; "Edited 10-May-2020 03:31 by rmk:")
    (OR (MACWINDOW.BUTTONEVENTFN WINDOW)
        (MACORIG-\ITEM.WINDOW.BUTTON.HANDLER WINDOW])

(MACINT-SNAPW
  [LAMBDA NIL                                           (* ; "Edited 18-May-2020 17:20 by rmk:")
    (LET ((W (MACORIG-SNAPW)))
         [WINDOWPROP W 'BUTTONEVENTFN (FUNCTION (LAMBDA (W)
                                                  (TOTOPW W)
                                                  (MOVEW W]
         W])
)

(RPAQ? MACINTERFACECORNERMARGIN 25)

(MOVD? '\TEDIT.BUTTONEVENTFN 'MACORIG\TEDIT.BUTTONEVENTFN)

(MOVD 'MACINT\TEDIT.BUTTONEVENTFN '\TEDIT.BUTTONEVENTFN)

(MOVD? 'SEDIT::BUTTONEVENTFN 'MACORIG\SEDIT-BUTTONEVENTFN)

(MOVD 'MACINT\SEDIT-BUTTONEVENTFN 'SEDIT::BUTTONEVENTFN)

(MOVD? 'ADD-EXEC 'MACORIG-ADD-EXEC)

(MOVD 'MACINT-ADD-EXEC 'ADD-EXEC)

(MOVD? 'DBG::DEBUGGER-BUTTON-EVENT 'MACORIG-DEBUGGER-BUTTON-EVENT)

(MOVD 'MACINT-DEBUGGER-BUTTON-EVENT 'DBG::DEBUGGER-BUTTON-EVENT)

(MOVD? '\ITEM.WINDOW.BUTTON.HANDLER 'MACORIG-\ITEM.WINDOW.BUTTON.HANDLER)

(MOVD 'MACINT-\ITEM.WINDOW.BUTTON.HANDLER '\ITEM.WINDOW.BUTTON.HANDLER)

(MOVD? 'SNAPW 'MACORIG-SNAPW)

(MOVD 'MACINT-SNAPW 'SNAPW)
(DECLARE%: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY COMPILERVARS 

(ADDTOVAR NLAMA )

(ADDTOVAR NLAML )

(ADDTOVAR LAMA MACINT-ADD-EXEC)
)
(DECLARE%: DONTCOPY
  (FILEMAP (NIL (1857 8826 (INTITLEBAR 1867 . 2087) (INCORNER 2089 . 3504) (MACWINDOW.BUTTONEVENTFN 3506
 . 5720) (MACWINDOW.BUTTONEVENTFN.ANYWHERE 5722 . 7859) (MACWINDOW 7861 . 8824)) (8827 10721 (
MACINT\TEDIT.BUTTONEVENTFN 8837 . 9128) (MACINT\SEDIT-BUTTONEVENTFN 9130 . 9357) (MACINT-ADD-EXEC 9359
 . 9783) (MACINT-DEBUGGER-BUTTON-EVENT 9785 . 10016) (MACINT-\ITEM.WINDOW.BUTTON.HANDLER 10018 . 10370
) (MACINT-SNAPW 10372 . 10719)))))
STOP
\ No newline at end of file
diff --git a/lispusers/MACINTERFACE.~52~ b/lispusers/MACINTERFACE.~52~
deleted file mode 100644
index 6b135c9b..00000000
--- a/lispusers/MACINTERFACE.~52~
+++ /dev/null
@@ -1 +0,0 @@
-(DEFINE-FILE-INFO READTABLE "INTERLISP" PACKAGE "INTERLISP")
(FILECREATED " 8-Aug-2020 15:48:17" 
{DSK}<Users>kaplan>Local>medley3.5>lispcore>lispusers>MACINTERFACE.;52 14335  

      changes to%:  (VARS MACINTERFACECOMS)

      previous date%: " 8-Aug-2020 08:01:06" 
{DSK}<Users>kaplan>Local>medley3.5>lispcore>lispusers>MACINTERFACE.;51)


(PRETTYCOMPRINT MACINTERFACECOMS)

(RPAQQ MACINTERFACECOMS
       [
        (* ;; "Externals")

        (COMS (FNS MACWINDOW MACWINDOW.SETUP MACWINDOW.UNSETUP)
              (INITVARS (MACINTERFACECORNERMARGIN 25)))
        
        (* ;; "Internals")

        [COMS (FNS INTITLEBAR INCORNER MACWINDOW.BUTTONEVENTFN MACWINDOW.BUTTONEVENTFN.ANYWHERE)
              
              (* ;; "Behavior for some known window creators")

              (FNS MACINT-ADD-EXEC MACINT-SNAPW)
              (FNS TEDIT.MACINTERFACE TEDIT.SELECTALL)
              (DECLARE%: DONTEVAL@LOAD DOCOPY (P (TEDIT.MACINTERFACE)
                                                 
                                                 (* ;; "Inspector")

                                                 (MACWINDOW.SETUP '\ITEM.WINDOW.BUTTON.HANDLER)
                                                 

                                 (* ;; "Commonlisp array inspector.  If you move the main window, the little attached window doesn't move.  But if you move the attached window, it all works.  Needs a special definition.  Shaping doesn't work either")

                                                 (* (MACWINDOW.SETUP 'ONEDINSPECT.BUTTONEVENTFN))
                                                 (MACWINDOW.SETUP 'ICMLARRAY.TITLECOMMANDFN)
                                                 
                                                 (* ;; "Freemenu")

                                                 (MACWINDOW.SETUP '\FM.BUTTONEVENTFN)
                                                 
                                                 (* ;; "SEDIT")

                                                 (MACWINDOW.SETUP 'SEDIT::BUTTONEVENTFN)
                                                 
                                                 (* ;; "Debugger")

                                                 (MACWINDOW.SETUP 'DBG::DEBUGGER-BUTTON-EVENT)
                                                 
                                                 (* ;; "Snap")

                                                 (MACWINDOW.SETUP 'SNAPW 'MACINT-SNAPW)
                                                 
                                                 (* ;; "New execs")

                                                 (MACWINDOW.SETUP 'ADD-EXEC 'MACINT-ADD-EXEC)
                                                 
                                                 (* ;; "Existing exec of the load")

                                                 (MACWINDOW (PROCESSPROP (TTY.PROCESS)
                                                                   'WINDOW]
        (DECLARE%: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY COMPILERVARS (ADDVARS (NLAMA)
                                                                             (NLAML)
                                                                             (LAMA MACINT-ADD-EXEC])



(* ;; "Externals")

(DEFINEQ

(MACWINDOW
  [LAMBDA (WINDOW ANYWHERE)                             (* ; "Edited 23-Jun-2020 16:01 by rmk:")

    (* ;; "This can be applied to windows that have been created with an unknown or unmodifiable buttoneventfn.")

    (CL:UNLESS (WINDOWPROP WINDOW 'PREMACBUTTONEVENTFN)
        (WINDOWPROP WINDOW 'PREMACBUTTONEVENTFN (WINDOWPROP WINDOW 'BUTTONEVENTFN))
        (WINDOWPROP WINDOW 'BUTTONEVENTFN (IF ANYWHERE
                                              THEN (FUNCTION MACWINDOW.BUTTONEVENTFN.ANYWHERE)
                                            ELSE (FUNCTION MACWINDOW.BUTTONEVENTFN))))
    WINDOW])

(MACWINDOW.SETUP
  [LAMBDA (ORIGFN MACWINDOWFN ANYWHERE)                 (* ; "Edited 24-Jun-2020 15:09 by rmk:")

    (* ;; "ORIGFN is either a function that creates windows of a given type (e.g. SNAPW or ADD-EXEC) or the known BUTTONEVENTFN of a class of windows.")

    (* ;; "Moves ORIGNFN to a new name, prefixed with MACORIG-.")

    (* ;; "If MACWINDOWFN is given, then that replaces the original definition of ORIGFN, and presumably knows how to call the renamed ORIGFN under the write circumstances.  This is typically the case where ORIGFN is a window creator.")

    (* ;; "Otherwise, ORIGFN is taken to be the BUTTONEVENTFN for a class of windows, and its new definition is defaulted to one that maps left-clicks in appropriate areas into Mac window operations.  If not in appropriate areas, then the renamed ORIGNFN is called to give the original button behavior.")

    (* ;; "If ANYWHERE, moving will happen for any click not in one of the shaping corners.")

    (* ;; "The renamed function has arguments in addition to WINDOW:  the new name for the original function, if MACWINDOFN is provided, and the value specified here for ANYWHERE.")

    (LET [RENAMEDORIG (PKGNAME (CL:PACKAGE-NAME (CL:SYMBOL-PACKAGE ORIGFN]

         (* ;; "The renamed version of XCL symbols go into Interlisp, so there is less confusion about accessing it")

         (CL:WHEN (STREQUAL PKGNAME "XEROX-COMMON-LISP")
                (SETQ PKGNAME "INTERLISP"))
         (SETQ RENAMEDORIG (CL:INTERN (CONCAT 'MACORIG- ORIGFN)
                                  PKGNAME))
         (MOVD? ORIGFN RENAMEDORIG)
         (IF MACWINDOWFN
             THEN (MOVD MACWINDOWFN ORIGFN)
           ELSE (PUTD ORIGFN `(LAMBDA (WINDOW)
                                    (MACWINDOW.BUTTONEVENTFN WINDOW (FUNCTION ,RENAMEDORIG)
                                           ,ANYWHERE])

(MACWINDOW.UNSETUP
  [LAMBDA (ORIGFN)                                      (* ; "Edited  6-Jul-2020 13:04 by rmk:")
                                                            (* ; "Edited 24-Jun-2020 15:09 by rmk:")

    (* ;; "Moves the renamed original function back to its original name")

    (LET [RENAMEDORIG (PKGNAME (CL:PACKAGE-NAME (CL:SYMBOL-PACKAGE ORIGFN]

         (* ;; "The renamed version of XCL symbols go into Interlisp, so there is less confusion about accessing it")

         (CL:WHEN (STREQUAL PKGNAME "XEROX-COMMON-LISP")
                (SETQ PKGNAME "INTERLISP"))
         (SETQ RENAMEDORIG (CL:INTERN (CONCAT 'MACORIG- ORIGFN)
                                  PKGNAME))
         (CL:WHEN (GETD RENAMEDORIG)
                (MOVD RENAMEDORIG ORIGFN])
)

(RPAQ? MACINTERFACECORNERMARGIN 25)



(* ;; "Internals")

(DEFINEQ

(INTITLEBAR
  [LAMBDA (WINDOW)                                      (* ; "Edited  3-May-2020 20:38 by rmk:")
    (IGREATERP (LASTMOUSEY WINDOW)
           (FETCH TOP OF (DSPCLIPPINGREGION NIL WINDOW])

(INCORNER
  [LAMBDA (WINDOW MARGIN)                               (* ; "Edited 13-May-2020 14:26 by rmk:")
                                                            (* ; "Edited 10-May-2020 12:41 by rmk:")
                                                            (* ; "Edited  3-May-2020 20:43 by rmk:")
    (CL:UNLESS MARGIN (SETQ MARGIN MACINTERFACECORNERMARGIN))
    (LET ((CR (DSPCLIPPINGREGION NIL WINDOW))
          (X (LASTMOUSEX WINDOW))
          (Y (LASTMOUSEY WINDOW)))
         (IF (ILEQ (IABS (IDIFFERENCE X (FETCH LEFT OF CR)))
                       MARGIN)
             THEN 

                   (* ;; "GREATERP puts it in title bar")

                   (IF (IGREATERP Y (FETCH TOP OF CR))
                       THEN 'LEFTTOP
                     ELSEIF (ILEQ (IABS (IDIFFERENCE Y (FETCH BOTTOM OF CR)))
                                      MARGIN)
                       THEN 'LEFTBOTTOM)
           ELSEIF (ILEQ (IABS (IDIFFERENCE X (FETCH RIGHT OF CR)))
                            MARGIN)
             THEN (IF (IGREATERP Y (FETCH TOP OF CR))
                          THEN 'RIGHTTOP
                        ELSEIF (ILEQ (IABS (IDIFFERENCE Y (FETCH BOTTOM OF CR)))
                                         MARGIN)
                          THEN 'RIGHTBOTTOM])

(MACWINDOW.BUTTONEVENTFN
  [LAMBDA (WINDOW ORIGFUNCTION ANYWHERE)                (* ; "Edited 24-Jun-2020 20:23 by rmk:")
                                                            (* ; "Edited 23-May-2020 08:34 by rmk:")
                                                            (* ; "Edited 10-May-2020 03:35 by rmk:")
                                                            (* ; "Edited  3-May-2020 21:18 by rmk:")
    (IF (AND (MOUSESTATE (ONLY LEFT))
                 (EQ LASTKEYBOARD 0))
        THEN (TOTOPW WINDOW)
              (LET (REGION (CORNER (INCORNER WINDOW)))
                   (IF CORNER
                       THEN 

                             (* ;; 
                     "The upper corners may be in the title bar, near the side, so test this first")

                             (SETQ REGION (WINDOWPROP WINDOW 'REGION))
                             [LET ((LEFT (FETCH LEFT OF REGION))
                                   (RIGHT (FETCH RIGHT OF REGION))
                                   (TOP (FETCH TOP OF REGION))
                                   (BOTTOM (FETCH BOTTOM OF REGION)))
                                  (SHAPEW WINDOW (GETREGION NIL NIL NIL NIL NIL
                                                        (SELECTQ CORNER
                                                            (RIGHTBOTTOM (LIST LEFT TOP RIGHT BOTTOM))
                                                            (LEFTBOTTOM (LIST RIGHT TOP LEFT BOTTOM))
                                                            (RIGHTTOP (LIST LEFT BOTTOM RIGHT TOP))
                                                            (LEFTTOP (LIST RIGHT BOTTOM LEFT TOP))
                                                            (SHOULDNT]
                             T
                     ELSEIF (OR ANYWHERE (INTITLEBAR WINDOW))
                       THEN (MOVEW WINDOW)
                             T
                     ELSEIF [OR ORIGFUNCTION (SETQ ORIGFUNCTION (WINDOWPROP WINDOW 
                                                                           'PREMACBUTTONEVENTFN]
                       THEN (APPLY* ORIGFUNCTION WINDOW)))
      ELSEIF [OR ORIGFUNCTION (SETQ ORIGFUNCTION (WINDOWPROP WINDOW 'PREMACBUTTONEVENTFN]
        THEN (APPLY* ORIGFUNCTION WINDOW])

(MACWINDOW.BUTTONEVENTFN.ANYWHERE
  [LAMBDA (WINDOW)                                      (* ; "Edited 24-Jun-2020 13:24 by rmk:")

    (* ;; "Move if left-click anywhere, not just titlebar")

    (MACWINDOW.BUTTONEVENTFN NIL T])
)



(* ;; "Behavior for some known window creators")

(DEFINEQ

(MACINT-ADD-EXEC
  [LAMBDA U                                             (* ; "Edited 24-Jun-2020 14:23 by rmk:")
    (LET [(PROC (APPLY (FUNCTION MACORIG-ADD-EXEC)
                       (FOR N FROM 1 TO U COLLECT (ARG U N]

         (* ;; "For some reason, the window may not be there immediately")

         (DISMISS 100)
         (MACWINDOW (PROCESSPROP PROC 'WINDOW))
         PROC])

(MACINT-SNAPW
  [LAMBDA NIL                                           (* ; "Edited 24-Jun-2020 13:19 by rmk:")

    (* ;; "No point in shaping a snap window, just move it.;;")

    (* ;; 
"This changes the creation function (SNAPW), since snap windows otherwise don't have a BUTTONEVENTN")

    (LET ((W (MACORIG-SNAPW)))
         [WINDOWPROP W 'BUTTONEVENTFN (FUNCTION (LAMBDA (W)
                                                  (TOTOPW W)
                                                  (MOVEW W]
         W])
)
(DEFINEQ

(TEDIT.MACINTERFACE
  [LAMBDA NIL                                               (* ; "Edited  8-Aug-2020 07:58 by rmk:")
    (MACWINDOW.SETUP '\TEDIT.BUTTONEVENTFN)

    (* ;; "All")

    (TEDIT.SETFUNCTION (CHARCODE "1,a")
           (FUNCTION TEDIT.SELECTALL)
           TEDIT.READTABLE)
    (TEDIT.SETFUNCTION (CHARCODE "1,A")
           (FUNCTION TEDIT.SELECTALL)
           TEDIT.READTABLE)

    (* ;; "Quit")

    (TEDIT.SETFUNCTION (CHARCODE "1,q")
           (FUNCTION TEDIT.QUIT)
           TEDIT.READTABLE)
    (TEDIT.SETFUNCTION (CHARCODE "1,Q")
           (FUNCTION TEDIT.QUIT)
           TEDIT.READTABLE])

(TEDIT.SELECTALL
  [LAMBDA (STREAM TEXTOBJ SEL)                          (* ; "Edited  3-May-2020 17:29 by rmk:")
    (LET [(TEXTSTREAM (TEXTSTREAM (TTY.PROCESS]
         (CL:WHEN TEXTSTREAM
             (TEDIT.SETSEL TEXTSTREAM 0 (ADD1 (fetch TEXTLEN of (TEXTOBJ TEXTSTREAM)))
                    'LEFT))])
)
(DECLARE%: DONTEVAL@LOAD DOCOPY 

(TEDIT.MACINTERFACE)


(* ;; "Inspector")


(MACWINDOW.SETUP '\ITEM.WINDOW.BUTTON.HANDLER)


(* ;; "Commonlisp array inspector.  If you move the main window, the little attached window doesn't move.  But if you move the attached window, it all works.  Needs a special definition.  Shaping doesn't work either")


                                                             (* (MACWINDOW.SETUP
                                                           (QUOTE ONEDINSPECT.BUTTONEVENTFN)))

(MACWINDOW.SETUP 'ICMLARRAY.TITLECOMMANDFN)


(* ;; "Freemenu")


(MACWINDOW.SETUP '\FM.BUTTONEVENTFN)


(* ;; "SEDIT")


(MACWINDOW.SETUP 'SEDIT::BUTTONEVENTFN)


(* ;; "Debugger")


(MACWINDOW.SETUP 'DBG::DEBUGGER-BUTTON-EVENT)


(* ;; "Snap")


(MACWINDOW.SETUP 'SNAPW 'MACINT-SNAPW)


(* ;; "New execs")


(MACWINDOW.SETUP 'ADD-EXEC 'MACINT-ADD-EXEC)


(* ;; "Existing exec of the load")


(MACWINDOW (PROCESSPROP (TTY.PROCESS)
                      'WINDOW))
)
(DECLARE%: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY COMPILERVARS 

(ADDTOVAR NLAMA )

(ADDTOVAR NLAML )

(ADDTOVAR LAMA MACINT-ADD-EXEC)
)
(DECLARE%: DONTCOPY
  (FILEMAP (NIL (3345 6723 (MACWINDOW 3355 . 3996) (MACWINDOW.SETUP 3998 . 5914) (MACWINDOW.UNSETUP 5916
 . 6721)) (6792 11103 (INTITLEBAR 6802 . 7022) (INCORNER 7024 . 8439) (MACWINDOW.BUTTONEVENTFN 8441 . 
10850) (MACWINDOW.BUTTONEVENTFN.ANYWHERE 10852 . 11101)) (11161 12138 (MACINT-ADD-EXEC 11171 . 11595) 
(MACINT-SNAPW 11597 . 12136)) (12139 13098 (TEDIT.MACINTERFACE 12149 . 12767) (TEDIT.SELECTALL 12769
 . 13096)))))
STOP
\ No newline at end of file
