diff --git a/lispusers/COMPAREDIRECTORIES b/lispusers/COMPAREDIRECTORIES
index 4c1cc920..a00a8f22 100644
--- a/lispusers/COMPAREDIRECTORIES
+++ b/lispusers/COMPAREDIRECTORIES
@@ -1,14 +1,12 @@
 (DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10)
 
-(FILECREATED "25-Apr-2022 09:25:02" 
-{DSK}<Users>kaplan>Local>medley3.5>my-medley>lispusers>COMPAREDIRECTORIES.;217 123829 
+(FILECREATED " 9-May-2022 20:28:46" 
+{DSK}<users>kaplan>local>medley3.5>my-medley>lispusers>COMPAREDIRECTORIES.;218 123686 
 
-      :CHANGES-TO (FNS CDBROWSER-COPY COMPAREDIRECTORIES.INFOS.TYPE CDFILES FIND-UNSOURCED-FILES 
-                       FIND-SOURCE-FILES FIND-COMPILED-FILES FIND-UNLOADED-FILES FIND-LOADED-FILES 
-                       FIND-MULTICOMPILED-FILES SOURCE-FOR-COMPILED-P CDBROWSER-DELETE-FILE)
+      :CHANGES-TO (FNS SOURCE-FOR-COMPILED-P)
 
-      :PREVIOUS-DATE "29-Mar-2022 11:53:34" 
-{DSK}<Users>kaplan>Local>medley3.5>my-medley>lispusers>COMPAREDIRECTORIES.;215)
+      :PREVIOUS-DATE "25-Apr-2022 09:25:02" 
+{DSK}<users>kaplan>local>medley3.5>my-medley>lispusers>COMPAREDIRECTORIES.;217)
 
 
 (* ; "
@@ -1376,7 +1374,8 @@ Copyright (c) 1985-1988, 1990, 1994, 1998, 2018, 2020-2021 by Venue & Xerox Corp
               (LIST SOURCENAME (GDATE (IDATE SOURCEDATE))))])
 
 (SOURCE-FOR-COMPILED-P
-  [LAMBDA (SOURCE COMPILED DFASLMARGIN)                      (* ; "Edited 25-Apr-2022 08:46 by rmk")
+  [LAMBDA (SOURCE COMPILED DFASLMARGIN)                      (* ; "Edited  9-May-2022 20:28 by rmk")
+                                                             (* ; "Edited 25-Apr-2022 08:46 by rmk")
                                                             (* ; "Edited 31-Oct-2020 09:12 by rmk:")
 
     (* ;; "There seems to be some variation between the source dates in dfasl files and the filecreated date in the sources, they often don't match exactly.  But if they are within DFASLMARGIN, we assume a match.  We require exact date match for LCOMS")
@@ -1416,8 +1415,8 @@ Copyright (c) 1985-1988, 1990, 1994, 1998, 2018, 2020-2021 by Venue & Xerox Corp
                (CADDR COMPILED))
         (EQUAL (CADR SOURCE)
                (CADDDR COMPILED))
-        (AND [STREQUAL 'DFASL (U-CASE (FILENAMEFIELD.STRING (CAR COMPILED)
-                                             'EXTENSION]
+        (AND (STRING.EQUAL 'DFASL (FILENAMEFIELD.STRING (CAR COMPILED)
+                                         'EXTENSION))
              (LET ((TIMEDIFF (COMPILE-SOURCE-DATE-DIFF COMPILED SOURCE)))
 
                   (* ;; "If compiled was no more than 20 minutes later, it's probably OK.  Of no more than DFASLMARGIN earlier, if it is negative.")
@@ -2096,24 +2095,24 @@ Copyright (c) 1985-1988, 1990, 1994, 1998, 2018, 2020-2021 by Venue & Xerox Corp
 (PUTPROPS COMPAREDIRECTORIES COPYRIGHT ("Venue & Xerox Corporation" 1985 1986 1987 1988 1990 1994 1998
  2018 2020 2021))
 (DECLARE%: DONTCOPY
-  (FILEMAP (NIL (2856 22205 (COMPAREDIRECTORIES 2866 . 7699) (COMPAREDIRECTORIES.INFOS 7701 . 10552) (
-COMPAREDIRECTORIES.CANDIDATES 10554 . 13939) (CDENTRIES.SELECT 13941 . 18716) (
-COMPAREDIRECTORIES.INFOS.TYPE 18718 . 19439) (MATCHNAME 19441 . 20121) (CD.INSURECDVALUE 20123 . 21737
-) (CD.UPDATEWIDTHS 21739 . 22203)) (22206 31875 (CDFILES 22216 . 27969) (CDFILES.MATCH 27971 . 29596) 
-(CDFILES.PATS 29598 . 31873)) (31876 46961 (CDPRINT 31886 . 34231) (CDPRINT.HEADER 34233 . 35130) (
-CDPRINT.LINE 35132 . 37688) (CDPRINT.MAXWIDTHS 37690 . 41805) (CDPRINT.COLHEADERS 41807 . 42445) (
-CDPRINT.COLUMNS 42447 . 46326) (CDTEDIT 46328 . 46959)) (46962 55331 (CDMAP 46972 . 48404) (CDENTRY 
-48406 . 48715) (CDSUBSET 48717 . 50156) (CDMERGE 50158 . 54012) (CDMERGE.COMMON 54014 . 55329)) (55332
- 62870 (BINCOMP 55342 . 59631) (EOLTYPE 59633 . 62195) (EOLTYPE.SHOW 62197 . 62868)) (63398 75925 (
-FIND-UNCOMPILED-FILES 63408 . 67051) (FIND-UNSOURCED-FILES 67053 . 69437) (FIND-SOURCE-FILES 69439 . 
-71177) (FIND-COMPILED-FILES 71179 . 73056) (FIND-UNLOADED-FILES 73058 . 73911) (FIND-LOADED-FILES 
-73913 . 74341) (FIND-MULTICOMPILED-FILES 74343 . 75923)) (75926 84255 (CREATED-AS 75936 . 80733) (
-SOURCE-FOR-COMPILED-P 80735 . 83560) (COMPILE-SOURCE-DATE-DIFF 83562 . 84253)) (84256 94562 (
-FIX-DIRECTORY-DATES 84266 . 87259) (FIX-EQUIV-DATES 87261 . 88786) (COPY-COMPARED-FILES 88788 . 90609)
- (COPY-MISSING-FILES 90611 . 92768) (COMPILED-ON-SAME-SOURCE 92770 . 94560)) (94756 102102 (CDBROWSER 
-94766 . 98693) (CDBROWSER.STRINGS 98695 . 102100)) (102264 104000 (CD.TABLEITEM 102274 . 102494) (
-CD.TABLEITEM.PRINTFN 102496 . 102695) (CD.TABLEITEM.COPYFN 102697 . 103755) (
-CDTABLEBROWSER.HEADING.REPAINTFN 103757 . 103998)) (104001 123245 (CDTABLEBROWSER.WHENSELECTEDFN 
-104011 . 104479) (CD.COMMANDSELECTEDFN 104481 . 109582) (CD-MENUFN 109584 . 115947) (CDBROWSER-COPY 
-115949 . 119509) (CDBROWSER-DELETE-FILE 119511 . 122724) (CD-SWAPDIRS 122726 . 123243)))))
+  (FILEMAP (NIL (2611 21960 (COMPAREDIRECTORIES 2621 . 7454) (COMPAREDIRECTORIES.INFOS 7456 . 10307) (
+COMPAREDIRECTORIES.CANDIDATES 10309 . 13694) (CDENTRIES.SELECT 13696 . 18471) (
+COMPAREDIRECTORIES.INFOS.TYPE 18473 . 19194) (MATCHNAME 19196 . 19876) (CD.INSURECDVALUE 19878 . 21492
+) (CD.UPDATEWIDTHS 21494 . 21958)) (21961 31630 (CDFILES 21971 . 27724) (CDFILES.MATCH 27726 . 29351) 
+(CDFILES.PATS 29353 . 31628)) (31631 46716 (CDPRINT 31641 . 33986) (CDPRINT.HEADER 33988 . 34885) (
+CDPRINT.LINE 34887 . 37443) (CDPRINT.MAXWIDTHS 37445 . 41560) (CDPRINT.COLHEADERS 41562 . 42200) (
+CDPRINT.COLUMNS 42202 . 46081) (CDTEDIT 46083 . 46714)) (46717 55086 (CDMAP 46727 . 48159) (CDENTRY 
+48161 . 48470) (CDSUBSET 48472 . 49911) (CDMERGE 49913 . 53767) (CDMERGE.COMMON 53769 . 55084)) (55087
+ 62625 (BINCOMP 55097 . 59386) (EOLTYPE 59388 . 61950) (EOLTYPE.SHOW 61952 . 62623)) (63153 75680 (
+FIND-UNCOMPILED-FILES 63163 . 66806) (FIND-UNSOURCED-FILES 66808 . 69192) (FIND-SOURCE-FILES 69194 . 
+70932) (FIND-COMPILED-FILES 70934 . 72811) (FIND-UNLOADED-FILES 72813 . 73666) (FIND-LOADED-FILES 
+73668 . 74096) (FIND-MULTICOMPILED-FILES 74098 . 75678)) (75681 84112 (CREATED-AS 75691 . 80488) (
+SOURCE-FOR-COMPILED-P 80490 . 83417) (COMPILE-SOURCE-DATE-DIFF 83419 . 84110)) (84113 94419 (
+FIX-DIRECTORY-DATES 84123 . 87116) (FIX-EQUIV-DATES 87118 . 88643) (COPY-COMPARED-FILES 88645 . 90466)
+ (COPY-MISSING-FILES 90468 . 92625) (COMPILED-ON-SAME-SOURCE 92627 . 94417)) (94613 101959 (CDBROWSER 
+94623 . 98550) (CDBROWSER.STRINGS 98552 . 101957)) (102121 103857 (CD.TABLEITEM 102131 . 102351) (
+CD.TABLEITEM.PRINTFN 102353 . 102552) (CD.TABLEITEM.COPYFN 102554 . 103612) (
+CDTABLEBROWSER.HEADING.REPAINTFN 103614 . 103855)) (103858 123102 (CDTABLEBROWSER.WHENSELECTEDFN 
+103868 . 104336) (CD.COMMANDSELECTEDFN 104338 . 109439) (CD-MENUFN 109441 . 115804) (CDBROWSER-COPY 
+115806 . 119366) (CDBROWSER-DELETE-FILE 119368 . 122581) (CD-SWAPDIRS 122583 . 123100)))))
 STOP
diff --git a/lispusers/COMPAREDIRECTORIES.LCOM b/lispusers/COMPAREDIRECTORIES.LCOM
index 82e57c68..a7116590 100644
Binary files a/lispusers/COMPAREDIRECTORIES.LCOM and b/lispusers/COMPAREDIRECTORIES.LCOM differ
diff --git a/lispusers/COMPARESOURCES b/lispusers/COMPARESOURCES
index c38bd452..c6fd3d9c 100644
--- a/lispusers/COMPARESOURCES
+++ b/lispusers/COMPARESOURCES
@@ -1,13 +1,12 @@
 (DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10)
 
-(FILECREATED "25-Feb-2022 18:02:24" 
-{DSK}<Users>kaplan>Local>medley3.5>my-medley>lispusers>COMPARESOURCES.;121 41359  
+(FILECREATED "12-May-2022 10:17:13" 
+{DSK}<Users>kaplan>Local>medley3.5>my-medley>lispusers>COMPARESOURCES.;123 41825  
 
-      :CHANGES-TO (FNS \CS.COMPARE.MASTERS \CS.COMPARE.TYPES \CS.REC.NAME \CS.ISRECFORM)
-                  (VARS COMPARESOURCETYPES COMPARESOURCESCOMS)
+      :CHANGES-TO (FNS CSBROWSER)
 
-      :PREVIOUS-DATE "28-Jan-2022 18:22:40" 
-{DSK}<Users>kaplan>Local>medley3.5>my-medley>lispusers>COMPARESOURCES.;118)
+      :PREVIOUS-DATE "11-May-2022 19:12:38" 
+{DSK}<Users>kaplan>Local>medley3.5>my-medley>lispusers>COMPARESOURCES.;122)
 
 
 (* ; "
@@ -38,7 +37,8 @@ Copyright (c) 1985-1988, 2018, 2020-2021 by Xerox Corporation.
 (DEFINEQ
 
 (COMPARESOURCES
-  [LAMBDA (FILEX FILEY EXAMINE DW? LISTSTREAM)               (* ; "Edited 28-Jan-2022 17:10 by rmk")
+  [LAMBDA (FILEX FILEY EXAMINE DW? LISTSTREAM IGNORECOMMENTS)(* ; "Edited 11-May-2022 19:12 by rmk")
+                                                             (* ; "Edited 28-Jan-2022 17:10 by rmk")
                                                              (* ; "Edited 26-Dec-2021 21:32 by rmk")
                                                             (* ; "Edited 19-Apr-2018 10:49 by rmk:")
 
@@ -74,6 +74,11 @@ Copyright (c) 1985-1988, 2018, 2020-2021 by Xerox Corporation.
           (CL:MULTIPLE-VALUE-SETQ (BODYY ENVY)
                  (READFILE FILEY))
           (SETQ BODYY (\CS.FILTER.GARBAGE BODYY))
+          (CL:WHEN IGNORECOMMENTS
+              (LET ((*REMOVE-INTERLISP-COMMENTS* T))
+                   (DECLARE (SPECVARS *REMOVE-INTERLISP-COMMENTS*))
+                   (SETQ BODYX (REMOVE-COMMENTS BODYX))
+                   (SETQ BODYY (REMOVE-COMMENTS BODYY))))
           [SETQ DATECOL (PLUS 2 (CONSTANT (NCHARS "Comparing"))
                               (IMAX (NCHARS FILEX)
                                     (NCHARS FILEY]
@@ -629,7 +634,8 @@ Copyright (c) 1985-1988, 2018, 2020-2021 by Xerox Corporation.
 (DEFINEQ
 
 (CSBROWSER
-  [LAMBDA (FILEX FILEY DW? LABEL1 LABEL2 REGION)
+  [LAMBDA (FILEX FILEY DW? LABEL1 LABEL2 REGION IGNORECOMMENTS)
+                                                             (* ; "Edited 12-May-2022 10:16 by rmk")
 
     (* ;; "Edited 24-Jan-2022 23:11 by rmk: EXAMINE is non-NIL, we run the compare twice.  Once to get the TEDIT up as a kind of table of contents, and the second time to run through all of the SEDIT windows.")
 
@@ -640,12 +646,12 @@ Copyright (c) 1985-1988, 2018, 2020-2021 by Xerox Corporation.
     (* ;; "Don't use the INFILEP value, because that might screw with capitalization that the caller prefers.  If the file can be found that way, then lower functions will find it.")
 
     (DECLARE (SPECVARS LABEL1 LABEL2))
-    (OR (INFILEP FILEX)
-        (SETQ FILEX (FINDFILE FILEX NIL DIRECTORIES))
-        (ERROR "FILE NOT FOUND" FILEX))
-    (OR (INFILEP FILEY)
-        (SETQ FILEY (FINDFILE FILEY NIL DIRECTORIES))
-        (ERROR "FILE NOT FOUND" FILEY))
+    (SETQ FILEX (OR (INFILEP FILEX)
+                    (FINDFILE FILEX NIL DIRECTORIES)
+                    (ERROR "FILE NOT FOUND" FILEX)))
+    (SETQ FILEY (OR (INFILEP FILEY)
+                    (FINDFILE FILEY NIL DIRECTORIES)
+                    (ERROR "FILE NOT FOUND" FILEY)))
     (CL:UNLESS (LISPSOURCEFILEP FILEX)
            (ERROR FILEX " is not a Medley source file"))
     (CL:UNLESS (LISPSOURCEFILEP FILEY)
@@ -661,12 +667,12 @@ Copyright (c) 1985-1988, 2018, 2020-2021 by Xerox Corporation.
                                 (GETPROMPTWINDOW WINDOW T)
                                 (WINDOWPROP WINDOW 'UNDERSCONTRUCTION NIL)
                                 (COMPARESOURCES FILEX FILEY '(T 2WINDOWS)
-                                       DW? WINDOW)
+                                       DW? WINDOW IGNORECOMMENTS)
                                 (OPENW WINDOW)
                                 WINDOW))
              (TEDIT (LET ((TSTREAM (OPENTEXTSTREAM)))
                          (DSPFONT DEFAULTFONT TSTREAM)
-                         (COMPARESOURCES FILEX FILEY EXAMINE DW? TSTREAM)
+                         (COMPARESOURCES FILEX FILEY EXAMINE DW? TSTREAM IGNORECOMMENTS)
                          [TEDIT TSTREAM REGION NIL `(READONLY T WINDOWTYPE COMPARESOURCES-TEDIT TITLE
                                                            ,TITLE]
                          (CL:WHEN NIL
@@ -693,16 +699,16 @@ Copyright (c) 1985-1988, 2018, 2020-2021 by Xerox Corporation.
 )
 (PUTPROPS COMPARESOURCES COPYRIGHT ("Xerox Corporation" 1985 1986 1987 1988 2018 2020 2021))
 (DECLARE%: DONTCOPY
-  (FILEMAP (NIL (1970 26690 (COMPARESOURCES 1980 . 8026) (\CS.COMPARE.MASTERS 8028 . 15440) (
-\CS.COMPARE.TYPES 15442 . 18708) (\CS.EXAMINE 18710 . 22937) (\CS.FIXFNS 22939 . 24441) (
-\CS.SORT.DECLARES 24443 . 24786) (\CS.SORT.DECLARE1 24788 . 26208) (\CS.FILTER.GARBAGE 26210 . 26688))
- (26691 31227 (\CS.ISFNFORM 26701 . 26969) (\CS.COMPARE.FNS 26971 . 27213) (\CS.FNSID 27215 . 27359) (
-\CS.ISVARFORM 27361 . 27466) (\CS.COMPARE.VARS 27468 . 28130) (\CS.ISMACROFORM 28132 . 28270) (
-\CS.ISRECFORM 28272 . 28600) (\CS.REC.NAME 28602 . 28921) (\CS.ISCOURIERFORM 28923 . 29023) (
-\CS.ISTEMPLATEFORM 29025 . 29123) (\CS.COMPARE.TEMPLATES 29125 . 29490) (\CS.ISPROPFORM 29492 . 29647)
- (\CS.PROP.NAME 29649 . 29794) (\CS.COMPARE.PROPS 29796 . 29953) (\CS.ISADDVARFORM 29955 . 30048) (
-\CS.COMPARE.ADDVARS 30050 . 30215) (\CS.ISFPKGCOMFORM 30217 . 30424) (\CS.COMPARE.FPKGCOMS 30426 . 
-30633) (\CS.COMPARE.DEFINE-FILE-INFO 30635 . 31225)) (31228 37292 (CSOBJ.CREATE 31238 . 31651) (
-CSOBJ.DISPLAYFN 31653 . 32406) (CSOBJ.IMAGEBOXFN 32408 . 34569) (CSOBJ.BUTTONEVENTINFN 34571 . 37042) 
-(CSOBJ.COPYBUTTONEVENTINFN 37044 . 37290)) (38173 40877 (CSBROWSER 38183 . 40875)))))
+  (FILEMAP (NIL (1852 26954 (COMPARESOURCES 1862 . 8290) (\CS.COMPARE.MASTERS 8292 . 15704) (
+\CS.COMPARE.TYPES 15706 . 18972) (\CS.EXAMINE 18974 . 23201) (\CS.FIXFNS 23203 . 24705) (
+\CS.SORT.DECLARES 24707 . 25050) (\CS.SORT.DECLARE1 25052 . 26472) (\CS.FILTER.GARBAGE 26474 . 26952))
+ (26955 31491 (\CS.ISFNFORM 26965 . 27233) (\CS.COMPARE.FNS 27235 . 27477) (\CS.FNSID 27479 . 27623) (
+\CS.ISVARFORM 27625 . 27730) (\CS.COMPARE.VARS 27732 . 28394) (\CS.ISMACROFORM 28396 . 28534) (
+\CS.ISRECFORM 28536 . 28864) (\CS.REC.NAME 28866 . 29185) (\CS.ISCOURIERFORM 29187 . 29287) (
+\CS.ISTEMPLATEFORM 29289 . 29387) (\CS.COMPARE.TEMPLATES 29389 . 29754) (\CS.ISPROPFORM 29756 . 29911)
+ (\CS.PROP.NAME 29913 . 30058) (\CS.COMPARE.PROPS 30060 . 30217) (\CS.ISADDVARFORM 30219 . 30312) (
+\CS.COMPARE.ADDVARS 30314 . 30479) (\CS.ISFPKGCOMFORM 30481 . 30688) (\CS.COMPARE.FPKGCOMS 30690 . 
+30897) (\CS.COMPARE.DEFINE-FILE-INFO 30899 . 31489)) (31492 37556 (CSOBJ.CREATE 31502 . 31915) (
+CSOBJ.DISPLAYFN 31917 . 32670) (CSOBJ.IMAGEBOXFN 32672 . 34833) (CSOBJ.BUTTONEVENTINFN 34835 . 37306) 
+(CSOBJ.COPYBUTTONEVENTINFN 37308 . 37554)) (38437 41343 (CSBROWSER 38447 . 41341)))))
 STOP
diff --git a/lispusers/COMPARESOURCES.LCOM b/lispusers/COMPARESOURCES.LCOM
index a786c4ae..c04448fe 100644
Binary files a/lispusers/COMPARESOURCES.LCOM and b/lispusers/COMPARESOURCES.LCOM differ
diff --git a/lispusers/GITFNS b/lispusers/GITFNS
index 359938f0..b59f306f 100644
--- a/lispusers/GITFNS
+++ b/lispusers/GITFNS
@@ -1,11 +1,12 @@
 (DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10)
 
-(FILECREATED "29-Apr-2022 11:37:08" {DSK}<Users>kaplan>Local>medley3.5>my-medley>lispusers>GITFNS.;147 76981  
+(FILECREATED "13-May-2022 10:51:44" {DSK}<Users>kaplan>Local>medley3.5>my-medley>lispusers>GITFNS.;278 95386  
 
-      :CHANGES-TO (FNS GIT-PRC-MENU)
+      :CHANGES-TO (COMMANDS cdg cdw)
+                  (VARS GITFNSCOMS)
 
-      :PREVIOUS-DATE "29-Apr-2022 11:14:35" 
-{DSK}<Users>kaplan>Local>medley3.5>my-medley>lispusers>GITFNS.;146)
+      :PREVIOUS-DATE "13-May-2022 10:45:15" 
+{DSK}<Users>kaplan>Local>medley3.5>my-medley>lispusers>GITFNS.;277)
 
 
 (PRETTYCOMPRINT GITFNSCOMS)
@@ -14,38 +15,32 @@
        (
         (* ;; "Set up")
 
-        (FILES (SYSLOAD FROM VALUEOF LISPUSERSDIRECTORIES)
+        (FILES (SYSLOAD FROM LISPUSERS)
                COMPAREDIRECTORIES COMPARESOURCES COMPARETEXT PSEUDOHOSTS)
         
-        (* ;; "GITMEDLEYDIR and MYMEDLEYDIR collapse to MEDLEYDIR if not provided")
+        (* ;; "")
 
-        (INITVARS (GITMEDLEYDIR (SLASHIT (PACKFILENAME 'BODY (OR (UNIX-GETENV "GITMEDLEYDIR")
-                                                                 MEDLEYDIR)
-                                                'HOST
-                                                'UNIX)
-                                       T))
-               (MYMEDLEYDIR (UNSLASHIT (PACKFILENAME 'BODY (OR (AND (BOUNDP 'MYMEDLEYDIR)
-                                                                    MYMEDLEYDIR)
-                                                               (UNIX-GETENV "MYMEDLEYDIR")
-                                                               MEDLEYDIR)
-                                              'HOST
-                                              'DSK)
-                                   T))
-               (MYMEDLEYHOST 'MM)
-               (GITMEDLEYHOST 'GIT))
-        (INITVARS (GIT-IGNORE-FILES '(EXPORTS.ALL RDSYS RDSYS.LCOM))
-               (GIT-IGNORE-DIRECTORIES '(loadups patches tmp fontsold deleted clos cltl2))
-               (GIT-MERGE-COMPARES T))
-        (P (PSEUDOHOST MYMEDLEYHOST MYMEDLEYDIR)
-           (PSEUDOHOST GITMEDLEYHOST GITMEDLEYDIR))
-        (FNS GIT-CLONEP)
+        
+        (* ;; "GIT projects")
+
+        (COMS (FNS GIT-CLONEP GIT-MAKE-PROJECT GIT-GET-PROJECT GIT-PROJECT-PATH 
+                   FIND-ANCESTOR-DIRECTORY GIT-FIND-CLONE GIT-MAINBRANCH GIT-MAINBRANCH?)
+              (RECORDS GIT-PROJECT)
+              (INITVARS (GIT-DEFAULT-PROJECT 'MEDLEY)
+                     (GIT-PROJECTS NIL)))
+        (P (GIT-MAKE-PROJECT 'MEDLEY T T '(EXPORTS.ALL RDSYS RDSYS.LCOM loadups/ patches/ tmp/ 
+                                                 fontsold/ clos/ cltl2/)
+                  '(greetfiles scripts sources library lispusers))
+           (GIT-MAKE-PROJECT 'NOTECARDS T T '(online/))
+           (GIT-MAKE-PROJECT 'LOOPS T T))
         
         (* ;; "")
 
         
         (* ;; "Lisp exec commands")
 
-        (COMMANDS gmc bbc prc cob b?)
+        (INITVARS (GIT-MERGE-COMPARES T))
+        (COMMANDS gmc bbc prc cob b? cdg cdw)
         
         (* ;; "")
 
@@ -54,7 +49,7 @@
 
         (FNS ALLSUBDIRS MEDLEYSUBDIRS GITSUBDIRS)
         (FNS TOGIT FROMGIT GIT-DELETE-FILE MYMEDLEY-DELETE-FILES)
-        (FNS MYMEDLEYSUBDIR GITSUBDIR STRIPDIR STRIPHOST STRIPNAME)
+        (FNS MYMEDLEYSUBDIR GITSUBDIR STRIPDIR STRIPHOST STRIPNAME STRIPWHERE)
         (FNS GFILE4MFILE MFILE4GFILE GIT-REPO-FILENAME)
         
         (* ;; "")
@@ -62,16 +57,20 @@
         
         (* ;; "Git commands")
 
-        (FNS GIT-COMMIT GIT-PUSH GIT-PULL GIT-BRANCH-DIFF GIT-APPROVAL GIT-GET-FILE GIT-FILE-EXISTS?
+        (FNS GIT-COMMIT GIT-PUSH GIT-PULL GIT-APPROVAL GIT-GET-FILE GIT-FILE-EXISTS? 
              GIT-REMOTE-UPDATE GIT-REMOTE-ADD GIT-FILE-DATE)
         
+        (* ;; "Differences")
+
+        (FNS GIT-BRANCH-DIFF GIT-COMMIT-DIFFS GIT-BRANCH-RELATIONS)
+        
         (* ;; "")
 
         
         (* ;; "Branches")
 
         (FNS GIT-CHECKOUT GIT-WHICH-BRANCH GIT-MAKE-BRANCH GIT-BRANCHES GIT-BRANCH-EXISTS? 
-             GIT-PICK-BRANCH GIT-PRC-MENU GIT-PULL-REQUESTS GIT-BRANCH-RELATIONS)
+             GIT-PICK-BRANCH GIT-PRC-MENU GIT-PULL-REQUESTS)
         
         (* ;; "My branches")
 
@@ -105,65 +104,239 @@
 (* ;; "Set up")
 
 
-(FILESLOAD (SYSLOAD FROM VALUEOF LISPUSERSDIRECTORIES)
+(FILESLOAD (SYSLOAD FROM LISPUSERS)
        COMPAREDIRECTORIES COMPARESOURCES COMPARETEXT PSEUDOHOSTS)
 
 
 
-(* ;; "GITMEDLEYDIR and MYMEDLEYDIR collapse to MEDLEYDIR if not provided")
+(* ;; "")
 
 
-(RPAQ? GITMEDLEYDIR (SLASHIT (PACKFILENAME 'BODY (OR (UNIX-GETENV "GITMEDLEYDIR")
-                                                     MEDLEYDIR)
-                                    'HOST
-                                    'UNIX)
-                           T))
 
-(RPAQ? MYMEDLEYDIR (UNSLASHIT (PACKFILENAME 'BODY (OR (AND (BOUNDP 'MYMEDLEYDIR)
-                                                           MYMEDLEYDIR)
-                                                      (UNIX-GETENV "MYMEDLEYDIR")
-                                                      MEDLEYDIR)
-                                     'HOST
-                                     'DSK)
-                          T))
 
-(RPAQ? MYMEDLEYHOST 'MM)
+(* ;; "GIT projects")
 
-(RPAQ? GITMEDLEYHOST 'GIT)
-
-(RPAQ? GIT-IGNORE-FILES '(EXPORTS.ALL RDSYS RDSYS.LCOM))
-
-(RPAQ? GIT-IGNORE-DIRECTORIES '(loadups patches tmp fontsold deleted clos cltl2))
-
-(RPAQ? GIT-MERGE-COMPARES T)
-
-(PSEUDOHOST MYMEDLEYHOST MYMEDLEYDIR)
-
-(PSEUDOHOST GITMEDLEYHOST GITMEDLEYDIR)
 (DEFINEQ
 
 (GIT-CLONEP
-  [LAMBDA (HOST/DIR NOERROR)                                 (* ; "Edited  5-Feb-2022 11:35 by rmk")
+  [LAMBDA (HOST/DIR NOERROR CHECKANCESTORS)                  (* ; "Edited 12-May-2022 11:44 by rmk")
+                                                             (* ; "Edited  8-May-2022 16:24 by rmk")
 
-    (* ;; 
-    "Returns the canonical git pseudohost for HOST/DIR, NIL if it doesn't denote a git clone.  ")
+    (* ;; "If CHECKANCESTORS, looks back up the directory chain to see if perhaps the .git is somewhere higher up.")
 
-    (CL:UNLESS HOST/DIR
-        (SETQ HOST/DIR '{GIT}))
-    (CL:UNLESS (EQ (CHARCODE {)
-                   (CHCON1 HOST/DIR))
-        (SETQ HOST/DIR (CONCAT "{" HOST/DIR "}")))
-    (SETQ HOST/DIR (TRUEFILENAME HOST/DIR))
-    (CL:UNLESS (MEMB (NTHCHARCODE HOST/DIR -1)
-                     (CHARCODE (/ > < })))
-        (SETQ HOST/DIR (CONCAT HOST/DIR "/")))
-    (IF (DIRECTORYNAMEP (CONCAT HOST/DIR ".git/"))
-        THEN (PSEUDOFILENAME HOST/DIR)
+    (IF [AND HOST/DIR (LET ((D (SLASHIT (TRUEFILENAME (PACKFILENAME.STRING 'BODY HOST/DIR
+                                                             'HOST
+                                                             'DSK))
+                                      T)))
+                           (IF (DIRECTORYNAMEP (CONCAT D "/.git/"))
+                               THEN D
+                             ELSEIF (AND CHECKANCESTORS (FIND-ANCESTOR-DIRECTORY
+                                                         D
+                                                         (FUNCTION (LAMBDA (A)
+                                                                     (DIRECTORYNAMEP (CONCAT A 
+                                                                                            ".git/"]
       ELSEIF NOERROR
         THEN NIL
-      ELSE (ERROR (PSEUDOFILENAME HOST/DIR)
-                  "is not a git clone"])
+      ELSE (ERROR "NOT A GIT CLONE" HOST/DIR])
+
+(GIT-MAKE-PROJECT
+  [LAMBDA (PROJECTNAME PROJECTPATH WORKINGPATH EXCLUSIONS DEFAULTSUBDIRS)
+                                                             (* ; "Edited 13-May-2022 10:40 by rmk")
+                                                             (* ; "Edited 12-May-2022 00:26 by rmk")
+                                                             (* ; "Edited  9-May-2022 16:20 by rmk")
+
+    (* ;; "PROJECTPATH must resolve to a git clone.")
+
+    (* ;; "Search sequence for PROJECTPATH, if T or NIL")
+
+    (* ;; "    (UNIX-GETENV PROJECTNAME)")
+
+    (* ;; "    (UNIX-GETENV (CONCAT PROJECTNAME DIR)")
+
+    (* ;; "    git-PROJECTNAME sister of MEDLEYDIR ")
+
+    (* ;; "If not found, error if NIL, return NIL if T  ")
+
+    (* ;; "")
+
+    (* ;; "WORKINGPATH T or NIL means try to find a parallel to the projectpath, T means don't cause an error if not found. ")
+
+    (SETQ PROJECTNAME (U-CASE PROJECTNAME))
+    (CL:WHEN (MEMB PROJECTPATH '(NIL T))
+        [SETQ PROJECTPATH (OR (GIT-CLONEP (UNIX-GETENV PROJECTNAME)
+                                     T)
+                              (GIT-CLONEP (UNIX-GETENV (PACK* PROJECTNAME 'DIR))
+                                     T)
+                              (GIT-CLONEP (DIRECTORYNAME (CONCAT MEDLEYDIR "../git-" (L-CASE 
+                                                                                          PROJECTNAME
+                                                                                            )
+                                                                "/"))
+                                     T)
+                              (AND (NULL PROJECTPATH)
+                                   (ERROR (CONCAT "Can't a find clone directory for " PROJECTNAME])
+    (CL:WHEN PROJECTPATH
+        (LET (CLONEPATH GITIGNORE PROJECT GITPATH WP)
+             (SETQ PROJECTPATH (SLASHIT (PACKFILENAME 'HOST 'UNIX 'DIRECTORY (UNPACKFILENAME.STRING
+                                                                              (TRUEFILENAME 
+                                                                                     PROJECTPATH)
+                                                                              'DIRECTORY
+                                                                              'RETURN))
+                                      T))
+             (SETQ CLONEPATH (IF (GIT-CLONEP PROJECTPATH T T)
+                               ELSEIF (SETQ GITPATH (GIT-PROJECT-PATH PROJECTNAME PROJECTPATH))
+                                 THEN (SETQ PROJECTPATH GITPATH)
+                                      (GIT-CLONEP PROJECTPATH NIL T)
+                               ELSE (ERROR "Can't find GIT clone for" PROJECTPATH)))
+             (CL:WHEN (SETQ GITIGNORE (INFILEP (PACKFILENAME.STRING 'NAME ".gitignore" 'BODY 
+                                                      CLONEPATH)))
+                 (SETQ GITIGNORE (CL:WITH-OPEN-FILE (STREAM GITIGNORE)
+                                        (BIND L UNTIL (EOFP STREAM)
+                                           WHILE (SETQ L (CL:READ-LINE STREAM :EOF-ERROR-P NIL 
+                                                                :EOF-VALUE NIL))
+                                           UNLESS (OR (EQ 0 (NCHARS L))
+                                                      (STRPOS "#" L)) COLLECT L))))
+             (SETQ EXCLUSIONS (CL:REMOVE-DUPLICATES (APPEND (FOR E INSIDE EXCLUSIONS
+                                                               COLLECT (MKSTRING E))
+                                                           GITIGNORE
+                                                           `("deleted/" "*.sysout"))
+                                     :TEST
+                                     (FUNCTION STRING.EQUAL)))
+             [SETQ WP
+              (DIRECTORYNAME (SELECTQ WORKINGPATH
+                                 ((T NIL) 
+                                      (PACKFILENAME.STRING 'HOST 'DSK 'BODY
+                                             (CONCAT (SUBSTRING CLONEPATH 1
+                                                            (STRPOS "/" CLONEPATH -2 NIL NIL NIL 
+                                                                   FILEDIRCASEARRAY T))
+                                                    "my-"
+                                                    (OR (SUBSTRING PROJECTPATH
+                                                               (OR (STRPOS CLONEPATH PROJECTPATH 1 
+                                                                          NIL NIL T FILEDIRCASEARRAY)
+                                                                   -2))
+                                                        (L-CASE PROJECTNAME))
+                                                    ">")))
+                                 (TRUEFILENAME WORKINGPATH]
+             [SETQ WORKINGPATH (IF WP
+                                   THEN (UNSLASHIT WP T)
+                                 ELSEIF (EQ WORKINGPATH T)
+                                   THEN NIL
+                                 ELSE (ERROR (CONCAT "Can't find my working directory "
+                                                    (OR WORKINGPATH "")
+                                                    " for " PROJECTNAME]
+             (SETQ PROJECT (CREATE GIT-PROJECT
+                                  PROJECTNAME _ PROJECTNAME
+                                  GITHOST _ (PACK* "{" (PSEUDOHOST (CONCAT "G" PROJECTNAME)
+                                                              PROJECTPATH)
+                                                   "}")
+                                  WHOST _ (AND WORKINGPATH (PACK* "{" (PSEUDOHOST (CONCAT "W" 
+                                                                                         PROJECTNAME)
+                                                                             WP)
+                                                                  "}"))
+                                  EXCLUSIONS _ EXCLUSIONS
+                                  DEFAULTSUBDIRS _ (MKLIST DEFAULTSUBDIRS)
+                                  CLONEPATH _ CLONEPATH))
+             (REPLACE MAINBRANCH OF PROJECT WITH (OR (GIT-BRANCH-EXISTS? 'origin/main T PROJECT)
+                                                     (GIT-BRANCH-EXISTS? 'origin/master NIL PROJECT))
+                    )
+             (/RPLACD [OR (ASSOC PROJECTNAME GIT-PROJECTS)
+                          (CAR (PUSH GIT-PROJECTS (CONS PROJECTNAME]
+                    PROJECT)
+             PROJECTNAME))])
+
+(GIT-GET-PROJECT
+  [LAMBDA (PROJECT NOERROR FIELD)                            (* ; "Edited 13-May-2022 10:40 by rmk")
+                                                             (* ; "Edited  9-May-2022 20:02 by rmk")
+                                                             (* ; "Edited  8-May-2022 11:38 by rmk")
+    (CL:WHEN (SETQ PROJECT (IF (TYPE? GIT-PROJECT PROJECT)
+                               THEN PROJECT
+                             ELSEIF (CDR (ASSOC (OR (U-CASE PROJECT)
+                                                    GIT-DEFAULT-PROJECT)
+                                                GIT-PROJECTS))
+                             ELSEIF NOERROR
+                               THEN NIL
+                             ELSE (ERROR "NOT A GIT-PROJECT" PROJECT)))
+        (SELECTQ FIELD
+            (PROJECTNAME (FETCH PROJECTNAME OF PROJECT))
+            (WHOST (FETCH WHOST OF PROJECT))
+            (GITHOST (FETCH GITHOST OF PROJECT))
+            (EXCLUSIONS (FETCH EXCLUSIONS OF PROJECT))
+            (DEFAULTSUBDIRS 
+                 (FETCH DEFAULTSUBDIRS OF PROJECT))
+            (CLONEPATH (FETCH CLONEPATH OF PROJECT))
+            (MAINBRANCH (FETCH MAINBRANCH OF PROJECT))
+            PROJECT))])
+
+(GIT-PROJECT-PATH
+  [LAMBDA (PROJECTNAME PROJECTPATH)                          (* ; "Edited  8-May-2022 15:10 by rmk")
+
+    (* ;; "A project path must identify a clone.  But it may be that a working path (with the convention %"my-%" is given instead of a %"git-%".  So, this does a my- to git- string substitution, so that we can try again.  Essentially a string-subst of /git-xxx/ for /my-xxx/ ")
+
+    (SETQ PROJECTPATH (TRUEFILENAME PROJECTPATH))
+    (CL:UNLESS (MEMB (NTHCHARCODE PROJECTPATH -1)
+                     (CHARCODE (> /)))
+        (SETQ PROJECTPATH (CONCAT PROJECTPATH "/")))
+    (LET (MY-POS (MYSUBDIR (CONCAT "/my-" PROJECTNAME "/")))
+         (CL:WHEN (SETQ MY-POS (STRPOS MYSUBDIR PROJECTPATH 1 NIL NIL NIL FILEDIRCASEARRAY))
+             (SLASHIT [CONCAT (SUBSTRING PROJECTPATH 1 MY-POS)
+                             "git-" PROJECTNAME (SUBSTRING PROJECTPATH (IPLUS -1 MY-POS (NCHARS
+                                                                                         MYSUBDIR]
+                    T))])
+
+(FIND-ANCESTOR-DIRECTORY
+  [LAMBDA (STARTDIR PREDFN)                                  (* ; "Edited  8-May-2022 12:17 by rmk")
+    (BIND POS (A _ STARTDIR) WHILE (SETQ POS (STRPOS "/" A -2 NIL NIL NIL FILEDIRCASEARRAY T))
+       DO (SETQ A (SUBSTRING A 1 POS))
+          (CL:WHEN (APPLY* PREDFN A)
+                 (RETURN A])
+
+(GIT-FIND-CLONE
+  [LAMBDA (PROJECTNAME PROJECTPATH)                          (* ; "Edited  8-May-2022 15:00 by rmk")
+
+    (* ;; "Maybe the PROJECTPATH was actually a MY path, in which case our best guess is that the git-clone is a sister somewhere above. ")
+
+    (OR (GIT-CLONEP PROJECTPATH T T)
+        (GIT-CLONEP (GIT-PROJECT-PATH PROJECTNAME PROJECTPATH)
+               T T)
+        [FIND-ANCESTOR-DIRECTORY PROJECTPATH (FUNCTION (LAMBDA (A)
+                                                         (BIND D (GEN _ (\GENERATEFILES A NIL NIL 1))
+                                                            WHILE (SETQ D (\GENERATENEXTFILE GEN))
+                                                            WHEN (GIT-CLONEP D T)
+                                                            DO (RETFROM (FUNCTION 
+                                                                         FIND-ANCESTOR-DIRECTORY)
+                                                                      D]
+        (ERROR "NOT A GIT CLONE" PROJECTPATH])
+
+(GIT-MAINBRANCH
+  [LAMBDA (PROJECT LOCAL NOERROR)                            (* ; "Edited  9-May-2022 16:34 by rmk")
+    (LET [(MB (GIT-GET-PROJECT PROJECT NOERROR 'MAINBRANCH]
+         (CL:IF LOCAL
+             (CONCAT "local/" (STRIPWHERE MB))
+             MB)])
+
+(GIT-MAINBRANCH?
+  [LAMBDA (BRANCH PROJECT NOERROR)                           (* ; "Edited  9-May-2022 15:06 by rmk")
+    (IF (STRING.EQUAL (STRIPWHERE (GIT-MAINBRANCH PROJECT NIL T))
+               (STRIPWHERE BRANCH))
+      ELSEIF NOERROR
+        THEN NIL
+      ELSE (ERROR "Can't modify main branch" BRANCH])
 )
+(DECLARE%: EVAL@COMPILE
+
+(TYPERECORD GIT-PROJECT (PROJECTNAME GITHOST WHOST EXCLUSIONS DEFAULTSUBDIRS CLONEPATH MAINBRANCH))
+)
+
+(RPAQ? GIT-DEFAULT-PROJECT 'MEDLEY)
+
+(RPAQ? GIT-PROJECTS NIL)
+
+(GIT-MAKE-PROJECT 'MEDLEY T T '(EXPORTS.ALL RDSYS RDSYS.LCOM loadups/ patches/ tmp/ fontsold/ clos/ 
+                                      cltl2/)
+       '(greetfiles scripts sources library lispusers))
+
+(GIT-MAKE-PROJECT 'NOTECARDS T T '(online/))
+
+(GIT-MAKE-PROJECT 'LOOPS T T)
 
 
 
@@ -175,47 +348,97 @@
 (* ;; "Lisp exec commands")
 
 
+(RPAQ? GIT-MERGE-COMPARES T)
+
 (DEFCOMMAND gmc (SUBDIR . OTHERS)
 
-   (* ;; "Compares the specified local git-medley subdirectories against my working Medley.  ")
+   (* ;; "Compares the specified local git-medley subdirectories against my working Medley.  The SUBDIRS are the arguments up to one that looks like a project")
 
-    (GIT-COMPARE-WITH-MYMEDLEY (AND SUBDIR (CONS SUBDIR OTHERS))
-           NIL NIL NIL NIL T))
+    (LET ((SUBDIRS (AND SUBDIR (CONS SUBDIR OTHERS)))
+          PROJECT)
+         (SETQ SUBDIRS (FOR STAIL ON SUBDIRS COLLECT (IF (GIT-GET-PROJECT (CAR STAIL)
+                                                                T)
+                                                         THEN (SETQ PROJECT (CAR STAIL))
+                                                              (GO $$OUT))
+                                                   (CAR STAIL)))
+         (GIT-COMPARE-WITH-MYMEDLEY SUBDIRS NIL NIL NIL T PROJECT)))
 
-(DEFCOMMAND bbc (BRANCH1 BRANCH2 LOCAL)
+(DEFCOMMAND bbc (BRANCH1 BRANCH2 LOCAL PROJECT)
 
-   (* ;; "Compares 2 git branches.  Defaults to local/ if LOCAL, otherwise defaults to origin/.  BRANCH2 defaults to master (origin/ or local/ depending on LOCAL)")
+   (* ;; "Compares 2 git branches.  Defaults to local/ if LOCAL, otherwise defaults to origin/.  BRANCH2 defaults to the main branch (origin/ or local/ depending on LOCAL)")
 
-    (GIT-COMPARE-BRANCHES BRANCH1 BRANCH2 LOCAL))
+    (SETQ PROJECT (GIT-GET-PROJECT PROJECT))
+   (GIT-COMPARE-BRANCHES BRANCH1 (OR BRANCH (GIT-MAINBRANCH PROJECT LOCAL))
+          LOCAL PROJECT))
 
-(DEFCOMMAND prc (REMOTEBRANCH DRAFTS)
+(DEFCOMMAND prc (REMOTEBRANCH DRAFTS PROJECT)
 
-   (* ;; "Compares REMOTEBRANCH against origin/master, for pull-request assessment")
+   (* ;; "Compares REMOTEBRANCH against the main orign branch, for pull-request assessment")
 
     (LET ((RB REMOTEBRANCH)
           (DR DRAFTS))
+         (IF PROJECT
+             THEN (SETQ PROOJECT (GIT-GET-PROJECT PROJECT))
+           ELSEIF (GIT-GET-PROJECT RB T)
+             THEN (SETQ PROJECT RB)
+                  (SETQ RB NIL)
+           ELSEIF (GIT-GET-PROJECT DRAFTS T)
+             THEN (SETQ PROJECT DRAFTS)
+                  (SETQ DRAFTS NIL))
          (CL:WHEN (MEMB (U-CASE RB)
                         '(DRAFT DRAFTS))
              (SETQ RB NIL)
              (SETQ DR T))
-         (IF RB
-             THEN (GIT-COMPARE-BRANCHES RB 'origin/master)
-           ELSE (GIT-COMPARE-BRANCHES (GIT-PICK-BRANCH (OR (GIT-PRC-MENU DR)
-                                                           'REMOTE)
-                                             "Pull requests")
-                       'origin/master NIL))))
+         (CL:WHEN (OR RB (SETQ RB (GIT-PICK-BRANCH (GIT-PRC-MENU DR PROJECT)
+                                         "Pull requests" NIL PROJECT)))
+             (GIT-COMPARE-BRANCHES RB (GIT-MAINBRANCH PROJECT)
+                    NIL PROJECT))))
 
-(DEFCOMMAND cob (BRANCH)
+(DEFCOMMAND cob (BRANCH PROJECT)
 
    (* ;; "Switches to BRANCH. T means my current branch, NEW/NEXT means my next branch (under wherever we are now).  Default is to bring up a menu of locally available branches.")
 
-    [SELECTQ (U-CASE BRANCH)
-        (T (GIT-CHECKOUT (GIT-MY-CURRENT-BRANCH)))
-        ((NEW NEXT) 
-             (GIT-MAKE-BRANCH))
-        (GIT-CHECKOUT (OR BRANCH (GIT-PICK-BRANCH NIL "Branches" 'LOCAL])
+    (CL:UNLESS PROJECT
+        (CL:WHEN (GIT-GET-PROJECT BRANCH T)
+            (SETQ PROJECT BRANCH)
+            (SETQ BRANCH NIL)))
+   (SETQ PROJECT (GIT-GET-PROJECT PROJECT))
+   (SELECTQ (U-CASE BRANCH)
+       (T (GIT-CHECKOUT (GIT-MY-CURRENT-BRANCH PROJECT)
+                 PROJECT))
+       ((NEW NEXT) 
+            (GIT-MAKE-BRANCH NIL NIL PROJECT))
+       (GIT-CHECKOUT (OR BRANCH (GIT-PICK-BRANCH NIL (CONCAT (L-CASE (FETCH PROJECTNAME OF PROJECT)
+                                                                    T)
+                                                            " branches")
+                                       'LOCAL PROJECT))
+              PROJECT)))
 
-(DEFCOMMAND b? (BRANCH) (GIT-WHICH-BRANCH))
+(DEFCOMMAND b? (PROJECT) (SETQ PROJECT (GIT-GET-PROJECT PROJECT))
+   (CONCAT (L-CASE (FETCH PROJECTNAME OF PROJECT)
+                  T)
+          " "
+          (GIT-WHICH-BRANCH PROJECT)))
+
+(DEFCOMMAND cdg (PROJECT SUBDIR) (CL:UNLESS (GIT-GET-PROJECT PROJECT T 'GHOST)
+                                     (SETQ SUBDIR PROJECT)
+                                     (SETQ PROJECT GIT-DEFAULT-PROJECT))
+   (CL:WHEN [AND SUBDIR (NOT (MEMB (CHCON1 SUBDIR))
+                             (CHARCODE (> /]
+       (SETQ SUBDIR (CONCAT SUBDIR "/")))
+   (SLASHIT (/CNDIR (CONCAT (TRUEFILENAME (GIT-GET-PROJECT PROJECT NIL 'GITHOST))
+                           (OR SUBDIR "")))
+          T))
+
+(DEFCOMMAND cdw (PROJECT SUBDIR) (CL:UNLESS (GIT-GET-PROJECT PROJECT T)
+                                     (SETQ SUBDIR PROJECT)
+                                     (SETQ PROJECT GIT-DEFAULT-PROJECT))
+   (CL:WHEN [AND SUBDIR (NOT (MEMB (CHCON1 SUBDIR))
+                             (CHARCODE (> /]
+       (SETQ SUBDIR (CONCAT SUBDIR "/")))
+   (SLASHIT (/CNDIR (CONCAT (TRUEFILENAME (GIT-GET-PROJECT PROJECT NIL 'WHOST))
+                           (OR SUBDIR "")))
+          T))
 
 
 
@@ -229,89 +452,104 @@
 (DEFINEQ
 
 (ALLSUBDIRS
-  [LAMBDA (HOST1 HOST2)
+  [LAMBDA (PROJECT)
+
+    (* ;; "Edited 13-May-2022 10:40 by rmk")
+
+    (* ;; "Edited 10-May-2022 00:16 by rmk")
 
     (* ;; 
-    "Edited  5-Mar-2022 09:42 by rmk: the union of the subdirectories that exist under all the hosts")
+    "Edited  7-May-2022 16:58 by rmk: the union of the subdirectories that exist in the project")
 
-    (* ;; "Returns the union of the subdirectories that exist under all the hosts")
-
-    (LET ((HOSTS (MKLIST HOST1))
+    (LET ((HOSTS (MKLIST (FETCH GITHOST OF PROJECT)))
           VAL)
-         (CL:WHEN HOST2 (PUSHNEW HOSTS HOST2))
-         (CL:UNLESS HOSTS
-             (SETQ HOSTS (LIST MYMEDLEYHOST GITMEDLEYHOST)))
+         (CL:WHEN (FETCH WHOST OF PROJECT)
+             (PUSHNEW HOSTS (FETCH WHOST OF PROJECT)))
          (SORT (FOR H VAL IN HOSTS
-                  JOIN (FOR F IN (FILDIR (PACKFILENAME 'HOST H 'BODY '*)
-                                        1) WHEN (DIRECTORYNAMEP F)
+                  JOIN (FOR F D IN (FILDIR (PACKFILENAME 'HOST H 'BODY '*)
+                                          1) WHEN (DIRECTORYNAMEP F)
                           UNLESS (OR [EQ (CHARCODE %.)
                                          (CHCON1 (SETQ D (FILENAMEFIELD F 'DIRECTORY]
-                                     (THEREIS SKIP IN GIT-IGNORE-DIRECTORIES
+                                     (THEREIS SKIP IN (FETCH EXCLUSIONS OF PROJECT)
+                                        FIRST (SETQ D (CONCAT D "/"))
                                         SUCHTHAT (STRPOS SKIP D 1 NIL T NIL FILEDIRCASEARRAY)))
-                          DO (SETQ D (UNSLASHIT (L-CASE D)))
+                          DO [SETQ D (UNSLASHIT (L-CASE (SUBSTRING D 1 -2]
                              (CL:UNLESS (MEMBER D VAL)
                                     (PUSH VAL D))) FINALLY (RETURN VAL])
 
 (MEDLEYSUBDIRS
-  [LAMBDA (MEDLEYHOST ALLSUBDIRS)                            (* ; "Edited  4-Feb-2022 18:06 by rmk")
-    (CL:UNLESS MEDLEYHOST (SETQ MEDLEYHOST MYMEDLEYHOST))
-    (FOR D IN (OR ALLSUBDIRS (ALLSUBDIRS)) COLLECT (UNSLASHIT (PACKFILENAME 'HOST MEDLEYHOST
-                                                                     'DIRECTORY D)
-                                                          T])
+  [LAMBDA (PROJECT ALLSUBDIRS)                               (* ; "Edited 13-May-2022 10:40 by rmk")
+                                                             (* ; "Edited  7-May-2022 23:15 by rmk")
+    (FOR D IN (OR ALLSUBDIRS (ALLSUBDIRS PROJECT)) COLLECT (UNSLASHIT (PACKFILENAME 'HOST
+                                                                             (FETCH WHOST
+                                                                                OF PROJECT)
+                                                                             'DIRECTORY D)
+                                                                  T])
 
 (GITSUBDIRS
-  [LAMBDA (GITHOST ALLSUBDIRS)                               (* ; "Edited  4-Feb-2022 18:06 by rmk")
-    (CL:UNLESS GITHOST (SETQ GITHOST GITMEDLEYHOST))
-    (FOR D IN (OR ALLSUBDIRS (ALLSUBDIRS)) COLLECT (SLASHIT (PACKFILENAME 'HOST GITHOST 'DIRECTORY D)
-                                                          T])
+  [LAMBDA (PROJECT ALLSUBDIRS)                               (* ; "Edited 10-May-2022 00:23 by rmk")
+                                                             (* ; "Edited  7-May-2022 23:14 by rmk")
+                                                             (* ; "Edited  4-Feb-2022 18:06 by rmk")
+    (FOR D IN (OR ALLSUBDIRS (ALLSUBDIRS PROJECT)) COLLECT (SLASHIT (PACKFILENAME 'HOST
+                                                                           (FETCH GITHOST
+                                                                              OF PROJECT)
+                                                                           'DIRECTORY D)
+                                                                  T])
 )
 (DEFINEQ
 
 (TOGIT
-  [LAMBDA (MFILES)                                           (* ; "Edited  4-Feb-2022 18:08 by rmk")
-                                                             (* ; "Edited  2-Feb-2022 18:56 by rmk")
-                                                             (* ; "Edited 19-Jan-2022 23:35 by rmk")
-                                                             (* ; "Edited 18-Jan-2022 16:33 by rmk")
-                                                             (* ; "Edited 13-Jan-2022 15:47 by rmk")
+  [LAMBDA (MFILES PROJECT)                                   (* ; "Edited 10-May-2022 10:45 by rmk")
+                                                             (* ; "Edited  7-May-2022 23:15 by rmk")
+
+    (* ;; "Does anybody call this?")
+
+    (SETQ PROJECT (GIT-GET-PROJECT PROJECT))
 
     (* ;; "Copies MFILES to {GIT}. We do a sanity check to make sure particular MFILE is the latest version--we may have created another one without revising the directory browser.")
 
-    (CL:WHEN (STRPOS "master" (GIT-WHICH-BRANCH))
-           (ERROR "Can't copy to the master branch"))
-    (FOR MF GF DEST INSIDE MFILES COLLECT (SETQ MF (OR (FINDFILE MF NIL (MEDLEYSUBDIRS))
-                                                       (ERROR "FILE NOT FOUND" MF)))
-                                        (CL:UNLESS (STRING.EQUAL MF (INFILEP (PACKFILENAME
-                                                                              'VERSION NIL
-                                                                              'BODY MF))
-                                                          FILEDIRCASEARRAY)
-                                            (FLASHWINDOW T)
-                                            (PRIN3 (CONCAT MF " is not the latest version!")
-                                                   T)
-                                            (ERROR!))
-                                        (SETQ GF (GFILE4MFILE MF))
-                                        (PRIN3 (IF (SETQ DEST (COPYFILE MF GF))
-                                                   THEN (CONCAT "Copied to " GF)
-                                                 ELSE (FLASHWINDOW T)
-                                                      (CONCAT MF " cannot be copied"))
-                                               T)
-                                        DEST])
+    (GIT-MAINBRANCH? (GIT-WHICH-BRANCH PROJECT)
+           PROJECT)
+    (FOR MF GF DEST (MEDLEYSUBDIRS _ (MEDLEYSUBDIRS PROJECT)) INSIDE MFILES
+       COLLECT (SETQ MF (OR (FINDFILE MF NIL MEDLEYSUBDIRS)
+                            (ERROR "FILE NOT FOUND" MF)))
+             (CL:UNLESS (STRING.EQUAL MF (INFILEP (PACKFILENAME 'VERSION NIL 'BODY MF))
+                               FILEDIRCASEARRAY)
+                 (FLASHWINDOW T)
+                 (PRIN3 (CONCAT MF " is not the latest version!")
+                        T)
+                 (ERROR!))
+             (SETQ GF (GFILE4MFILE MF PROJECT))
+             (PRIN3 (IF (SETQ DEST (COPYFILE MF GF))
+                        THEN (CONCAT "Copied to " GF)
+                      ELSE (FLASHWINDOW T)
+                           (CONCAT MF " cannot be copied"))
+                    T)
+             DEST])
 
 (FROMGIT
-  [LAMBDA (GFILES)                                           (* ; "Edited  4-Feb-2022 18:08 by rmk")
+  [LAMBDA (GFILES PROJECT)                                   (* ; "Edited 10-May-2022 10:45 by rmk")
+                                                             (* ; "Edited  4-Feb-2022 18:08 by rmk")
                                                              (* ; "Edited 18-Jan-2022 16:31 by rmk")
-    (FOR GF MF DEST INSIDE GFILES COLLECT (SETQ GF (OR (FINDFILE GF NIL (GITSUBDIRS))
-                                                       (ERROR "FILE NOT FOUND" GF)))
-                                        (SETQ MF (MFILE4GFILE GF))
-                                        (PRIN3 (IF (SETQ DEST (COPYFILE GF MF))
-                                                   THEN (CONCAT "Copied to " DEST)
-                                                        DEST
-                                                 ELSE (FLASHWINDOW T)
-                                                      (CONCAT GF " cannot be copied"))
-                                               T)
-                                        DEST])
+
+    (* ;; "Does anybody call this?")
+
+    (SETQ PROJECT (GIT-GET-PROJECT PROJECT))
+    (FOR GF MF DEST (GITSUBDIRS _ (GITSUBDIRS PROJECT)) INSIDE GFILES
+       COLLECT (SETQ GF (OR (FINDFILE GF NIL GITSUBDIRS)
+                            (ERROR "FILE NOT FOUND" GF)))
+             (SETQ MF (MFILE4GFILE GF))
+             (PRIN3 (IF (SETQ DEST (COPYFILE GF MF))
+                        THEN (CONCAT "Copied to " DEST)
+                             DEST
+                      ELSE (FLASHWINDOW T)
+                           (CONCAT GF " cannot be copied"))
+                    T)
+             DEST])
 
 (GIT-DELETE-FILE
-  [LAMBDA (FILE)                                             (* ; "Edited 18-Jan-2022 23:07 by rmk")
+  [LAMBDA (FILE PROJECT)                                     (* ; "Edited  8-May-2022 09:27 by rmk")
+                                                             (* ; "Edited 18-Jan-2022 23:07 by rmk")
                                                              (* ; "Edited 19-Dec-2021 16:11 by rmk")
                                                              (* ; "Edited 16-Dec-2021 13:00 by rmk")
 
@@ -321,21 +559,21 @@
 
     (* ;; "We could make this undoable by copying it to deleted/, but git also can restore.")
 
-    (CL:UNLESS (OR (EQ GITMEDLEYHOST (FILENAMEFIELD FILE 'HOST))
-                   (STRPOS GITMEDLEYDIR FILE 1 NIL T NIL FILEDIRCASEARRAY))
-           (ERROR "NOT A GIT-CLONE FILE" FILE))
+    (GIT-CLONEP FILE NIL T)
     (DELFILE FILE])
 
 (MYMEDLEY-DELETE-FILES
-  [LAMBDA (FILE)                                             (* ; "Edited 18-Jan-2022 23:02 by rmk")
-                                                             (* ; "Edited 19-Dec-2021 23:33 by rmk")
+  [LAMBDA (FILE PROJECT)                                     (* ; "Edited 13-May-2022 10:40 by rmk")
+                                                             (* ; "Edited  8-May-2022 23:31 by rmk")
 
     (* ;; "FILE is presumably the latest version of a file in the MyMedley directory, and we are presumably removing all versions of that file.  If we left older versions, we would really trash ourselves.")
 
     (* ;; "But to guard against mistakes, %"deletion%" consists of moving all versions of the file from its current location to a deleted/ subdirectory of MEDLEYDIR, one that does not correspond to a git subdirectory.")
 
-    (SETQ FILE (CONTRACT.PH FILE MYMEDLEYHOST))
-    (CL:WHEN (EQ MYMEDLEYHOST (FILENAMEFIELD FILE 'HOST))
+    (SETQ FILE (CONTRACT.PH FILE (FETCH WHOST OF PROJECT)))
+    (CL:WHEN (EQ (FILENAMEFIELD (FETCH WHOST OF PROJECT)
+                        'HOST)
+                 (FILENAMEFIELD FILE 'HOST))
         (FOR F IN (DREVERSE (FILDIR (PACKFILENAME 'VERSION '* 'BODY FILE)))
            COLLECT 
 
@@ -352,17 +590,18 @@
 (DEFINEQ
 
 (MYMEDLEYSUBDIR
-  [LAMBDA (SUBDIR STAR HOST)                                 (* ; "Edited 26-Feb-2022 11:57 by rmk")
-                                                             (* ; "Edited 21-Jan-2022 15:18 by rmk")
-    (UNSLASHIT (PACK* (PACKFILENAME 'HOST (OR HOST MYMEDLEYHOST)
+  [LAMBDA (SUBDIR STAR PROJECT)                              (* ; "Edited 13-May-2022 10:40 by rmk")
+                                                             (* ; "Edited  7-May-2022 23:15 by rmk")
+    (UNSLASHIT (PACK* (PACKFILENAME 'HOST (FETCH WHOST OF PROJECT)
                              'DIRECTORY SUBDIR)
                       (CL:IF STAR
                           "*"
                           "")])
 
 (GITSUBDIR
-  [LAMBDA (SUBDIR STAR HOST)                                 (* ; "Edited 26-Feb-2022 11:56 by rmk")
-    (SLASHIT (PACK* (PACKFILENAME 'HOST (OR HOST GITMEDLEYHOST)
+  [LAMBDA (SUBDIR STAR PROJECT)                              (* ; "Edited  7-May-2022 20:39 by rmk")
+                                                             (* ; "Edited 26-Feb-2022 11:56 by rmk")
+    (SLASHIT (PACK* (PACKFILENAME 'HOST (FETCH GITHOST OF PROJECT)
                            'DIRECTORY SUBDIR)
                     (CL:IF STAR
                         "*"
@@ -376,7 +615,7 @@
       ELSE FILE])
 
 (STRIPHOST
-  [LAMBDA (NAME)                                             (* ; "Edited 18-Jan-2022 15:37 by rmk")
+  [LAMBDA (NAME)                                             (* ; "Edited 18-Jan-2022 15:37 by rmk")
     (LET ((POS (STRPOS "}" NAME)))
          (CL:IF POS
              (SUBSTRING NAME (ADD1 POS))
@@ -396,30 +635,41 @@
                                                       (SUBSTRING FILE 1 LASTDIRPOS)
                                                       FILE)))
                                      NIL])
+
+(STRIPWHERE
+  [LAMBDA (BRANCH)                                           (* ; "Edited  9-May-2022 14:31 by rmk")
+    (LET ((POS (STRPOS "/" BRANCH)))
+         (CL:IF POS
+             (SUBSTRING BRANCH (ADD1 POS))
+             BRANCH)])
 )
 (DEFINEQ
 
 (GFILE4MFILE
-  [LAMBDA (MFILE GITHOST)                                    (* ; "Edited  4-Feb-2022 18:04 by rmk")
-    (SLASHIT (PACKFILENAME 'HOST (OR GITHOST GITMEDLEYHOST)
+  [LAMBDA (MFILE PROJECT)                                    (* ; "Edited  7-May-2022 23:19 by rmk")
+                                                             (* ; "Edited  4-Feb-2022 18:04 by rmk")
+    (SLASHIT (PACKFILENAME 'HOST (FETCH GITHOST OF PROJECT)
                     'VERSION NIL 'BODY MFILE)
            T])
 
 (MFILE4GFILE
-  [LAMBDA (GFILE MHOST)                                      (* ; "Edited  4-Feb-2022 18:04 by rmk")
+  [LAMBDA (GFILE PROJECT)                                    (* ; "Edited 13-May-2022 10:40 by rmk")
+                                                             (* ; "Edited  7-May-2022 23:20 by rmk")
+                                                             (* ; "Edited  4-Feb-2022 18:04 by rmk")
                                                              (* ; "Edited 18-Jan-2022 15:24 by rmk")
-    (UNSLASHIT (PACKFILENAME 'HOST (OR MHOST MYMEDLEYHOST)
+    (UNSLASHIT (PACKFILENAME 'HOST (FETCH WHOST OF PROJECT)
                       'VERSION NIL 'BODY GFILE])
 
 (GIT-REPO-FILENAME
-  [LAMBDA (GFILE)                                            (* ; "Edited 26-Feb-2022 12:25 by rmk")
-                                                             (* ; "Edited 18-Jan-2022 15:42 by rmk")
+  [LAMBDA (GFILE PROJECT)                                    (* ; "Edited  8-May-2022 23:35 by rmk")
 
-    (* ;; "Returns the string that the repo expects for a file name.  {GIT} or GITMEDLEYDIR is stripped, brackets go to slashes, subdirectories are lower cased, an initial / and a final period is remove.")
+    (* ;; "Returns the string that the repo expects for a file name.  The prefix is stripped, brackets go to slashes, subdirectories are lower cased, an initial / and a final period is remove.")
 
-    (SETQ GFILE (SLASHIT (IF (EQ GITMEDLEYHOST (FILENAMEFIELD GFILE 'HOST))
+    (SETQ GFILE (SLASHIT [IF (EQ (FILENAMEFIELD (FETCH GITHOST OF PROJECT)
+                                        'HOST)
+                                 (FILENAMEFIELD GFILE 'HOST))
                              THEN (STRIPHOST GFILE)
-                           ELSE (STRIPDIR GFILE GITMEDLEYDIR))
+                           ELSE (STRIPDIR GFILE (TRUEFILENAME (FETCH GITHOST OF PROJECT]
                        T))
     (CL:WHEN (EQ (CHARCODE /)
                  (CHCON1 GFILE))
@@ -442,51 +692,171 @@
 (DEFINEQ
 
 (GIT-COMMIT
-  [LAMBDA (FILES TITLE MESSAGE)                             (* ; "Edited 16-Nov-2021 08:06 by rmk:")
+  [LAMBDA (FILES TITLE MESSAGE PROJECT)                      (* ; "Edited  9-May-2022 16:11 by rmk")
+                                                            (* ; "Edited 16-Nov-2021 08:06 by rmk:")
                                                             (* ; "Edited  2-Nov-2021 21:26 by rmk:")
 
-    (* ;; "Commits files that are already in the (non-master) current git branch.")
+    (* ;; "Commits files that are already in the (non-main) current git branch.")
 
-    (CL:WHEN (STREQUAL (GIT-WHICH-BRANCH)
-                    "master")
-           (ERROR "Cannot commit to the master branch"))
+    (CL:WHEN (STRING.EQUAL (GIT-MAINBRANCH PROJECT)
+                    (GIT-WHICH-BRANCH PROJECT))
+           (ERROR "Cannot commit to the main branch"))
+    (HELP "UNIMPLEMENTED")
+    (GIT-MAINBRANCH? (GIT-WHICH-BRANCH PROJECT)
+           PROJECT)
     (LET (GFILES)
-         (SETQ GFILES (FOR F GF INSIDE FILES COLLECT (SETQ GF (INFILEP (GFILE4MFILE F])
+         (SETQ GFILES (FOR F GF INSIDE FILES COLLECT (SETQ GF (INFILEP (GFILE4MFILE F PROJECT])
 
 (GIT-PUSH
-  [LAMBDA (BRANCH)                                           (* ; "Edited  8-Dec-2021 22:32 by rmk")
-                                                             (* ; "Edited 16-Nov-2021 08:06 by rmk:")
-                                                             (* ; "Edited  2-Nov-2021 21:34 by rmk:")
+  [LAMBDA (BRANCH PROJECT)                                   (* ; "Edited  9-May-2022 15:06 by rmk")
+                                                             (* ; "Edited  8-Dec-2021 22:32 by rmk")
+                                                            (* ; "Edited 16-Nov-2021 08:06 by rmk:")
+                                                            (* ; "Edited  2-Nov-2021 21:34 by rmk:")
     (CL:UNLESS BRANCH
-        (SETQ BRANCH (GIT-WHICH-BRANCH)))
-    (CL:WHEN (STREQUAL "master" (GIT-WHICH-BRANCH))
-           (ERROR "Cannot push the master branch"))
-    (GIT-COMMAND (CONCAT "git push " BRANCH])
+        (SETQ BRANCH (GIT-WHICH-BRANCH PROJECT)))
+    (GIT-MAINBRANCH? BRANCH PROJECT)
+    (GIT-COMMAND (CONCAT "git push " BRANCH)
+           NIL NIL PROJECT])
 
 (GIT-PULL
-  [LAMBDA (BRANCH)                                           (* ; "Edited  8-Dec-2021 22:47 by rmk")
-                                                             (* ; "Edited 16-Nov-2021 08:06 by rmk:")
-                                                             (* ; "Edited  2-Nov-2021 21:34 by rmk:")
-    (GIT-COMMAND (CONCAT "git pull " (OR BRANCH (GIT-WHICH-BRANCH])
+  [LAMBDA (BRANCH PROJECT)                                   (* ; "Edited  9-May-2022 15:07 by rmk")
+                                                             (* ; "Edited  8-Dec-2021 22:47 by rmk")
+                                                            (* ; "Edited 16-Nov-2021 08:06 by rmk:")
+                                                            (* ; "Edited  2-Nov-2021 21:34 by rmk:")
+    (SETQ PROJECT (GIT-GET-PROJECT PROJECT))
+    (GIT-COMMAND (CONCAT "git pull " (OR BRANCH (GIT-WHICH-BRANCH PROJECT)))
+           NIL NIL PROJECT])
+
+(GIT-APPROVAL
+  [LAMBDA (BRANCH PROJECT)                                   (* ; "Edited  9-May-2022 15:08 by rmk")
+                                                            (* ; "Edited 19-Nov-2021 15:08 by rmk:")
+    (GIT-ADD-WORKTREE BRANCH T PROJECT)
+    (GIT-ADD-WORKTREE (GIT-MAINBRANCH PROJECT)
+           T])
+
+(GIT-GET-FILE
+  [LAMBDA (BRANCH GITFILE LOCALFILE NOERROR PROJECT)
+
+    (* ;; "Edited  8-May-2022 16:54 by rmk: the stream, not the name because of the NODIRCORE case.")
+
+    (* ;; "Edited  6-Mar-2022 17:45 by rmk: the stream, not the name because of the NODIRCORE case.")
+
+    (* ;; "Returns the stream, not the name because of the NODIRCORE case.")
+
+    (* ;; "If  GITFILE in (remote) BRANCH exists, it is copied to LOCALFILE and LOCALFILE is returned.  If it doesn't exist, return value is NIL if NOERROR, otherwise an ERROR.")
+
+    (CL:WHEN (AND BRANCH (STRPOS "local/" BRANCH 1 NIL T))
+        (SETQ BRANCH (SUBSTRING BRANCH 7)))
+    (CL:WITH-OPEN-STREAM (s (CREATE-PROCESS-STREAM (CONCAT (CDGITDIR PROJECT)
+                                                          "git show " BRANCH ":" GITFILE)))
+           (SETFILEINFO s 'ENDOFSTREAMOP (FUNCTION NILL))
+           (LET (BYTES)
+                (IF (FOR I B C FROM 1 WHILE (SETQ C (NTHCHARCODE "fatal: " I))
+                       DO 
+                          (* ;; 
+                          "Returns NIL if we run off the fatal string with a match, otherwise T")
+
+                          (CL:UNLESS (SETQ B (\BIN s))
+                                 (RETURN T))
+                          (PUSH BYTES B)
+                          (CL:UNLESS (EQ B C)
+                                 (RETURN T)))
+                    THEN 
+                         (* ;; "Don't open STREAM until we know the file is real")
+
+                         (CL:WITH-OPEN-FILE (STREAM (OR LOCALFILE '{NODIRCORE)
+                                                   :IF-EXISTS :NEW-VERSION :DIRECTION :IO)
+                                (FOR B IN (DREVERSE BYTES) DO (\BOUT STREAM B))
+                                [DO (\BOUT STREAM (OR (\BIN s)
+                                                      (RETURN]
+                                (SETFILEINFO STREAM 'CREATIONDATE (OR (FILEDATE STREAM T)
+                                                                      (FILEDATE STREAM)
+                                                                      (GIT-FILE-DATE GITFILE BRANCH 
+                                                                             PROJECT)))
+                                STREAM)
+                  ELSEIF NOERROR
+                    THEN NIL
+                  ELSE (ERROR "GIT FILE NOT FOUND" GITFILE])
+
+(GIT-FILE-EXISTS?
+  [LAMBDA (BRANCH GITFILE PROJECT)                           (* ; "Edited  8-May-2022 00:02 by rmk")
+                                                             (* ; "Edited  6-Mar-2022 19:04 by rmk")
+                                                             (* ; "Edited 10-Feb-2022 20:55 by rmk")
+                                                             (* ; "Edited 10-Dec-2021 21:30 by rmk")
+
+    (* ;; "T if GITFILE exists on BRANCH.  If s is EOFP, the file exists but is empty")
+
+    (CL:WITH-OPEN-STREAM (s (CREATE-PROCESS-STREAM (CONCAT (CDGITDIR PROJECT)
+                                                          "git show " BRANCH ":" GITFILE)))
+           (SETFILEINFO s 'ENDOFSTREAMOP (FUNCTION NILL))
+           (NOT (FOR I C FROM 1 WHILE (SETQ C (NTHCHARCODE "fatal: " I))
+                   ALWAYS (EQ (BIN s)
+                              C])
+
+(GIT-REMOTE-UPDATE
+  [LAMBDA (DOIT PROJECT)
+    (DECLARE (USEDFREE LAST-REMOTE-UPDATE-IDATE))            (* ; "Edited  7-May-2022 22:41 by rmk")
+
+    (* ;; "Because git hangs on this (and other things), do this no more than once a day")
+
+    (CL:WHEN [OR DOIT (NOT (BOUNDP 'LAST-REMOTE-UPDATE-IDATE))
+                 (IGREATERP (IDIFFERENCE (IDATE)
+                                   LAST-REMOTE-UPDATE-IDATE)
+                        (CONSTANT (TIMES 24 60 60 1000]
+        (PRINTOUT T "Updating from remote, local branch is " (GIT-WHICH-BRANCH PROJECT)
+               T)
+        (PROG1 (GIT-COMMAND "git remote update origin" NIL PROJECT)
+            (SETQ LAST-REMOTE-UPDATE-IDATE (IDATE))))])
+
+(GIT-REMOTE-ADD
+  [LAMBDA (NAME URL)                                         (* ; "Edited 31-Jan-2022 13:53 by rmk")
+    (LET [(RESULT (GIT-COMMAND (CONCAT "git remote add " NAME " " URL]
+
+         (* ;; "Does it return an error line?  What if URL is not good? ")
+
+         (CAR RESULT])
+
+(GIT-FILE-DATE
+  [LAMBDA (GFILE BRANCH PROJECT)                             (* ; "Edited  8-May-2022 16:56 by rmk")
+                                                             (* ; "Edited  6-Mar-2022 17:41 by rmk")
+                                                             (* ; "Edited  3-Jan-2022 19:43 by rmk")
+    (CL:WHEN (AND NIL BRANCH (STRPOS "local/" BRANCH 1 NIL T))
+        (SETQ BRANCH (SUBSTRING BRANCH 7)))
+    (LET [(DATE (CAR (GIT-COMMAND (CONCAT "git log -1 --pretty=%"format:%%cD%" "
+                                         (CL:IF BRANCH
+                                             (CONCAT BRANCH " -- ")
+                                             "")
+                                         (GIT-REPO-FILENAME GFILE PROJECT))
+                            NIL T PROJECT]
+         DATE])
+)
+
+
+
+(* ;; "Differences")
+
+(DEFINEQ
 
 (GIT-BRANCH-DIFF
-  [LAMBDA (BRANCH1 BRANCH2)
+  [LAMBDA (BRANCH1 BRANCH2 PROJECT)
 
-    (* ;; "Edited 29-Apr-2022 07:17 by rmk: returns an ALIST that classifies how the files in BRANCH1 and BRANCH2 differ (changed, renamed, added, deleted, copied).")
+    (* ;; "Edited  9-May-2022 16:21 by rmk: returns an ALIST that classifies how the files in BRANCH1 and BRANCH2 differ (changed, renamed, added, deleted, copied).")
+
+    (* ;; "Edited  6-May-2022 14:04 by rmk: returns an ALIST that classifies how the files in BRANCH1 and BRANCH2 differ (changed, renamed, added, deleted, copied).")
 
     (* ;; "This returns an ALIST that classifies how the files in BRANCH1 and BRANCH2 differ (changed, renamed, added, deleted, copied).")
 
     (CL:UNLESS BRANCH1
-        (SETQ BRANCH1 'origin/master))
+        (SETQ BRANCH1 (GIT-MAINBRANCH PROJECT)))
     (CL:UNLESS BRANCH2
-        (SETQ BRANCH2 'origin/master))
-    (GIT-REMOTE-UPDATE)
-    (LET ([MERGE (CAR (GIT-COMMAND (CONCAT "git merge-base " BRANCH1 " " BRANCH2]
-          LINES POS)
-         (CL:WHEN (STRPOS "fatal" MERGE)
-             (ERROR (CONCAT "merge-base failed for " (LIST BRANCH1 BRANCH2))))
-         (SETQ LINES (GIT-COMMAND (CONCAT "git diff --name-status -C --find-copies-harder " MERGE " "
-                                         BRANCH1)))
+        (SETQ BRANCH2 (GIT-MAINBRANCH PROJECT)))
+    (GIT-REMOTE-UPDATE NIL PROJECT)                          (* (* ;; "Returns the status (M, R, D, A, C), but not sure what comparison is used for the letters.  With --name-only, you just get the list of files in the commit.  (GIT-COMMIT-DIFFS gives the commits that differ between 2 branches.  But what if a given file shows up in 2 different commits in a sequence?  E.g. it was changed and then deleted?  For each files we can calculate the sequence of changes and figure out what the net effect is?  e.g (file D (R file2) (C file3) A) would say that that file didn't exist at the beginning and doesn't exist at the end, so don't report it?")
+                                                             (GIT-COMMAND (CONCAT 
+                                                     "git diff-tree --no-commit-id --name-STATUS -r "
+    COMMIT) NIL NIL PROJECT))
+    (LET (POS (LINES (GIT-COMMAND (CONCAT "git diff --name-status -C --find-copies-harder " BRANCH1 
+                                         " " BRANCH2)
+                            NIL NIL PROJECT)))
          (CL:WHEN (SETQ POS (STRPOS "fatal: ambiguous argument '" (CAR LINES)
                                    1 NIL T T))
              (ERROR "Unknown branch " (IF (STRPOS BRANCH1 (CAR LINES)
@@ -530,105 +900,75 @@
                                (HELP "Unrecognized git-diff code" (NTHCHAR L 1]
                T])
 
-(GIT-APPROVAL
-  [LAMBDA (BRANCH)                                          (* ; "Edited 19-Nov-2021 15:08 by rmk:")
-    (GIT-ADD-WORKTREE BRANCH T)
-    (GIT-ADD-WORKTREE "master" T])
+(GIT-COMMIT-DIFFS
+  [LAMBDA (BRANCH1 BUTNOTBRANCH2 PROJECT)                    (* ; "Edited  7-May-2022 23:48 by rmk")
+                                                             (* ; "Edited  2-May-2022 13:45 by rmk")
 
-(GIT-GET-FILE
-  [LAMBDA (BRANCH GITFILE LOCALFILE NOERROR)
+    (* ;; "Returns the identifiers for commits in BRANCH1 but not in BUTNOTBRANCH2")
 
-    (* ;; "Edited  6-Mar-2022 17:45 by rmk: the stream, not the name because of the NODIRCORE case.")
+    (GIT-COMMAND (CONCAT "git log --format=%"%%h%" " BRANCH1 " ^" BUTNOTBRANCH2)
+           NIL NIL PROJECT])
 
-    (* ;; "Returns the stream, not the name because of the NODIRCORE case.")
+(GIT-BRANCH-RELATIONS
+  [LAMBDA (BRANCHES BRANCH2 STRIPWHERE PROJECT)              (* ; "Edited  9-May-2022 16:12 by rmk")
 
-    (* ;; "If  GITFILE in (remote) BRANCH exists, it is copied to LOCALFILE and LOCALFILE is returned.  If it doesn't exist, return value is NIL if NOERROR, otherwise an ERROR.")
+    (* ;; "Returns a pair (SUPERSETS EQUALS), where each item in SUPERSETS is a list of the form (B0 B1 B2...) where each Bi is a superset of Bj for i < j and EQUALS is a list of branch equivalence classes. ")
 
-    (CL:WHEN (AND BRANCH (STRPOS "local/" BRANCH 1 NIL T))
-        (SETQ BRANCH (SUBSTRING BRANCH 7)))
-    (CL:WITH-OPEN-STREAM (s (CREATE-PROCESS-STREAM (CONCAT (CDGITDIR)
-                                                          "git show " BRANCH ":" GITFILE)))
-           (SETFILEINFO s 'ENDOFSTREAMOP (FUNCTION NILL))
-           (LET (BYTES)
-                (IF (FOR I B C FROM 1 WHILE (SETQ C (NTHCHARCODE "fatal: " I))
-                       DO 
-                          (* ;; 
-                          "Returns NIL if we run off the fatal string with a match, otherwise T")
+    (CL:WHEN BRANCH2
+        (SETQ BRANCHES (LIST BRANCHES BRANCH2)))
+    (FOR DTAIL D1 MORE1 MORE2 SUPERSETS EQUALS ON (FOR B IN BRANCHES
+                                                     COLLECT (CONS B (GIT-COMMIT-DIFFS B (
+                                                                                       GIT-MAINBRANCH
+                                                                                          PROJECT)
+                                                                            PROJECT)))
+       DO 
+          (* ;; "For each branch we now have the list of commit identifiers (hexstrings) that they do not share with the main branch.")
 
-                          (CL:UNLESS (SETQ B (\BIN s))
-                                 (RETURN T))
-                          (PUSH BYTES B)
-                          (CL:UNLESS (EQ B C)
-                                 (RETURN T)))
-                    THEN 
-                         (* ;; "Don't open STREAM until we know the file is real")
+          (SETQ D1 (CAR DTAIL))
+          [FOR D2 IN (CDR DTAIL)
+             DO (CL:WHEN (EQUAL (CDR D1)
+                                (CDR D2))                    (* ; "Unlikely")
+                    (PUSH [CDR (OR (ASSOC (CAR D1)
+                                          EQUALS)
+                                   (CAR (PUSH EQUALS (CONS (CAR D1]
+                          (CAR D2))
+                    (GO $$ITERATE))
+                (SETQ MORE2 (MEMBER (CADR D1)
+                                   (CDR D2)))                (* ; 
+                                                             "The most recent commit of D1 is in D2")
+                (SETQ MORE1 (MEMBER (CADR D2)
+                                   (CDR D1)))
+                (IF MORE2
+                    THEN (CL:UNLESS MORE1
+                             (PUSH [CDR (OR (ASSOC (CAR D2)
+                                                   SUPERSETS)
+                                            (CAR (PUSH SUPERSETS (CONS (CAR D2]
+                                   (CAR D1)))
+                  ELSEIF MORE1
+                    THEN (PUSH [CDR (OR (ASSOC (CAR D1)
+                                               SUPERSETS)
+                                        (CAR (PUSH SUPERSETS (CONS (CAR D1]
+                               (CAR D2]
+       FINALLY 
 
-                         (CL:WITH-OPEN-FILE (STREAM (OR LOCALFILE '{NODIRCORE)
-                                                   :IF-EXISTS :NEW-VERSION :DIRECTION :IO)
-                                (FOR B IN (DREVERSE BYTES) DO (\BOUT STREAM B))
-                                [DO (\BOUT STREAM (OR (\BIN s)
-                                                      (RETURN]
-                                (SETFILEINFO STREAM 'CREATIONDATE (OR (FILEDATE STREAM T)
-                                                                      (FILEDATE STREAM)
-                                                                      (GIT-FILE-DATE GITFILE BRANCH))
-                                       )
-                                STREAM)
-                  ELSEIF NOERROR
-                    THEN NIL
-                  ELSE (ERROR "GIT FILE NOT FOUND" GITFILE])
+             (* ;; "Sort the supersets so that the larger ones come before the smaller ones")
 
-(GIT-FILE-EXISTS?
-  [LAMBDA (BRANCH GITFILE)                                   (* ; "Edited  6-Mar-2022 19:04 by rmk")
-                                                             (* ; "Edited 10-Feb-2022 20:55 by rmk")
-                                                             (* ; "Edited 10-Dec-2021 21:30 by rmk")
-
-    (* ;; "T if GITFILE exists on BRANCH.  If s is EOFP, the file exists but is empty")
-
-    (CL:WITH-OPEN-STREAM (s (CREATE-PROCESS-STREAM (CONCAT (CDGITDIR)
-                                                          "git show " BRANCH ":" GITFILE)))
-           (SETFILEINFO s 'ENDOFSTREAMOP (FUNCTION NILL))
-           (NOT (FOR I C FROM 1 WHILE (SETQ C (NTHCHARCODE "fatal: " I))
-                   ALWAYS (EQ (BIN s)
-                              C])
-
-(GIT-REMOTE-UPDATE
-  [LAMBDA (DOIT)                                             (* ; "Edited 16-Dec-2021 10:45 by rmk")
-                                                             (* ; "Edited  4-Dec-2021 21:49 by rmk")
-                                                             (* ; "Edited  2-Dec-2021 08:44 by rmk:")
-                                                             (* ; "Edited 24-Nov-2021 16:34 by rmk:")
-    (DECLARE (USEDFREE LAST-REMOTE-UPDATE-IDATE))
-
-    (* ;; "Because git hangs on this (and other things), do this no more than once a day")
-
-    (CL:WHEN [OR DOIT (NOT (BOUNDP 'LAST-REMOTE-UPDATE-IDATE))
-                 (IGREATERP (IDIFFERENCE (IDATE)
-                                   LAST-REMOTE-UPDATE-IDATE)
-                        (CONSTANT (TIMES 24 60 60 1000]
-        (PRINTOUT T "Updating from remote, local branch is " (GIT-WHICH-BRANCH)
-               T)
-        (PROG1 (GIT-COMMAND "git remote update origin")
-            (SETQ LAST-REMOTE-UPDATE-IDATE (IDATE))))])
-
-(GIT-REMOTE-ADD
-  [LAMBDA (NAME URL)                                         (* ; "Edited 31-Jan-2022 13:53 by rmk")
-    (LET [(RESULT (GIT-COMMAND (CONCAT "git remote add " NAME " " URL]
-
-         (* ;; "Does it return an error line?  What if URL is not good? ")
-
-         (CAR RESULT])
-
-(GIT-FILE-DATE
-  [LAMBDA (GFILE BRANCH)                                     (* ; "Edited  6-Mar-2022 17:41 by rmk")
-                                                             (* ; "Edited  3-Jan-2022 19:43 by rmk")
-    (CL:WHEN (AND NIL BRANCH (STRPOS "local/" BRANCH 1 NIL T))
-        (SETQ BRANCH (SUBSTRING BRANCH 7)))
-    (LET [(DATE (CAR (GIT-COMMAND (CONCAT "git log -1 --pretty=%"format:%%cD%" "
-                                         (CL:IF BRANCH
-                                             (CONCAT BRANCH " -- ")
-                                             "")
-                                         (GIT-REPO-FILENAME GFILE T))
-                            NIL T]
-         DATE])
+             (CL:WHEN STRIPWHERE
+                 [SETQ SUPERSETS (FOR S IN SUPERSETS COLLECT (FOR SS IN S COLLECT (STRIPWHERE SS]
+                 [SETQ EQUALS (FOR S IN EQUALS COLLECT (FOR SS IN S COLLECT (STRIPWHERE SS])
+             [FOR S IN SUPERSETS
+                DO (CHANGE (CDR S)
+                          (SORT DATUM (FUNCTION (LAMBDA (B1 B2)
+                                                  (OR (MEMB B2 (CDR (ASSOC B1 SUPERSETS)))
+                                                      (NOT (MEMB B1 (CDR (ASSOC B2 SUPERSETS]
+             [FOR E IN EQUALS DO (CHANGE (CDR E)
+                                        (IF (MEMB (GIT-MAINBRANCH PROJECT)
+                                                  (CDR E))
+                                            THEN (CONS (GIT-MAINBRANCH PROJECT)
+                                                       (DREMOVE (GIT-MAINBRANCH PROJECT)
+                                                              (SORT DATUM)))
+                                          ELSE (SORT DATUM]
+             (RETURN (LIST SUPERSETS EQUALS])
 )
 
 
@@ -643,27 +983,24 @@
 (DEFINEQ
 
 (GIT-CHECKOUT
-  [LAMBDA (BRANCH)                                          (* ; "Edited  2-Nov-2021 22:40 by rmk:")
-    (CAR (GIT-COMMAND (CONCAT "git checkout " (OR BRANCH "master")
-                             "; git pull"])
+  [LAMBDA (BRANCH PROJECT)                                   (* ; "Edited  9-May-2022 15:12 by rmk")
+                                                             (* ; "Edited  7-May-2022 23:51 by rmk")
+                                                            (* ; "Edited  2-Nov-2021 22:40 by rmk:")
+    (CAR (GIT-COMMAND (CONCAT "git checkout " (OR BRANCH (GIT-MAINBRANCH PROJECT))
+                             "; git pull")
+                NIL NIL PROJECT])
 
 (GIT-WHICH-BRANCH
-  [LAMBDA NIL                                                (* ; "Edited 14-Dec-2021 23:39 by rmk")
-                                                             (* ; "Edited 12-Dec-2021 11:56 by rmk")
-                                                             (* ; "Edited  6-Nov-2021 12:11 by rmk:")
-                                                             (* ; "Edited  3-Oct-2021 15:32 by rmk:")
+  [LAMBDA (PROJECT)                                          (* ; "Edited  7-May-2022 22:41 by rmk")
 
-    (* ;; "Returns the current (local) branch")
+    (* ;; "Returns the current (local) branch in PROJECT")
 
-    (MKATOM (CONCAT "local/" (CAR (GIT-COMMAND "git rev-parse --abbrev-ref HEAD"])
+    (MKATOM (CONCAT "local/" (CAR (GIT-COMMAND "git rev-parse --abbrev-ref HEAD" NIL NIL PROJECT])
 
 (GIT-MAKE-BRANCH
-  [LAMBDA (NAME TITLESTRING)                                 (* ; "Edited 26-Jan-2022 12:12 by rmk")
-                                                             (* ; "Edited 19-Jan-2022 23:25 by rmk")
-                                                             (* ; "Edited  8-Jan-2022 09:48 by rmk")
-                                                            (* ; "Edited  2-Nov-2021 21:28 by rmk:")
+  [LAMBDA (NAME TITLESTRING PROJECT)                         (* ; "Edited  9-May-2022 15:13 by rmk")
 
-    (* ;; " The new branch is directly under the currently checked out branch.  Maybe it should always make it under master?")
+    (* ;; " The new branch is directly under the currently checked out branch.  Maybe it should always make it under the main branch?")
 
     (* ;; 
     "This makes a new branch with name NAME: TITLESTRING, or just NAME if TITLESTRING is not given.")
@@ -671,11 +1008,12 @@
     (* ;; "(GIT-MAKE-BRANCH) makes and checks out the next initialsn branch.")
 
     (CL:UNLESS NAME
-        (SETQ NAME (GIT-MY-NEXT-BRANCH)))
+        (SETQ NAME (GIT-MY-NEXT-BRANCH PROJECT)))
     (CL:WHEN TITLESTRING
         (SETQ NAME (CONCAT NAME (CONCAT ": " TITLESTRING))))
-    (LET [(UNDER (GIT-WHICH-BRANCH))
-          (RESULT (GIT-COMMAND (CONCAT "git checkout -b " NAME]
+    (LET ((UNDER (GIT-WHICH-BRANCH PROJECT))
+          (RESULT (GIT-COMMAND (CONCAT "git checkout -b " NAME)
+                         NIL NIL PROJECT)))
          (IF (STREQUAL (CAR RESULT)
                     (CONCAT "Switched to a new branch '" NAME "'"))
              THEN (CONCAT (CAR RESULT)
@@ -686,73 +1024,85 @@
            ELSE (HELP "Unexpected git result" RESULT])
 
 (GIT-BRANCHES
-  [LAMBDA (WHERE)                                            (* ; "Edited  6-Mar-2022 08:54 by rmk")
-                                                             (* ; "Edited 24-Feb-2022 21:20 by rmk")
-                                                             (* ; "Edited  8-Dec-2021 08:43 by rmk")
-                                                            (* ; "Edited 17-Nov-2021 18:20 by rmk:")
-                                                            (* ; "Edited 16-Nov-2021 09:21 by rmk:")
+  [LAMBDA (WHERE PROJECT)                                    (* ; "Edited  9-May-2022 14:10 by rmk")
+                                                             (* ; "Edited  7-May-2022 23:29 by rmk")
+    (SETQ PROJECT (GIT-GET-PROJECT PROJECT))
 
     (* ;; "Strips of the %"* %" that indicates the current branch and the 2-space padding on other branches.  Packs local/ on to local branches")
 
     (LET [[LOCAL (CL:WHEN (MEMB (U-CASE WHERE)
                                 '(NIL ALL LOCAL))
-                     (FOR B IN (GIT-COMMAND "git branch") COLLECT (PACK* "local/" (SUBATOM B 3))))]
+                     (FOR B IN (GIT-COMMAND "git branch" NIL NIL PROJECT)
+                        COLLECT (PACK* "local/" (SUBATOM B 3))))]
           (REMOTE (CL:WHEN (MEMB (U-CASE WHERE)
                                  '(NIL ALL REMOTE T))
-                      (FOR B IN (GIT-COMMAND "git branch -r") COLLECT (SUBATOM B 3)))]
+                      (FOR B IN (GIT-COMMAND "git branch -r" NIL NIL PROJECT)
+                         COLLECT (SUBATOM B 3)))]
          (SORT (APPEND LOCAL REMOTE])
 
 (GIT-BRANCH-EXISTS?
-  [LAMBDA (BRANCH WHERE NOERROR)                             (* ; "Edited  6-Mar-2022 15:28 by rmk")
-                                                             (* ; "Edited 16-Dec-2021 08:50 by rmk")
-                                                             (* ; "Edited  8-Dec-2021 08:44 by rmk")
-                                                            (* ; "Edited 19-Nov-2021 15:13 by rmk:")
+  [LAMBDA (BRANCH NOERROR PROJECT)                           (* ; "Edited  9-May-2022 14:18 by rmk")
+                                                             (* ; "Edited  7-May-2022 23:28 by rmk")
+                                                             (* ; "Edited  3-May-2022 12:56 by rmk")
                                                             (* ; "Edited 17-Nov-2021 18:24 by rmk:")
 
     (* ;; "Returns the canonical name of the branch (xxx or origin/xxx) depending on whether BRANCH is local/xxx or origin/xxx")
-                                                            (* ; "Edited 16-Nov-2021 09:25 by rmk:")
-    (IF [CAR (MEMB (MKATOM BRANCH)
+
+    (IF (CAR (MEMB (MKATOM BRANCH)
                    (GIT-BRANCHES (IF (STRPOS "origin/" BRANCH 1 NIL T)
                                      THEN 'REMOTE
                                    ELSEIF (STRPOS "local/" BRANCH 1 NIL T)
-                                     THEN 'LOCAL]
+                                     THEN 'LOCAL)
+                          PROJECT)))
       ELSEIF (NOT NOERROR)
         THEN (ERROR "Unknown branch" BRANCH])
 
 (GIT-PICK-BRANCH
-  [LAMBDA (BRANCHES TITLE WHERE)                             (* ; "Edited  6-Mar-2022 08:55 by rmk")
+  [LAMBDA (BRANCHES TITLE WHERE PROJECT)                     (* ; "Edited 11-May-2022 23:53 by rmk")
+                                                             (* ; "Edited  9-May-2022 17:07 by rmk")
+                                                             (* ; "Edited  7-May-2022 23:54 by rmk")
+                                                             (* ; "Edited  6-Mar-2022 08:55 by rmk")
                                                              (* ; "Edited 25-Feb-2022 09:02 by rmk")
     (MENU (CREATE MENU
                  TITLE _ (OR TITLE 'Branches)
                  ITEMS _ (OR (LISTP BRANCHES)
-                             (GIT-BRANCHES WHERE))
+                             (GIT-BRANCHES WHERE PROJECT))
                  MENUFONT _ DEFAULTFONT])
 
 (GIT-PRC-MENU
-  [LAMBDA (DRAFT)                                            (* ; "Edited 29-Apr-2022 11:36 by rmk")
-    (LET* [(PRS (GIT-PULL-REQUESTS T DRAFT))
-           (SUPERSETS (CAR (GIT-BRANCH-RELATIONS (FOR PR IN PRS COLLECT (CADDR PR]
-
-          (* ;; "Reverse on the theory that rmknnn's should be ordered from nnn highest to lowest")
-
-          (DREVERSE (SORT [FOR PR SUP LABEL IN PRS
-                             COLLECT (SETQ LABEL (CL:IF [SETQ SUP (CAR (CDR (ASSOC (CADDR PR)
-                                                                                   SUPERSETS]
-                                                     (CONCAT (CADDR PR)
-                                                            " > " SUP)
-                                                     (CADDR PR)))
-                                   (LIST (CL:IF (MEMB 'DRAFT PR)
-                                             (CONCAT LABEL " (draft)")
-                                             LABEL)
-                                         (GITORIGIN (CADDR PR))
-                                         (CONCAT " " (CADR PR)
-                                                "  #"
-                                                (CAR PR]
-                          T])
+  [LAMBDA (DRAFT PROJECT)                                    (* ; "Edited  9-May-2022 16:54 by rmk")
+                                                             (* ; "Edited  7-May-2022 23:48 by rmk")
+                                                             (* ; "Edited  6-May-2022 09:59 by rmk")
+                                                             (* ; "Edited  3-May-2022 22:58 by rmk")
+                                                             (* ; "Edited 29-Apr-2022 21:42 by rmk")
+    (LET* ((PRS (GIT-PULL-REQUESTS T DRAFT PROJECT))
+           (RELATIONS (GIT-BRANCH-RELATIONS (FOR PR IN PRS COLLECT (GITORIGIN (CADDR PR)))
+                             NIL T PROJECT))
+           (SUPERSETS (CAR RELATIONS))
+           (EQUALS (CADR RELATIONS)))
+          (SORT [FOR PR REL LABEL IN PRS
+                   COLLECT (SETQ LABEL (IF [SETQ REL (CAR (CDR (SASSOC (CADDR PR)
+                                                                      SUPERSETS]
+                                           THEN (CONCAT (CADDR PR)
+                                                       " > " REL)
+                                         ELSEIF [SETQ REL (CAR (CDR (SASSOC (CADDR PR)
+                                                                           EQUALS]
+                                           THEN (CONCAT (CADDR PR)
+                                                       " = " REL)
+                                         ELSE (CADDR PR)))
+                         (LIST (CL:IF (MEMB 'DRAFT PR)
+                                   (CONCAT LABEL " (draft)")
+                                   LABEL)
+                               (GITORIGIN (CADDR PR))
+                               (CONCAT " " (CADR PR)
+                                      "  #"
+                                      (CAR PR]
+                T])
 
 (GIT-PULL-REQUESTS
-  [LAMBDA (ALLINFO INCLUDEDRAFTS)                            (* ; "Edited 25-Feb-2022 09:26 by rmk")
-    (FOR LINE TAB1 TAB2 TAB3 VAL IN (GIT-COMMAND "gh pr list" T)
+  [LAMBDA (ALLINFO INCLUDEDRAFTS PROJECT)                    (* ; "Edited  9-May-2022 16:54 by rmk")
+                                                             (* ; "Edited 25-Feb-2022 09:26 by rmk")
+    (FOR LINE TAB1 TAB2 TAB3 VAL IN (GIT-COMMAND "gh pr list" T NIL PROJECT)
        WHEN [AND (SETQ TAB1 (STRPOS "	" LINE))
                  (SETQ TAB2 (STRPOS "	" LINE (ADD1 TAB1)))
                  (SETQ TAB3 (STRPOS "	" LINE (ADD1 TAB2)))
@@ -766,53 +1116,6 @@
                           ,(SUBATOM LINE (ADD1 TAB3]
                  ELSE (SUBATOM LINE (ADD1 TAB2)
                              (SUB1 TAB3])
-
-(GIT-BRANCH-RELATIONS
-  [LAMBDA (BRANCHES BRANCH2)                                 (* ; "Edited 29-Apr-2022 11:05 by rmk")
-
-    (* ;; "Returns a pair (SUPERSETS EQUALS), where each item in SUPERSETS is a list of the form (B0 B1 B2...) where each Bi is a superset of Bj for i < j and EQUALS is a list of branch equivalence classes. ")
-
-    (CL:WHEN BRANCH2
-        (SETQ BRANCHES (LIST BRANCHES BRANCH2)))
-    (FOR DTAIL D1 MORE1 MORE2 SUPERSETS EQUALS ON [FOR B IN BRANCHES
-                                                     COLLECT (CONS B (GIT-BRANCH-DIFF (GITORIGIN
-                                                                                       B)
-                                                                            'origin/master]
-       DO (SETQ D1 (CAR DTAIL))
-          [FOR D2 IN (CDR DTAIL)
-             DO (SETQ MORE1 (CL:SET-DIFFERENCE (CDR D1)
-                                   (CDR D2)
-                                   :TEST
-                                   (FUNCTION EQUAL)))
-                (SETQ MORE2 (CL:SET-DIFFERENCE (CDR D2)
-                                   (CDR D1)
-                                   :TEST
-                                   (FUNCTION EQUAL)))
-                (IF MORE2
-                    THEN (CL:UNLESS MORE1
-                             (PUSH [CDR (OR (ASSOC (CAR D2)
-                                                   SUPERSETS)
-                                            (CAR (PUSH SUPERSETS (CONS (CAR D2]
-                                   (CAR D1)))
-                  ELSEIF MORE1
-                    THEN (PUSH [CDR (OR (ASSOC (CAR D1)
-                                               SUPERSETS)
-                                        (CAR (PUSH SUPERSETS (CONS (CAR D1]
-                               (CAR D2))
-                  ELSE (PUSH [CDR (OR (ASSOC (CAR D1)
-                                             EQUALS)
-                                      (CAR (PUSH EQUALS (CONS (CAR D1]
-                             (CAR D2]
-       FINALLY 
-
-             (* ;; "Sort the supersets so that the larger ones come before the smaller ones")
-
-             [FOR S IN SUPERSETS
-                DO (CHANGE (CDR S)
-                          (SORT DATUM (FUNCTION (LAMBDA (B1 B2)
-                                                  (OR (MEMB B2 (CDR (ASSOC B1 SUPERSETS)))
-                                                      (NOT (MEMB B1 (CDR (ASSOC B2 SUPERSETS]
-             (RETURN (LIST SUPERSETS EQUALS])
 )
 
 
@@ -822,17 +1125,19 @@
 (DEFINEQ
 
 (GIT-MY-CURRENT-BRANCH
-  [LAMBDA NIL                                                (* ; "Edited 19-Jan-2022 13:22 by rmk")
-    (CAR (LAST (GIT-MY-BRANCHES])
+  [LAMBDA (PROJECT)                                          (* ; "Edited  7-May-2022 23:51 by rmk")
+                                                             (* ; "Edited 19-Jan-2022 13:22 by rmk")
+    (CAR (LAST (GIT-MY-BRANCHES PROJECT])
 
 (GIT-MY-BRANCHP
-  [LAMBDA (BRANCH)                                           (* ; "Edited 26-Jan-2022 11:41 by rmk")
+  [LAMBDA (BRANCH PROJECT)                                   (* ; "Edited  7-May-2022 23:56 by rmk")
+                                                             (* ; "Edited 26-Jan-2022 11:41 by rmk")
                                                              (* ; "Edited 19-Jan-2022 13:22 by rmk")
 
     (* ;; "Returns n if BRANCH is INITIALSn (local or origin), possibly followed by a trailing comment after colon or space.")
 
     (CL:UNLESS BRANCH
-        (SETQ BRANCH (GIT-WHICH-BRANCH)))
+        (SETQ BRANCH (GIT-WHICH-BRANCH PROJECT)))
     (LET* ((INITS (GIT-INITIALS))
            (INC (NCHARS INITS))
            (SPOS (ADD1 (OR (STRPOS "/" BRANCH)
@@ -846,17 +1151,20 @@
                      EPOS))])
 
 (GIT-MY-NEXT-BRANCH
-  [LAMBDA NIL                                                (* ; "Edited 19-Jan-2022 23:14 by rmk")
+  [LAMBDA (PROJECT)                                          (* ; "Edited  7-May-2022 23:56 by rmk")
+                                                             (* ; "Edited 19-Jan-2022 23:14 by rmk")
                                                              (* ; "Edited  8-Jan-2022 09:43 by rmk")
 
     (* ;; "Figures out what my next incremental branch would be.  ")
 
     (PACK* (GIT-INITIALS)
-           (ADD1 (OR (GIT-MY-BRANCHP (GIT-MY-CURRENT-BRANCH))
+           (ADD1 (OR (GIT-MY-BRANCHP (GIT-MY-CURRENT-BRANCH PROJECT)
+                            PROJECT)
                      0])
 
 (GIT-MY-BRANCHES
-  [LAMBDA NIL                                                (* ; "Edited  6-Mar-2022 21:50 by rmk")
+  [LAMBDA (PROJECT)                                          (* ; "Edited  7-May-2022 23:51 by rmk")
+                                                             (* ; "Edited  6-Mar-2022 21:50 by rmk")
                                                              (* ; "Edited 19-Jan-2022 13:20 by rmk")
                                                              (* ; "Edited  8-Jan-2022 09:53 by rmk")
                                                              (* ; "Edited 12-Dec-2021 11:46 by rmk")
@@ -868,7 +1176,7 @@
     (* ;; "The return list is sorted so that lower n's come before later n's.  The last element is my current branch")
 
     (FOR B (INITS _ (CONCAT "local/" (GIT-INITIALS)))
-         INC IN (GIT-BRANCHES) FIRST (SETQ INC (NCHARS INITS))
+         INC IN (GIT-BRANCHES NIL PROJECT) FIRST (SETQ INC (NCHARS INITS))
        WHEN (STRPOS INITS B 1 NIL T NIL UPPERCASEARRAY) COLLECT B
        FINALLY (RETURN (SORT $$VAL (FUNCTION (LAMBDA (A B)
                                                (ILESSP (SUBATOM A (ADD1 INC))
@@ -887,43 +1195,43 @@
 (DEFINEQ
 
 (GIT-ADD-WORKTREE
-  [LAMBDA (BRANCH REMOTEONLY)                                (* ; "Edited  6-Mar-2022 15:51 by rmk")
-                                                             (* ; "Edited 12-Dec-2021 11:57 by rmk")
-                                                            (* ; "Edited 25-Nov-2021 08:45 by rmk:")
-                                                            (* ; "Edited 19-Nov-2021 19:01 by rmk:")
-                                                            (* ; "Edited 17-Nov-2021 18:25 by rmk:")
+  [LAMBDA (BRANCH REMOTEONLY PROJECT)                        (* ; "Edited  9-May-2022 14:17 by rmk")
     (SETQ BRANCH (GITORIGIN BRANCH (NOT REMOTEONLY)))
-    (CL:UNLESS (OR (GIT-BRANCH-EXISTS? BRANCH NIL T)
-                   (GIT-BRANCH-EXISTS? BRANCH T))
+    (CL:UNLESS (OR (GIT-BRANCH-EXISTS? BRANCH T PROJECT)
+                   (GIT-BRANCH-EXISTS? BRANCH T PROJECT))
            (ERROR BRANCH "is not a git branch"))
-    (CL:WHEN (STRING-EQUAL BRANCH (GIT-WHICH-BRANCH))
+    (CL:WHEN (STRING-EQUAL BRANCH (GIT-WHICH-BRANCH PROJECT))
            (ERROR BRANCH "is the current branch"))
     (LET (LINES LOCALBRANCH)
-         [SETQ LINES (GIT-COMMAND (IF (EQ 1 (STRPOS "origin/" BRANCH))
+         (SETQ LINES (GIT-COMMAND (IF (EQ 1 (STRPOS "origin/" BRANCH))
                                       THEN [SETQ LOCALBRANCH (SUBSTRING BRANCH
                                                                     (CONSTANT (ADD1 (NCHARS "origin/"
                                                                                            ]
-                                           (CONCAT "git worktree add --guess-remote " (WORKTREEDIR
-                                                                                       LOCALBRANCH)
+                                           (CONCAT "git worktree add --guess-remote "
+                                                  (WORKTREEDIR LOCALBRANCH PROJECT)
                                                   " " BRANCH)
                                     ELSE (CONCAT "git worktree add " (WORKTREEDIR BRANCH)
-                                                " " BRANCH]
+                                                " " BRANCH))
+                            NIL NIL PROJECT))
          (CL:UNLESS (STRPOS "Preparing worktree" (CAR LINES)
                            1 NIL T)
                 (ERROR "Could not create worktree for " BRANCH))
          BRANCH])
 
 (GIT-REMOVE-WORKTREE
-  [LAMBDA (BRANCH)                                          (* ; "Edited 17-Nov-2021 10:02 by rmk:")
-    (GIT-BRANCH-EXISTS? BRANCH)
-    (LET ((DIR (WORKTREEDIR BRANCH))
+  [LAMBDA (BRANCH PROJECT)                                   (* ; "Edited  9-May-2022 16:22 by rmk")
+                                                            (* ; "Edited 17-Nov-2021 10:02 by rmk:")
+    (GIT-BRANCH-EXISTS? BRANCH NIL PROJECT)
+    (LET ((DIR (WORKTREEDIR BRANCH PROJECT))
           LINES)
-         (SETQ LINES (GIT-COMMAND (CONCAT "git worktree remove " DIR)))
+         (SETQ LINES (GIT-COMMAND (CONCAT "git worktree remove " DIR)
+                            NIL NIL PROJECT))
          (CL:WHEN (STRPOS "fatal: " (CAR LINES)
                          1 NIL T)
                 (ERROR "Could not remove worktree for " BRANCH))
-         (AND NIL (DELFILE (CONCAT PATH "/.DS_Store"))
-              (GIT-COMMAND (CONCAT "rmdir " DIR)))
+                                                             (* (DELFILE (CONCAT PATH "/.DS_Store"))
+                                                             (GIT-COMMAND (CONCAT "rmdir " DIR) NIL 
+                                                             NIL PROJECT))
          BRANCH])
 
 (GIT-LIST-WORKTREES
@@ -938,13 +1246,16 @@
                                                            (SUBATOM L 1 (SUB1 (STRPOS " " L])
 
 (WORKTREEDIR
-  [LAMBDA (BRANCH)                                           (* ; "Edited 18-Jan-2022 15:02 by rmk")
-                                                             (* ; "Edited 25-Nov-2021 08:49 by rmk:")
-                                                             (* ; "Edited 19-Nov-2021 20:56 by rmk:")
-                                                             (* ; "Edited 17-Nov-2021 10:00 by rmk:")
-    (CONCAT GITMEDLEYDIR "../worktrees/" (IF BRANCH
-                                             THEN "/"
-                                           ELSE ""])
+  [LAMBDA (BRANCH PROJECT)                                   (* ; "Edited  9-May-2022 00:04 by rmk")
+                                                             (* ; "Edited 18-Jan-2022 15:02 by rmk")
+                                                            (* ; "Edited 25-Nov-2021 08:49 by rmk:")
+                                                            (* ; "Edited 19-Nov-2021 20:56 by rmk:")
+                                                            (* ; "Edited 17-Nov-2021 10:00 by rmk:")
+    (CONCAT (FETCH GITHOST OF PROJECT)
+           "../worktrees/"
+           (IF BRANCH
+               THEN "/"
+             ELSE ""])
 )
 
 
@@ -959,28 +1270,23 @@
 (DEFINEQ
 
 (GIT-GET-DIFFERENT-FILES
-  [LAMBDA (BRANCH1 BRANCH2 DIR1 DIR2)                        (* ; "Edited 29-Apr-2022 07:53 by rmk")
-                                                             (* ; "Edited  5-Jan-2022 08:01 by rmk")
+  [LAMBDA (BRANCH1 BRANCH2 DIR1 DIR2 PROJECT)
     (DECLARE (USEDFREE FROMGITN))
 
-    (* ;; "Ask git for the files that differ between the branches, copy those files down to local DIR1 and DIR2, return the directories and a list of (dir1-file1 file2) mappings for renamed and copied files.")
+    (* ;; "Edited  9-May-2022 14:17 by rmk: Ask git for the files that differ between the branches, copy those files down to local DIR1 and DIR2, return the directories and a list of (dir1-file1 file2) mappings for renamed and copied files.")
 
-    (SETQ BRANCH1 (GIT-BRANCH-EXISTS? BRANCH1))
-    (SETQ BRANCH2 (GIT-BRANCH-EXISTS? BRANCH2))
+    (* ;; "Edited  6-May-2022 08:26 by rmk: Ask git for the files that differ between the branches, copy those files down to local DIR1 and DIR2, return the directories and a list of (dir1-file1 file2) mappings for renamed and copied files.")
+
+    (SETQ BRANCH1 (GIT-BRANCH-EXISTS? BRANCH1 NIL PROJECT))
+    (SETQ BRANCH2 (GIT-BRANCH-EXISTS? BRANCH2 NIL PROJECT))
     (LET
-     ([MERGE (CAR (GIT-COMMAND (CONCAT "git merge-base " BRANCH1 " " BRANCH2]
-      DIFFS MAPPINGS FROMGIT)
-
-     (* ;; "Collapse them together for now")
-
-     (SETQ DIFFS (GIT-BRANCH-DIFF BRANCH1 MERGE))
-
-     (* ;; "DIFFS is an alist with keys ADDED, DELETED, CHANGED, MOVED")
-
+     (MAPPINGS FROMGIT (DIFFS (GIT-BRANCH-DIFF BRANCH1 BRANCH2 PROJECT)))
      (CL:WHEN DIFFS
          (SETQ FROMGIT (PACK* '{FROMGIT (ADD FROMGITN 1)
                               '}))
-         (PSEUDOHOST FROMGIT (CONCAT "{CORE}<gitfiles>" (DATE)
+         (PSEUDOHOST FROMGIT (CONCAT "{CORE}<" (FETCH PROJECTNAME OF PROJECT)
+                                    ">"
+                                    (DATE)
                                     ">"))
 
          (* ;; "UNSLASHIT because CORE doesn't know about slash")
@@ -994,23 +1300,29 @@
          (FOR D IN DIFFS
             DO (SELECTQ (CAR D)
                    (ADDED                                    (* ; 
-                                                  "Shouldn't exist in MERGE, should exist in BRANCH1")
-                          (GIT-GET-FILE BRANCH1 GFILE (CONCAT DIR1 (CADR D))))
+     "Shouldn't exist in BRANCH2, should exist in BRANCH1, but maybe ADDED and DELETED are mixed up?")
+                          (SETQ D (CADR D))
+                          (OR (GIT-GET-FILE BRANCH1 D (CONCAT DIR1 D)
+                                     T PROJECT)
+                              (GIT-GET-FILE BRANCH2 D (CONCAT DIR2 D)
+                                     T PROJECT)))
                    (DELETED 
-                            (* ;; "Shouldn't exist in BRANCH1, should exist in MERGE.  But maybe git is just confused in marking a file that exists in the wrong place as a delete instead of an add, or maybe it may think of a file that doesn't exist at all as having been deleted.  Try for both, but don't cause an error.")
+                            (* ;; "Shouldn't exist in BRANCH1, should exist in BRANCH2.  But maybe git is just confused in marking a file that exists in the wrong place as a delete instead of an add, or maybe it may think of a file that doesn't exist at all as having been deleted.  Try for both, but don't cause an error.")
 
                             (SETQ D (CADR D))
-                            (OR (GIT-GET-FILE MERGE D (CONCAT DIR2 D)
-                                       T)
+                            (OR (GIT-GET-FILE BRANCH2 D (CONCAT DIR2 D)
+                                       T PROJECT)
                                 (GIT-GET-FILE BRANCH1 D (CONCAT DIR1 D)
-                                       T)))
+                                       T PROJECT)))
                    (CHANGED                                  (* ; "Should exist in both branches")
                             (SETQ D (CADR D))
-                            (GIT-GET-FILE BRANCH1 D (CONCAT DIR1 D))
-                            (GIT-GET-FILE MERGE D (CONCAT DIR2 D)))
+                            (GIT-GET-FILE BRANCH1 D (CONCAT DIR1 D)
+                                   T PROJECT)
+                            (GIT-GET-FILE BRANCH2 D (CONCAT DIR2 D)
+                                   T PROJECT))
                    ((RENAMED COPIED) 
 
-                                 (* ;; "These entries are from-to filename pairs.  If (CADDR) is 100, only need to fetch one, because it presumably has disappeared in MERGE and reappeared in BRANCH1. MAPPINGS is returned so the connection can be reestablished higher up.  ")
+                                 (* ;; "These entries are from-to filename pairs.  If (CADDR) is 100, only need to fetch one, because it presumably has disappeared in BRANCH2 and reappeared in BRANCH1. MAPPINGS is returned so the connection can be reestablished higher up.  ")
 
                         
                         (* ;; "If renamed and then changed, for now treat as unrelated adds and deletes:  put both files in the fromgit directory.  Perhaps the mapping should still figure out how to relate them.")
@@ -1024,8 +1336,9 @@
 
                              (* ;; "F1 is the file in branch 1, if any, F2 is in branch 2")
 
-                             [SETQ F1 (GIT-GET-FILE BRANCH1 (CADR GFILE)
-                                             (CONCAT DIR1 (CADR GFILE]
+                             (SETQ F1 (GIT-GET-FILE BRANCH1 (CADR GFILE)
+                                             (CONCAT DIR1 (CADR GFILE))
+                                             T PROJECT))
                              (IF (EQ (CADDR GFILE)
                                      100)
                                  THEN 
@@ -1043,28 +1356,27 @@
                                     (* ;; 
                                     "If not a perfect match, then the directory should figure it out")
 
-                                    (GIT-GET-FILE MERGE (CAR GFILE)
+                                    (GIT-GET-FILE BRANCH2 (CAR GFILE)
                                            (CONCAT DIR2 (CAR GFILE))
-                                           T))))
-                   (HELP "UNKNOWN GIT-DIFF TAG" DLIST)))
+                                           T PROJECT))))
+                   (HELP "UNKNOWN GIT-DIFF TAG" D)))
          (LIST DIR1 DIR2 MAPPINGS))])
 
 (GIT-COMPARE-BRANCHES
-  [LAMBDA (BRANCH1 BRANCH2 LOCAL)                            (* ; "Edited  6-Mar-2022 19:52 by rmk")
-                                                             (* ; "Edited 22-Feb-2022 22:53 by rmk")
-                                                             (* ; "Edited 19-Feb-2022 10:21 by rmk")
-                                                             (* ; "Edited 13-Feb-2022 21:27 by rmk")
-                                                             (* ; "Edited  2-Feb-2022 08:46 by rmk")
-                                                             (* ; "Edited 28-Jan-2022 23:58 by rmk")
+  [LAMBDA (BRANCH1 BRANCH2 LOCAL PROJECT)                    (* ; "Edited  9-May-2022 15:14 by rmk")
+                                                             (* ; "Edited  3-May-2022 23:04 by rmk")
+    (SETQ PROJECT (GIT-GET-PROJECT PROJECT))
     (SETQ BRANCH1 (IF BRANCH1
                       THEN (GITORIGIN BRANCH1 LOCAL)
-                    ELSE (GIT-WHICH-BRANCH)))
-    (SETQ BRANCH2 (GITORIGIN (OR BRANCH2 "master")
+                    ELSE (GIT-WHICH-BRANCH PROJECT)))
+    (SETQ BRANCH2 (GITORIGIN (OR BRANCH2 (GIT-MAINBRANCH PROJECT))
                          LOCAL))
-    (PRINTOUT T "Comparing all subdirectories of " BRANCH1 " and " BRANCH2 T)
+    (PRINTOUT T "Comparing all " (L-CASE (FETCH PROJECTNAME OF PROJECT)
+                                        T)
+           " subdirectories of " BRANCH1 " and " BRANCH2 T)
     (LET (CDVALUE DIRS NENTRIES MAPPINGS)
          (PRINTOUT T "Fetching differences" T)
-         (SETQ DIRS (GIT-GET-DIFFERENT-FILES BRANCH1 BRANCH2))
+         (SETQ DIRS (GIT-GET-DIFFERENT-FILES BRANCH1 BRANCH2 NIL NIL PROJECT))
          (SETQ MAPPINGS (CADDR DIRS))
          (IF DIRS
              THEN (TERPRI T)
@@ -1073,10 +1385,10 @@
                                        '(> < ~= -* *-)
                                        '*>*.*)) 
 
-                  (* ;; "We know that both sides come from Unix/unversioned, even if they have been copied into versioned FROMGIT, so we make a pass to remove the misleading ;1's.")
+                  (* ;; "We know that both sides come from Unix/unversioned, even if they have been copied into versioned FROMGIT, so we make a pass to remove the misleading versions.")
 
                   (* ;; 
-                " Also, lower case the directories.  Perhaps can be done when the files are fetched?")
+          " Also, lower case and slash directories.  Perhaps can be done when the files are fetched?")
 
                   [CDMAP CDVALUE
                          (FUNCTION (LAMBDA (CDE)
@@ -1089,15 +1401,13 @@
                                                                        FILEDIRCASEARRAY)))]
                                           (CL:WHEN INFO1
                                               (CHANGE (FETCH (CDINFO FULLNAME) OF INFO1)
-                                                     (SLASHIT (CL:IF (STRPOS ";1" DATUM -2 NIL T)
-                                                                  (SUBSTRING DATUM 1 -3)
-                                                                  DATUM)
+                                                     (SLASHIT (PACKFILENAME.STRING 'VERSION NIL
+                                                                     'BODY DATUM)
                                                             T)))
                                           (CL:WHEN INFO2
                                               (CHANGE (FETCH (CDINFO FULLNAME) OF INFO2)
-                                                     (SLASHIT (CL:IF (STRPOS ";1" DATUM -2 NIL T)
-                                                                  (SUBSTRING DATUM 1 -3)
-                                                                  DATUM)
+                                                     (SLASHIT (PACKFILENAME.STRING 'VERSION NIL
+                                                                     'BODY DATUM)
                                                             T)))
                                           (IF MAP
                                               THEN 
@@ -1119,11 +1429,15 @@
                   (TERPRI T)
                   (IF (FETCH (CDVALUE CDENTRIES) OF CDVALUE)
                       THEN (SETQ LAST-BRANCH-CDVALUE CDVALUE)
-                           (CDBROWSER CDVALUE (CONCAT "Compare " BRANCH1 " and " BRANCH2 "      "
+                           (CDBROWSER CDVALUE (CONCAT "Comparing " (L-CASE (FETCH PROJECTNAME
+                                                                              OF PROJECT)
+                                                                          T)
+                                                     " " BRANCH1 " and " BRANCH2 "      "
                                                      (LENGTH (FETCH (CDVALUE CDENTRIES) OF CDVALUE))
                                                      " files")
                                   (LIST BRANCH1 BRANCH2)
-                                  `(LABELFN GIT-CD-LABELFN BRANCH1 ,BRANCH1 BRANCH2 ,BRANCH2)
+                                  `(LABELFN GIT-CD-LABELFN BRANCH1 ,BRANCH1 BRANCH2 ,BRANCH2 PROJECT
+                                          ,PROJECT)
                                   NIL
                                   `(Compare See))
                            (SETQ NENTRIES (LENGTH (FETCH (CDVALUE CDENTRIES) OF CDVALUE)))
@@ -1134,84 +1448,94 @@
            ELSE '(0 differences])
 
 (GIT-COMPARE-WITH-MYMEDLEY
-  [LAMBDA (SUBDIRS SELECT EXCLUDEDFILES TEDIT FIXDIRECTORYDATES UPDATE HOST1 HOST2)
+  [LAMBDA (SUBDIRS SELECT EXCLUDEDFILES FIXDIRECTORYDATES UPDATE PROJECT)
+                                                             (* ; "Edited 10-May-2022 10:41 by rmk")
 
     (* ;; 
     "Edited 29-Mar-2022 13:58 by rmk: my medley subdirectories with the current local git branch.")
 
-    (* ;; "Compares my medley subdirectories with the current local git branch.")
-
-    (CL:WHEN UPDATE (GIT-REMOTE-UPDATE))                     (* ; "Doesn't matter if we are looking only at local files in the current branch.  We aren't fetching or checking out.")
+    (SETQ PROJECT (GIT-GET-PROJECT PROJECT))
+    (CL:WHEN UPDATE (GIT-REMOTE-UPDATE NIL PROJECT))         (* ; "Doesn't matter if we are looking only at local files in the current branch.  We aren't fetching or checking out.")
     (CL:WHEN (AND (LISTP SUBDIRS)
                   (NULL (CDR SUBDIRS)))
         (SETQ SUBDIRS (CAR SUBDIRS)))
+    (CL:UNLESS SUBDIRS
+        (SETQ SUBDIRS (OR (FETCH DEFAULTSUBDIRS OF PROJECT)
+                          'ALL)))
     (SETQ SUBDIRS (L-CASE SUBDIRS))
-    (PRINTOUT T "Comparing " (SELECTQ SUBDIRS
-                                 (nil (SETQ SUBDIRS '(greetfiles scripts sources library lispusers)))
-                                 (all (SETQ SUBDIRS (ALLSUBDIRS HOST1 HOST2))
-                                      "ALL subdirectories")
-                                 SUBDIRS)
-           " of My Medley and "
-           (GIT-WHICH-BRANCH)
-           T)
-    (BKSYSBUF " ")
-    (for SUBDIR TITLE CDVAL (NENTRIES _ 0)
-         (BRANCH2 _ (GIT-WHICH-BRANCH)) INSIDE SUBDIRS
-       collect (TERPRI T)
-             (SETQ CDVAL (COMPAREDIRECTORIES (MYMEDLEYSUBDIR SUBDIR T)
-                                (GITSUBDIR SUBDIR T)
-                                (OR SELECT '(> < ~= -* *-))
-                                NIL GIT-IGNORE-FILES NIL NIL NIL FIXDIRECTORYDATES))
-             [FOR CDE IN (FETCH CDENTRIES OF CDVAL)
-                DO (CL:WHEN (FETCH INFO1 OF CDE)
-                       (CHANGE (FETCH (CDINFO FULLNAME) OF (FETCH INFO1 OF CDE))
-                              (UNSLASHIT DATUM T)))
-                   (CL:WHEN (FETCH INFO2 OF CDE)
-                       (CHANGE (FETCH (CDINFO FULLNAME) OF (FETCH INFO2 OF CDE))
-                              (SLASHIT DATUM T)))]
-             CDVAL
-       finally
+    (LET ((SUBDIRSTRING (IF (EQ SUBDIRS 'all)
+                            THEN (SETQ SUBDIRS (ALLSUBDIRS PROJECT))
+                                 "ALL subdirectories"
+                          ELSE SUBDIRS)))
+         (FOR SUBDIR TITLE CDVAL (MYPROJ _ (CONCAT "My " (L-CASE (FETCH PROJECTNAME OF PROJECT)
+                                                                T)))
+              (NENTRIES _ 0)
+              (BRANCH2 _ (GIT-WHICH-BRANCH PROJECT))
+            FIRST (PRINTOUT T "Comparing " SUBDIRSTRING " of " MYPROJ " and " BRANCH2 T)
+                  (BKSYSBUF " ") INSIDE SUBDIRS
+            COLLECT (TERPRI T)
+                  (SETQ CDVAL (COMPAREDIRECTORIES (MYMEDLEYSUBDIR SUBDIR T PROJECT)
+                                     (GITSUBDIR SUBDIR T PROJECT)
+                                     (OR SELECT '(> < ~= -* *-))
+                                     NIL
+                                     (FETCH EXCLUSIONS OF PROJECT)
+                                     NIL NIL NIL FIXDIRECTORYDATES))
+                  [FOR CDE IN (FETCH CDENTRIES OF CDVAL)
+                     DO (CL:WHEN (FETCH INFO1 OF CDE)
+                            (CHANGE (FETCH (CDINFO FULLNAME) OF (FETCH INFO1 OF CDE))
+                                   (UNSLASHIT DATUM T)))
+                        (CL:WHEN (FETCH INFO2 OF CDE)
+                            (CHANGE (FETCH (CDINFO FULLNAME) OF (FETCH INFO2 OF CDE))
+                                   (SLASHIT DATUM T)))]
+                  CDVAL
+            FINALLY 
 
-       (* ;; "Set up the browsers after everything has been done, otherwise if the user doesn't pay attention it might hang waiting for a region.")
+                  (* ;; "Set up the browsers after everything has been done, otherwise if the user doesn't pay attention it might hang waiting for a region.")
 
-       (CL:WHEN (AND (CDR $$VAL)
-                     GIT-MERGE-COMPARES)
-           (SETQ $$VAL (CDMERGE $$VAL))
-           [SETQ SUBDIRS (CONCATLIST (FOR SUBDIR IN SUBDIRS COLLECT (CONCAT SUBDIR "  "])
-       [for CDVAL TITLE IN $$VAL as SUBDIR inside SUBDIRS
-          do (SETQ TITLE (CONCAT "Compare  My Medley  and  " BRANCH2 "      " SUBDIR "         "
-                                (LENGTH (fetch (CDVALUE CDENTRIES) of CDVAL))
-                                " files"))
-             [if TEDIT
-                 then [CDTEDIT CDVAL TITLE `("My Medley" ,BRANCH2]
-               else (CDBROWSER CDVAL TITLE `("My Medley" ,BRANCH2)
-                           `(BRANCH1 "My Medley" BRANCH2 ,BRANCH2 SUBDIR ,SUBDIR LABELFN 
-                                   GIT-CD-LABELFN)
-                           NIL
-                           `(Compare See "" Copy% <- (|Delete ALL <-| GIT-CD-MENUFN)
-                                   ,@(CL:UNLESS (STRPOS "master" BRANCH2)
-                                         '("" Copy% -> (Delete% -> GIT-CD-MENUFN)))]
-             (CONS (CONCAT SUBDIR "/")
-                   (for CDENTRY in (fetch CDENTRIES of CDVAL) collect (fetch MATCHNAME of CDENTRY)))
-             (ADD NENTRIES (LENGTH (FETCH (CDVALUE CDENTRIES) OF CDVAL]
-       (SETQ LAST-MYMEDLEY-CDVALUES $$VAL)
-       (TERPRI T)
-       (RETURN (LIST NENTRIES (CL:IF (EQ NENTRIES 1)
-                                  'difference
-                                  'differences)])
+                  (CL:WHEN (AND (CDR $$VAL)
+                                GIT-MERGE-COMPARES)
+                      (SETQ $$VAL (CDMERGE $$VAL))
+                      [SETQ SUBDIRS (CONCATLIST (FOR SUBDIR IN SUBDIRS COLLECT (CONCAT SUBDIR "  "])
+                  [FOR CDVAL TITLE IN $$VAL AS SUBDIR INSIDE SUBDIRS
+                     DO (SETQ TITLE (CONCAT "Comparing " MYPROJ " and  " BRANCH2 "      " SUBDIR 
+                                           "         " (LENGTH (fetch (CDVALUE CDENTRIES)
+                                                                  of CDVAL))
+                                           " files"))
+                        [CDBROWSER CDVAL TITLE `(,MYPROJ ,BRANCH2)
+                               `(BRANCH1 ,MYPROJ BRANCH2 ,BRANCH2 SUBDIR ,SUBDIR LABELFN 
+                                       GIT-CD-LABELFN PROJECT ,PROJECT)
+                               NIL
+                               `(Compare See "" Copy% <- (|Delete ALL <-| GIT-CD-MENUFN)
+                                       ,@(CL:UNLESS (GIT-MAINBRANCH? BRANCH2 PROJECT T)
+                                             '("" Copy% -> (Delete% -> GIT-CD-MENUFN)))]
+                        (CONS (CONCAT SUBDIR "/")
+                              (FOR CDENTRY IN (fetch CDENTRIES of CDVAL)
+                                 COLLECT (fetch MATCHNAME of CDENTRY)))
+                        (ADD NENTRIES (LENGTH (FETCH (CDVALUE CDENTRIES) OF CDVAL]
+                  (SETQ LAST-MYMEDLEY-CDVALUES $$VAL)
+                  (TERPRI T)
+                  (RETURN (LIST NENTRIES (CL:IF (EQ NENTRIES 1)
+                                             'difference
+                                             'differences)])
 
 (GIT-COMPARE-WORKTREE
-  [LAMBDA (BRANCH DONTUPDATE)                               (* ; "Edited 25-Nov-2021 08:49 by rmk:")
-                                                            (* ; "Edited 19-Nov-2021 21:54 by rmk:")
-    (PRINTOUT T T "Comparing origin/" BRANCH " and origin/master" T)
+  [LAMBDA (BRANCH DONTUPDATE PROJECT)                        (* ; "Edited  9-May-2022 16:17 by rmk")
     (CL:UNLESS DONTUPDATE
-        (GIT-ADD-WORKTREE BRANCH T)
-        (GIT-ADD-WORKTREE "master" T))
-    (LET (ADDEDFILES DELETEDFILES SOURCEFILES COMPILEDFILES OTHERFILES)
-         (FOR FILE BFILE MFILE IN (GIT-BRANCH-DIFF BRANCH 'origin/master)
-            DO (SETQ BFILE (INFILEP (CONCAT (WORKTREEDIR BRANCH)
+        (GIT-ADD-WORKTREE BRANCH T PROJECT)
+        (GIT-ADD-WORKTREE (GIT-MAINBRANCH PROJECT)
+               T PROJECT))
+    (LET (ADDEDFILES DELETEDFILES SOURCEFILES COMPILEDFILES OTHERFILES (MAINBRANCH (GIT-MAINBRANCH
+                                                                                    PROJECT)))
+         (CL:UNLESS DONTUPDATE
+             (GIT-ADD-WORKTREE BRANCH T PROJECT)
+             (GIT-ADD-WORKTREE MAINBRANCH T PROJECT))
+         (PRINTOUT T T "Comparing " (GIT-GET-PROJECT PROJECT NIL 'PROJECTNAME)
+                (FETCH PROJECTNAME OF PROJECT)
+                " origin/" BRANCH " and " MAINBRANCH T)
+         (FOR FILE BFILE MFILE IN (GIT-BRANCH-DIFF BRANCH MAINBRANCH PROJECT)
+            DO (SETQ BFILE (INFILEP (CONCAT (WORKTREEDIR BRANCH PROJECT)
                                            FILE)))
-               (SETQ MFILE (INFILEP (CONCAT (WORKTREEDIR 'master)
+               (SETQ MFILE (INFILEP (CONCAT (WORKTREEDIR MAINBRANCH PROJECT)
                                            FILE)))
                (IF (AND BFILE MFILE)
                    THEN (IF (NOT (LISPSOURCEFILEP BFILE))
@@ -1235,9 +1559,9 @@
                 DO (SETQ FILE (CAR FILETAIL))
                    (PRINTOUT T 2 FILE T)
                    (SETQ FILE (CAR FILETAIL))
-                   (SETQ BFILE (INFILEP (CONCAT (WORKTREEDIR BRANCH)
+                   (SETQ BFILE (INFILEP (CONCAT (WORKTREEDIR BRANCH PROJECT)
                                                FILE)))
-                   (SETQ MFILE (INFILEP (CONCAT (WORKTREEDIR 'master)
+                   (SETQ MFILE (INFILEP (CONCAT (WORKTREEDIR MAINBRANCH PROJECT)
                                                FILE)))
                    (COMPARESOURCES-TEDIT BFILE MFILE)
                    (TTY.PROCESS T)
@@ -1252,9 +1576,9 @@
                 DO (SETQ FILE (CAR FILETAIL))
                    (PRINTOUT T 2 FILE)
                    (SETQ FILE (CAR FILETAIL))
-                   (SETQ BFILE (INFILEP (CONCAT (WORKTREEDIR BRANCH)
+                   (SETQ BFILE (INFILEP (CONCAT (WORKTREEDIR BRANCH PROJECT)
                                                FILE)))
-                   (SETQ MFILE (INFILEP (CONCAT (WORKTREEDIR 'master)
+                   (SETQ MFILE (INFILEP (CONCAT (WORKTREEDIR MAINBRANCH PROJECT)
                                                FILE)))
                    (COMPARETEXT BFILE MFILE 'LINE)
                    (AND NIL (TEDIT-SEE BFILE)
@@ -1264,12 +1588,8 @@
                           (WAITFORINPUT))))])
 
 (GITCDOBJBUTTONFN
-  [LAMBDA (OBJ WINDOW)                                       (* ; "Edited 20-Dec-2021 09:57 by rmk")
-                                                             (* ; "Edited 15-Dec-2021 20:47 by rmk")
-                                                             (* ; "Edited 27-Nov-2021 12:19 by rmk:")
-                                                             (* ; "Edited 26-Nov-2021 08:51 by rmk:")
-                                                             (* ; "Edited 23-Nov-2021 12:39 by rmk:")
-                                                             (* ; "Edited  8-Nov-2021 08:46 by rmk:")
+  [LAMBDA (OBJ WINDOW)                                       (* ; "Edited 10-May-2022 00:30 by rmk")
+    (HELP)
     (LET
      ([CDENTRY (CAR (IMAGEOBJPROP OBJ 'OBJECTDATUM]
       (BRANCH1 (WINDOWPROP WINDOW 'BRANCH1))
@@ -1361,10 +1681,7 @@
                (OR LABEL2 FILE2])
 
 (GIT-CD-MENUFN
-  [LAMBDA (TBITEM MENUITEM CDBROWSER KEY)                    (* ; "Edited 24-Feb-2022 11:30 by rmk")
-                                                             (* ; "Edited  5-Feb-2022 17:36 by rmk")
-                                                             (* ; "Edited 19-Dec-2021 23:28 by rmk")
-                                                             (* ; "Edited 16-Dec-2021 13:49 by rmk")
+  [LAMBDA (TBITEM MENUITEM CDBROWSER KEY)                    (* ; "Edited  8-May-2022 09:26 by rmk")
                                                              (* ; "Edited 10-Dec-2021 08:52 by rmk")
 
     (* ;; "MENUITEM is of the form (display-atom <this function> . extrainfo).  The selector for the selectq is either the CAR of the extrainfo or the display atom")
@@ -1378,7 +1695,7 @@
                       ELSE (GIVE.TTY.PROCESS PWINDOW)
                            (CL:WHEN [OR (EQ KEY 'MIDDLE)
                                         (EQ 'Y (ASKUSER NIL 'N (CONCAT "Delete " LABEL2 " ? "]
-                               (GIT-DELETE-FILE FILE2)
+                               (GIT-DELETE-FILE FILE2 (LISTGET USERDATA 'PROJECT))
                                (TB.DELETE.ITEM CDBROWSER TBITEM))))
         (|Delete ALL <-| 
              (FLASHWINDOW PWINDOW)
@@ -1389,7 +1706,7 @@
                                  (EQ 'Y (ASKUSER NIL 'N (CONCAT "Delete ALL versions of "
                                                                (NAMEFIELD LABEL1 T)
                                                                " ? "]
-                        (MYMEDLEY-DELETE-FILES FILE1)
+                        (MYMEDLEY-DELETE-FILES FILE1 (LISTGET USERDATA 'PROJECT))
                         (TB.DELETE.ITEM CDBROWSER TBITEM))))
         (Delete% BOTH (FLASHWINDOW PWINDOW)
                       (GIVE.TTY.PROCESS PWINDOW)
@@ -1397,8 +1714,8 @@
                                                              "Delete all Medley and git versions of "
                                                              (NAMEFIELD LABEL1 T)
                                                              " ? ")))
-                          (GIT-DELETE-FILE FILE2)
-                          (MYMEDLEY-DELETE-FILES FILE1)
+                          (GIT-DELETE-FILE FILE2 (LISTGET USERDATA 'PROJECT))
+                          (MYMEDLEY-DELETE-FILES FILE1 (LISTGET USERDATA 'PROJECT))
                           (TB.DELETE.ITEM CDBROWSER TBITEM)))
         (SHOULDNT])
 )
@@ -1417,28 +1734,21 @@
 (DEFINEQ
 
 (CDGITDIR
-  [LAMBDA (GITCLONE)                                         (* ; "Edited  5-Mar-2022 19:48 by rmk")
-                                                             (* ; "Edited  5-Feb-2022 11:35 by rmk")
-                                                             (* ; "Edited 18-Jan-2022 15:37 by rmk")
-                                                            (* ; "Edited 16-Nov-2021 10:16 by rmk:")
+  [LAMBDA (PROJECT)                                          (* ; "Edited  7-May-2022 22:41 by rmk")
                                                             (* ; "Edited  2-Nov-2021 21:12 by rmk:")
 
     (* ;; "Strips off {UNIX}")
 
-    (CONCAT "cd " [SLASHIT (STRIPHOST (TRUEFILENAME (GIT-CLONEP GITCLONE]
+    (CONCAT "cd " [SLASHIT (STRIPHOST (TRUEFILENAME (FETCH GITHOST OF PROJECT]
            " ; "])
 
 (GIT-COMMAND
-  [LAMBDA (CMD ALL NOERROR)                                  (* ; "Edited  6-Mar-2022 15:53 by rmk")
-                                                             (* ; "Edited 25-Feb-2022 09:25 by rmk")
-                                                             (* ; "Edited  3-Jan-2022 10:47 by rmk")
-                                                            (* ; "Edited 24-Nov-2021 16:44 by rmk:")
-                                                            (* ; "Edited 16-Nov-2021 09:07 by rmk:")
-                                                            (* ; "Edited  2-Nov-2021 21:08 by rmk:")
+  [LAMBDA (CMD ALL NOERROR PROJECT)                          (* ; "Edited  7-May-2022 22:40 by rmk")
                                                             (* ; "Edited  7-Oct-2021 11:15 by rmk:")
 
     (* ;; "Suppress .git lines unless ALL")
 
+    (SETQ PROJECT (GIT-GET-PROJECT PROJECT))
     (CL:UNLESS (OR (EQ 1 (STRPOS "git" CMD))
                    (EQ 1 (STRPOS "gh" CMD)))
         (SETQ CMD (CONCAT "git " CMD)))
@@ -1446,7 +1756,7 @@
        DO (SETQ CMD (CONCAT (SUBSTRING CMD 1 (SUB1 LPOS))
                            (SUBSTRING CMD (IPLUS LPOS (NCHARS "local/"]
     (CL:WITH-OPEN-FILE (STREAM "{NODIRCORE}shell-dribble.txt" :DIRECTION :IO)
-           (ShellCommand (CONCAT (CDGITDIR)
+           (ShellCommand (CONCAT (CDGITDIR PROJECT)
                                 CMD)
                   STREAM)
            (SETFILEPTR STREAM 0)
@@ -1462,12 +1772,13 @@
                                      (CAR $$VAL))))])
 
 (GITORIGIN
-  [LAMBDA (BRANCH LOCAL)                                    (* ; "Edited 25-Nov-2021 08:47 by rmk:")
+  [LAMBDA (BRANCH LOCAL)                                     (* ; "Edited  9-May-2022 14:26 by rmk")
+                                                            (* ; "Edited 25-Nov-2021 08:47 by rmk:")
                                                             (* ; "Edited 22-Nov-2021 17:29 by rmk:")
 
     (* ;; "Insures origin/ unless LOCAL or local/ already")
 
-    (CL:UNLESS BRANCH (SETQ BRANCH "master"))
+    (CL:UNLESS BRANCH (HELP "BRANCH MUST BE SPECIFIED"))
     (IF (OR (STRPOS "origin/" BRANCH)
             (STRPOS "local/" BRANCH))
         THEN BRANCH
@@ -1485,23 +1796,26 @@
         (ERROR "INITIALS is not set"])
 )
 (DECLARE%: DONTCOPY
-  (FILEMAP (NIL (4721 5567 (GIT-CLONEP 4731 . 5565)) (7335 9315 (ALLSUBDIRS 7345 . 8513) (MEDLEYSUBDIRS 
-8515 . 8954) (GITSUBDIRS 8956 . 9313)) (9316 14790 (TOGIT 9326 . 11474) (FROMGIT 11476 . 12454) (
-GIT-DELETE-FILE 12456 . 13350) (MYMEDLEY-DELETE-FILES 13352 . 14788)) (14791 16940 (MYMEDLEYSUBDIR 
-14801 . 15247) (GITSUBDIR 15249 . 15572) (STRIPDIR 15574 . 15945) (STRIPHOST 15947 . 16183) (STRIPNAME
- 16185 . 16938)) (16941 18469 (GFILE4MFILE 16951 . 17197) (MFILE4GFILE 17199 . 17541) (
-GIT-REPO-FILENAME 17543 . 18467)) (18518 29311 (GIT-COMMIT 18528 . 19106) (GIT-PUSH 19108 . 19664) (
-GIT-PULL 19666 . 20072) (GIT-BRANCH-DIFF 20074 . 23895) (GIT-APPROVAL 23897 . 24098) (GIT-GET-FILE 
-24100 . 26400) (GIT-FILE-EXISTS? 26402 . 27229) (GIT-REMOTE-UPDATE 27231 . 28273) (GIT-REMOTE-ADD 
-28275 . 28582) (GIT-FILE-DATE 28584 . 29309)) (29356 39349 (GIT-CHECKOUT 29366 . 29607) (
-GIT-WHICH-BRANCH 29609 . 30193) (GIT-MAKE-BRANCH 30195 . 31686) (GIT-BRANCHES 31688 . 32862) (
-GIT-BRANCH-EXISTS? 32864 . 34061) (GIT-PICK-BRANCH 34063 . 34517) (GIT-PRC-MENU 34519 . 35819) (
-GIT-PULL-REQUESTS 35821 . 36717) (GIT-BRANCH-RELATIONS 36719 . 39347)) (39379 42211 (
-GIT-MY-CURRENT-BRANCH 39389 . 39562) (GIT-MY-BRANCHP 39564 . 40483) (GIT-MY-NEXT-BRANCH 40485 . 40926)
- (GIT-MY-BRANCHES 40928 . 42209)) (42257 46149 (GIT-ADD-WORKTREE 42267 . 44149) (GIT-REMOVE-WORKTREE 
-44151 . 44729) (GIT-LIST-WORKTREES 44731 . 45535) (WORKTREEDIR 45537 . 46147)) (46197 73219 (
-GIT-GET-DIFFERENT-FILES 46207 . 51527) (GIT-COMPARE-BRANCHES 51529 . 57321) (GIT-COMPARE-WITH-MYMEDLEY
- 57323 . 61081) (GIT-COMPARE-WORKTREE 61083 . 64560) (GITCDOBJBUTTONFN 64562 . 69566) (GIT-CD-LABELFN 
-69568 . 70650) (GIT-CD-MENUFN 70652 . 73217)) (73289 76958 (CDGITDIR 73299 . 73995) (GIT-COMMAND 73997
- . 76071) (GITORIGIN 76073 . 76650) (GIT-INITIALS 76652 . 76956)))))
+  (FILEMAP (NIL (3224 15673 (GIT-CLONEP 3234 . 4497) (GIT-MAKE-PROJECT 4499 . 11213) (GIT-GET-PROJECT 
+11215 . 12552) (GIT-PROJECT-PATH 12554 . 13598) (FIND-ANCESTOR-DIRECTORY 13600 . 13949) (
+GIT-FIND-CLONE 13951 . 15032) (GIT-MAINBRANCH 15034 . 15318) (GIT-MAINBRANCH? 15320 . 15671)) (20524 
+23312 (ALLSUBDIRS 20534 . 21820) (MEDLEYSUBDIRS 21822 . 22515) (GITSUBDIRS 22517 . 23310)) (23313 
+28103 (TOGIT 23323 . 24729) (FROMGIT 24731 . 25712) (GIT-DELETE-FILE 25714 . 26560) (
+MYMEDLEY-DELETE-FILES 26562 . 28101)) (28104 30636 (MYMEDLEYSUBDIR 28114 . 28570) (GITSUBDIR 28572 . 
+29015) (STRIPDIR 29017 . 29388) (STRIPHOST 29390 . 29630) (STRIPNAME 29632 . 30385) (STRIPWHERE 30387
+ . 30634)) (30637 32539 (GFILE4MFILE 30647 . 31010) (MFILE4GFILE 31012 . 31581) (GIT-REPO-FILENAME 
+31583 . 32537)) (32588 40339 (GIT-COMMIT 32598 . 33424) (GIT-PUSH 33426 . 34070) (GIT-PULL 34072 . 
+34684) (GIT-APPROVAL 34686 . 35035) (GIT-GET-FILE 35037 . 37506) (GIT-FILE-EXISTS? 37508 . 38452) (
+GIT-REMOTE-UPDATE 38454 . 39178) (GIT-REMOTE-ADD 39180 . 39487) (GIT-FILE-DATE 39489 . 40337)) (40369 
+49297 (GIT-BRANCH-DIFF 40379 . 45082) (GIT-COMMIT-DIFFS 45084 . 45528) (GIT-BRANCH-RELATIONS 45530 . 
+49295)) (49342 57178 (GIT-CHECKOUT 49352 . 49864) (GIT-WHICH-BRANCH 49866 . 50164) (GIT-MAKE-BRANCH 
+50166 . 51399) (GIT-BRANCHES 51401 . 52378) (GIT-BRANCH-EXISTS? 52380 . 53397) (GIT-PICK-BRANCH 53399
+ . 54188) (GIT-PRC-MENU 54190 . 56157) (GIT-PULL-REQUESTS 56159 . 57176)) (57208 60548 (
+GIT-MY-CURRENT-BRANCH 57218 . 57508) (GIT-MY-BRANCHP 57510 . 58546) (GIT-MY-NEXT-BRANCH 58548 . 59142)
+ (GIT-MY-BRANCHES 59144 . 60546)) (60594 64546 (GIT-ADD-WORKTREE 60604 . 62088) (GIT-REMOVE-WORKTREE 
+62090 . 63020) (GIT-LIST-WORKTREES 63022 . 63826) (WORKTREEDIR 63828 . 64544)) (64594 92310 (
+GIT-GET-DIFFERENT-FILES 64604 . 70330) (GIT-COMPARE-BRANCHES 70332 . 76046) (GIT-COMPARE-WITH-MYMEDLEY
+ 76048 . 80505) (GIT-COMPARE-WORKTREE 80507 . 84380) (GITCDOBJBUTTONFN 84382 . 88872) (GIT-CD-LABELFN 
+88874 . 89956) (GIT-CD-MENUFN 89958 . 92308)) (92380 95363 (CDGITDIR 92390 . 92768) (GIT-COMMAND 92770
+ . 94356) (GITORIGIN 94358 . 95055) (GIT-INITIALS 95057 . 95361)))))
 STOP
diff --git a/lispusers/GITFNS.LCOM b/lispusers/GITFNS.LCOM
index f2f93044..a06f9731 100644
Binary files a/lispusers/GITFNS.LCOM and b/lispusers/GITFNS.LCOM differ
diff --git a/lispusers/GITFNS.TEDIT b/lispusers/GITFNS.TEDIT
index 54e04ff9..b09d9acc 100644
--- a/lispusers/GITFNS.TEDIT
+++ b/lispusers/GITFNS.TEDIT
@@ -3,50 +3,90 @@ Medley	GITFNS2
 
1
 
GITFNS
1
 
4
-
By Ron Kaplan
This document was created in January  2022.

GITFNS provides a Medley-oriented interface for comparing the files in two different branches of a git repository.  This makes it easier to understand what functions or other definitions have changed in a Lisp source file, or what text has changed in a Tedit file.  This may be particularly helpful in evaluating the changes in a pull request.
+
By Ron Kaplan
This document was last edited in May  2022.

GITFNS provides a Medley-oriented interface for comparing the files in two different branches of a git repository.  This makes it easier to understand what functions or other definitions have changed in a Lisp source file, or what text has changed in a Tedit file.  This may be particularly helpful in evaluating the changes in a pull request.
 Separately, GITFNS also provides tools and conventions for bridging between git's file-oriented style of development and version control and Medley's residential development style with its own version control conventions.  GITFNS allows for intelligent comparisons between Lisp source files,Tedit files, and text files in a local git clone and a local Medley-style working directory, and for migrating files to and from the git clone and the working directory.
 
-Comparing directories and files in different git branches 
-In its simplest application, GITFNS is just an off-to-the-side add-on to whatever work practices the user has developed with respect to a local git clone.  Its only advantage is to allow for more interpretable git-branch comparisons, especially for PR's.  This is enabled once GITFNS is made aware of the local-machine location of the cloned repository.  The default assumption is that the variable MEDLEYDIR holds the path to the top-level of the local clone.  That becomes the path-prefix for the pseudohost {GIT} (see lispusers/PSEUDOHOSTS).  {GIT} is then used as the default handle for local/ and origin/ branch comparisons.  Just for clarity (and for compatibility with the additional capabilities described below), the variable GITMEDLEYHOST is set to MEDLEYDIR, and GITMEDLEYHOST is set to {GIT}. {GIT} defaults to a pseudohost on the {UNIX} file device, so it provides a git-like case-sensitive unversioned file system.
-The main use-case is the Lisp-oriented file comparisons for pull-request approval.  These comparisons are provided by the prc ("pull request compare") Medley executive command:
-prc  (branch)   (DRAFT)     [command]
-This compares the files in branch against the files in origin/master.  Thus, suppose that a pull request has been issued on github for a particular branch, say branch rmk15.  Then
-    prc rmk15
+Git projects:  Connecting git clones to GITFNS capabilities 
+The GITFNS capabilities operate on pre-existing clones of remote git repositories that have been installed at the end of some path on the local disk.  The path to a clone can be used to create a "git project" for  that clone:
+(GIT-MAKE-PROJECT PROJECTNAME PROJECTPATH WORKINGPATH EXCLUSIONS 
+                  DEFAULTSUBDIRS)     [function]
+where
+	PROJECTNAME is the name of the project (e.g. MEDLEY, NOTECARDS, LOOPS...) 
+  PROJECTPATH is the local path to the clone
+            (e.g. {dsk}<users>...>git-medley)
+  WORKINGPATH is optionally the local path to a corresponding Medley-residential working directory (e.g. {dsk}<users>...>my-medley>)
+When the project has a WORKINGPATH:
+  EXCLUSIONS is a list of files and directories to be excluded from comparisons (beyond what its .GITIGNORE specifies)
+  DEFAULTSUBDIRS is a list of subdirectories to be use in working-path comparisons when directories are not otherwise specified.
+
+For convenience, if PROJECTPATH is NIL or T (and not a path), then a squence of probes based on PROJECTNAME attempts to find a clone directory (with a .git subdirectory):
+    (UNIX-GETENV PROJECTNAME)
+    (UNIX-GETENV (CONCAT PROJECTNAME 'DIR)
+    (CONCAT MEDLEYDIR "../git-" PROJECTNAME)  
+        (a sister of MEDLEYDIR named git-PROJECTNAME, e.g. git-notecards)
+Thus:
+If MEDLEYDIR is defined,
+   (GIT-MAKE-PROJECT 'MEDLEY) will make the MEDLEY  project
+If NOTECARDS is defined
+   (GIT-MAKE-PROJECT 'NOTECARDS) will make the NOTECARDS project
+If NOTECARDS is not defined but the clone >git-notecards> is a sister of MEDLEYDIR, then the NOTECARDS project will still be created.
+If a clone is discovered and a project is created, the value of GIT-MAKE-PROJECT is PROJECTNAME.  Otherwise,  NIL will be returned if PROJECTPATH is T, and PROJECTPATH=NIL will result in an error.
+
+When GITFNS is loaded, GIT-MAKE-PROJECT is called for MEDLEY, NOTECARDS, and LOOPS, with PROJECTPATH=T. Thus, those projects will be created automatically, if MEDLEYDIR is defined and the relevant directories exist in their expected relative positions.
+When they are created, GIT-PROJECTS are registered by name on the a-list GIT-PROJECTS, and they are otherwise referenced by their names.
+The variable GIT-DEFAULT-PROJECT, initially MEDLEY, contains the project name used by the commands below when the optional projectname argument is not provided.
+GIT-MAKE-PROJECT also creates a pseudohost {Gprojectname} whose path prefix is the prefix for the project's clone.  If WORKINGPATH is provided, then a second pseudohost {Wprojectname} points to the working files for the project.
+GITFNS also defines two directory-connecting commands for conveniently connecting to the git and working pseudohosts of a project:
+cdg (projectname) (subdir)    [command]
+cdw (projectname) (subdir)    [command
+For example, cdg notecards library  connects to {GNOTECARDS}/library/.
+
+Comparing directories and files in different git branches
+In its simplest application, GITFNS is just an off-to-the-side add-on to whatever work practices the user has developed with respect to a locally installed git project.  Its only advantage is to allow for more interpretable git-branch comparisons, especially for pull-request approval. These comparisons are provided by the prc ("pull request compare") Medley executive command:
+prc  (branch)   (DRAFT)  (projectname)   [command]
+This compares the files in branch against the files in the main branch of the project (origin/master or origin/main).  Thus, suppose that a pull request has been issued on github for a particular branch, say branch rmk15 of the default project.  Then
+    prc rmk15 
 brings up a lispusers/COMPAREDIRECTORIES browser for the files that currently differ between origin/rmk15 and origin/master. If the selected files are Lisp source files, the Compare item on the file browser menu will show the differences in a lispusers/COMPARESOURCES browser. The differences for other file types will be shown in a lispusers/COMPARETEXT browser.
 If branch is not specified and the shell command gh is available, then a menu of open pull-request branches will be provided.  If gh is not available, the menu will offer all known branches.  If the optional DRAFT is provided, then the menu will include draft PR's as well as open ones.
-Note that the comparison that this provides is essentially read-only: any comments, approvals, or merges of the branch must be specified using the normal Medley-external git interfaces and commands.
+If one PR, say rmk15, contains all the commits of another (rmk14), then the menu will indicate this by
+     rmk15 > rmk14
+Note that the prc comparison is  read-only: any comments, approvals, or merges of the branch must be specified using the normal Medley-external git interfaces and commands.
 
 prc is the special case of the more general bbc command ("branch-branch compare) for comparing the files in any two branches:
-bbc  branch1   branch2        [command]
+bbc  branch1   branch2  (project)     [command]
 This compares the files in branch1 and branch2, for example
      bbc rmk15 lmm12   (local)
-This will compare the files in origin/rmk15 and origin/lmm12.  branch1 defaults to the origin files of the currently checked out branch, the second defaults to origin/master.  If local is non-NIL, then a branch that has neither local/ or origin/ prepended will default to local (e.g. local/rmk15) instead of origin/.  Local refers to the files that are currently in the clone directory, which may not be the same as the origin files, depending on the push/pull status.  
+This will compare the files in origin/rmk15 and origin/lmm12 in the GIT-DEFAULT project.  branch1 defaults to the origin files of the currently checked out branch, the second defaults to origin/master.  If local is non-NIL, then a branch that has neither local/ or origin/ prepended will default to local (e.g. local/rmk15) instead of origin/.  Local refers to the files that are currently in the clone directory, which may not be the same as the origin files, depending on the push/pull status.  
 
 The command cob ("check out branch") checks out a specified branch:
-cob  branch        [command]
-This checks out branch and then executes git pull.  The branch parameter may also be a local branch, T (= my current branch), or NEW/NEXT (= my next branch).  My current branch is a the branch named <initials>nnn, e.g. rmk15.  The initials are the value of INITIALS as used for SEDIT time stamps, and nnn is the largest of the integers of all of the branches beginning with those initials. If branch is NEW or NEXT, then a new initialed branch is created and becomes the user's current branch.  Its number  is one greater than the largest number of previous initialed branches.
+cob  branch  (project)      [command]
+This checks out branch of project and then executes git pull.  The branch parameter may also be a local branch, T (= my current branch), or NEW/NEXT (= my next branch).  My current branch is a the branch named <initials>nnn, e.g. rmk15.  The initials are the value of INITIALS as used for SEDIT time stamps, and nnn is the largest of the integers of all of the branches beginning with those initials. If branch is NEW or NEXT, then a new initialed branch is created and becomes the user's current branch.  Its number  is one greater than the largest number of previous initialed branches.
 If branch is not provided, a menu of locally available branches pops up.
 
 The currently checked out branch is obtained by the b? command:
-b?      [command]
+b?  (project)    [command]
 
 Correlating git source control with separate Medley development
-It is generally unsafe to do Medley development by operating with files in the local clone repository.  Medley provides a residential development environment that integrates tightly with the local file system.  It is important to have consistent access to the source files of the currently running system, especially for files whose contents have been only partially loaded. A git pull or a branch switch that introduces new versions of some files or removes old files altogether can lead to unpredictable disconnects that are hard to recover from.  This is true also because development can go on in the same Medley memory image for days if not weeks, so it is important to have explicit control of any file version changes.
-GITFNS mitigates the danger by conventions that separate the files in the git clone from the files in the working Medley development directory.  The Medley development source tree is referred to as "My Medley" as opposed to the source-tree of the locally checked out branch of the repository ("Git Medley").  My Medley resides at a path provided by the Unix variable MYMEDLEYDIR, obtained by (UNIX-GETENV "MYMEDLEYDIR"), and (UNIX-GETENV "GITMEDLEYDIR") gives the location of the git clone . (If MYMEDLEYDIR is not defined, then my Medley source tree is assumed to exist at MEDLEYDIR.) MYMEDLEYDIR is the path-prefix for a pseudohost {MM} and GITMEDLEYDIR is the prefix for {GIT}. These pseudohosts are the respective values of the variables MYMEDLEYHOST and GITMEDLEYHOST.  {MM} defaults to a pseudohost on the case insensitive, versioned {DSK} file device, {GIT} defaults to {UNIX}.
-The Medley variables for directory search paths (DIRECTORIES, LISPUSERSDIRECTORIES, FONTDIRECTORIES, etc.) all have MEDLEYDIR as a prefix, and the development environment makes no reference to GITMEDLEYDIR.  Any back and forth transfer of information between the git clone and Medley development must be done by explicit synchronization actions.  Crucially, Medley-updated files do not appear in the clone directories and new clone files do not move to the Medley directories without user intervention.
-The files in My Medley and Git Medley can be compared with the gmc ("git-my-medley compare") command:
-gmc  subdirectories       [command]
-This produces a browser for all the files in the corresponding  Medley subdirectories that differ from the files in the currently checked out branch of the git clone.  If subdirectories is omitted, it defaults to sources library lispusers. If it is ALL, then files in all My Medley subdirectories are examined.
-In addition to the commands for comparing and viewing files, the menu for this browser also has commands for copying files from the git clone {GIT} to My Medley and deleting files from {MM}. If the master branch is current, then the menu has no commands to change the files in the clone. The browser will show those files that have been updated from a recent merge, and they can individually be copied to new My Medley versions in order to realign the two source trees.  If the comparison is with a different branch, say the user's current staging branch, copying files from My Medley to git or deleting git files will set git up for future commits.  
-Note that the menu item for deleting My Medley files will cause all version to be removed, not just the latest one, to avoid the possibility that an earlier one is revealed. Deletion for My Medley files is also accomplished by renaming to a {MM}<deletion> subdirectory so that they can be recovered if a deletion is in error. Files in the git-clone are removed from the file system immediately, since git provides its own recovery mechanism for those files.
+It is generally unsafe to do Medley development by operating with files in a local clone repository.  Medley provides a residential development environment that integrates tightly with the local file system.  It is important to have consistent access to the source files of the currently running system, especially for files whose contents have been only partially loaded. A git pull or a branch switch that introduces new versions of some files or removes old files altogether can lead to unpredictable disconnects that are hard to recover from.  This is true also because development can go on in the same Medley memory image for days if not weeks, so it is important to have explicit control of any file version changes.
+GITFNS mitigates the danger by conventions that separate the files in the git clone from the files in the working Medley development directory.  The location of the Medley development source tree for a project is given by the WORKINGPATH argument to GIT-MAKE-PROJECT.  If WORKINGPATH is T or NIL and there exists a directory >MY-projectname> as a sister to the clone, then that is taken to be the WORKINGPATH and thus the prefix for a pseudohost {Wprojectname}.
+When Medley development is carried out in the WORKINGPATH, the variable MEDLEYDIR should point initially to the working directory, and the directory search paths (DIRECTORIES, LISPUSERSDIRECTORIES, FONTDIRECTORIES, etc.) all have MEDLEYDIR as a prefix.  In that case, the clone for the project, if PROJECTPATH doesn't specify it explicitly, should be located at the >git-medley> sister directory of MEDLEYDIR.
+Any back and forth transfer of information between the git clone and Medley development must be done by explicit synchronization actions.  Crucially, Medley-updated files do not appear in the clone directories and new clone files do not move to the Medley directories without user intervention.
+The files in Medley working tree and the git clone of a project can be compared with the gmc ("git-my-compare") command:
+gmc  subdirectories (project)       [command]
+This produces a browser for all the files in the corresponding WORKINGPATH  subdirectories that differ from the files in the currently checked out branch of the git clone.  If subdirectories is omitted, it defaults to the DEFAULTSUBDIRS or the project. If it is ALL, then files in all subdirectoriesthat are not found in the project's EXCLUSIONS are compared.
+In addition to the commands for comparing and viewing files, the menu for this browser also has commands for copying files from the git clone {Gprojectname} to {Wprojectname} and deleting files from {Wprojectname}. 
+If master/main branch is the current branch then the menu has no commands to change the clone directory. The browser will show those files that have been updated from a recent merge, and they can individually be copied from the git branch to realign the two source trees with incremented Medley version numbers.  If the comparison is with a different branch, say the user's current staging branch, copying files from the working Medley to to the git clone or deleting git files will set git up for future commits.  
+Note that the menu item for deleting Medley files will cause all version to be removed, not just the latest one, to avoid the possibility that an earlier one is revealed. Deletion for Medley files is also accomplished by renaming to a {Wprojectname}<deletion> subdirectory so that they can be recovered if a deletion is in error. Files in the git-clone are removed from the file system immediately, since git provides its own recovery mechanism for those files.
 GITFNS does not (yet?) include functions for commits, pushes, or merges for updating the remote repository. Those have to be done outside of Medley through the usual github interfaces, as guided by the information provided by the comparisons.
-(LIST ((PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC) STARTINGPAGE# 1) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC)) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC)) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC)) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC)) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC)) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL)))))4ÈÈ4ÈÈ.È.ŠŠ8.ŠŠ8JÈÈPAGEHEADINGRUNNINGHEADMODERN
+(LIST ((PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC) STARTINGPAGE# 1) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC)) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC)) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC)) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC)) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC)) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL)))))
.È4ÈÈ4ÈÈ4ÈÈ4ÈÈ4ÈÈ4ÈÈ4ÈÈ4ÈÈ.È.ŠŠ8.ŠŠ8JÈÈPAGEHEADINGRUNNINGHEADMODERN
 TIMESROMAN$TERMINALMODERN
 MODERNMODERN
 MODERN
-HRULE.GETFNHRULE.GETFNMODERN
-HRULE.GETFNMODERN
-HRULE.GETFNMODERNHRULE.GETFNMODERN,RÍè9l	f¸
	
!Pz4&
c5
3>B
-ÇJÇ)O(	<wD$(?!
x¤I@?Öv+C	%?
=0:
-	D*Y
	«.
Ž&d
-T
ñ¾
à!ñúzº
\ No newline at end of file
+
HRULE.GETFNHRULE.GETFNMODERN
+HRULE.GETFNMODERN
+HRULE.GETFNMODERNHRULE.GETFNMODERN
+	,		R	Íè		;	âB1	L-.…$w a		�			
		/	27#h	ã		ß		k		ƒ		Ç	ƒ	(	'G		!				=c				5
3>B	
+	Ç,		I			À		)1									<’		&				$(?!
x†		I		""		¶		ª	D	¯:
+Z	D	
+Ù	D	
(.
(		ª1	D	
	‡	J	f
+?	D	
	õz	D	
	œ+EXzº
\ No newline at end of file
diff --git a/lispusers/SetStringLength.Tedit b/lispusers/SetStringLength.Tedit
deleted file mode 100644
index 61ddbd36..00000000
Binary files a/lispusers/SetStringLength.Tedit and /dev/null differ
diff --git a/sources/EDITINTERFACE b/sources/EDITINTERFACE
index 6178291a..534b4746 100644
--- a/sources/EDITINTERFACE
+++ b/sources/EDITINTERFACE
@@ -1,12 +1,12 @@
 (DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10)
 
-(FILECREATED " 8-May-2022 22:49:56" 
-{DSK}<users>kaplan>local>medley3.5>my-medley>sources>EDITINTERFACE.;42 47143  
+(FILECREATED "13-May-2022 08:16:23" 
+{DSK}<Users>kaplan>Local>medley3.5>my-medley>sources>EDITINTERFACE.;44 47034  
 
-      :CHANGES-TO (FNS FIXEDITDATE)
+      :CHANGES-TO (FNS FIXEDITDATE EDITDATE?)
 
-      :PREVIOUS-DATE " 8-May-2022 17:05:15" 
-{DSK}<users>kaplan>local>medley3.5>my-medley>sources>EDITINTERFACE.;41)
+      :PREVIOUS-DATE "12-May-2022 23:21:03" 
+{DSK}<Users>kaplan>Local>medley3.5>my-medley>sources>EDITINTERFACE.;43)
 
 
 (* ; "
@@ -627,14 +627,21 @@ Copyright (c) 1986-1988, 1990-1991 by Venue & Xerox Corporation.
            OLDATE INITLS])
 
 (FIXEDITDATE
-  [LAMBDA (EXPR)                                             (* ; "Edited  8-May-2022 22:49 by rmk")
+  [LAMBDA (EXPR)
+
+    (* ;; "Edited 13-May-2022 08:11 by rmk")
+
+    (* ;; "Edited   8-May-2022 22:49 by rmk")
 
     (* ;; "Edited 19-Jan-2022 23:08 by rmk")
 
-    (* ;; "Edited  8-Dec-2021 16:11 by rmk: Updated to add dates to the initial undated comments that begins with current-editor initials, to provide a kind of dated change-log capability.")
-                                                            (* ; "Edited 27-Sep-2018 22:04 by rmk:")
-                                                            (* ; "Edited 31-Mar-2000 17:13 by rmk:")
-                                                             (* ; "Edited 17-Jul-89 11:13 by jtm:")
+    (* ;; "Edited   8-Dec-2021 16:11 by rmk: Updated to add dates to the initial undated comments that begins with current-editor initials, to provide a kind of dated change-log capability.")
+
+    (* ;; "Edited 27-Sep-2018 22:04 by rmk:")
+
+    (* ;; "Edited 31-Mar-2000 17:13 by rmk:")
+
+    (* ;; "Edited 17-Jul-89 11:13 by jtm:")
                                                              (* ; "18-JUL-78 21:11")
 
     (* ;; "Inserts or replaces previous edit date.  This retains multiple edits (at least one day apart or by different editor) unless *REPLACE-OLD-EDIT-DATES*.  Note that the new date doesn't show up within the current SEDIT session, you have to exit and re-edit to see it. ")
@@ -695,10 +702,10 @@ Copyright (c) 1986-1988, 1990-1991 by Venue & Xerox Corporation.
 
          (* ;; "E is now the cell that the date will attach to or whose CAR will be updated.")
 
-              (LET (PARSE (INITLS (CL:IF (EQ (CHARCODE %:)
-                                             (NTHCHARCODE INITIALS -1))
-                                      (SUBSTRING INITIALS 1 -2)
-                                      INITIALS)))
+              [LET (PARSE COMMENTLEVEL (INITLS (CL:IF (EQ (CHARCODE %:)
+                                                          (NTHCHARCODE INITIALS -1))
+                                                   (SUBSTRING INITIALS 1 -2)
+                                                   INITIALS)))
                    (IF *REPLACE-OLD-EDIT-DATES*
                        THEN 
                             (* ;; "Strip out all previous modern-format edit dates. Since EDITDATE? only recognizes that format, hand editing is needed if prehistoric dates are really not desired. We don't strip out anything with a further comment.")
@@ -719,66 +726,67 @@ Copyright (c) 1986-1988, 1990-1991 by Venue & Xerox Corporation.
                                             (CADDR PARSE))
                               ELSE (/ATTACH (EDITDATE NIL INITLS)
                                           E))
-                     ELSEIF (SETQ PARSE (EDITDATE? (CAR E)
-                                               T))
-                       THEN 
-                            (* ;; "If edited by the same editor within a day, then update the previous timestamp rather than cluttering with a new one.  Presumably this is the next event in the same longer editing session, and it avoids stacking up uninformative dates from in-and-out editing during a session. ")
+                     ELSE (IF (SETQ PARSE (EDITDATE? (CAR E)
+                                                 T))
+                              THEN 
 
-                            (IF [AND (STRING.EQUAL INITLS (CADR PARSE))
-                                     (ILEQ (IDIFFERENCE (IDATE)
-                                                  (IDATE (CAR PARSE)))
-                                           (CONSTANT (TIMES 24 3600]
-                                THEN 
+                                 (* ;; "If edited by the same editor within a day, then update the previous timestamp rather than cluttering with a new one.  Presumably this is the next event in the same longer editing session, and it avoids stacking up uninformative dates from in-and-out editing during a session. ")
 
-                                 (* ;; "Same edit session with the same author: update the last previous timestamp. If the (CAR PARSE) is NIL, we are looking at an initialed comment that becomes a timestamp, and we convert it.  If just after this we see another timestamp for the same session, we take that out.")
+                                   (IF [AND (STRING.EQUAL INITLS (CADR PARSE))
+                                            (ILEQ (IDIFFERENCE (IDATE)
+                                                         (CAR PARSE))
+                                                  (CONSTANT (TIMES 24 3600]
+                                       THEN 
+                                            (* ;; 
+                       "Same edit session with the same author: update the last previous timestamp. ")
 
-                                     (/RPLACA E (EDITDATE (CAR E)
-                                                       INITLS
-                                                       (CADDR PARSE)))
-                              ELSE 
-                                   (* ;; 
+                                            (/RPLACA E (EDITDATE (CAR E)
+                                                              INITLS
+                                                              (CADDR PARSE)))
+                                     ELSE 
+                                          (* ;; 
          "Different edit sequence, attach a new timestamp in front of any old ones, without the rest")
 
-                                   (/ATTACH (EDITDATE NIL INITLS)
-                                          E)) 
-
-                            (* ;; "If the new date has an upgraded comment-level, update all of the previous dates so that they align on the left instead of the right.")
-
-                            (CL:UNLESS (EQ (CADR (CAR E))
-                                           ';)
-                                (FOR PREV (NEWTYPE _ (CADR (CAR E))) IN (CDR E)
-                                   WHILE (EDITDATE? PREV) UNTIL (EQ (CADR PREV)
-                                                                    NEWTYPE)
-                                   DO (/RPLACA (CDR PREV)
-                                             NEWTYPE)))
-                     ELSEIF (AND [EQ COMMENTFLG (CAR (LISTP (CAR E]
-                                 (MEMB [CAR (LISTP (SETQ PARSE (CDAR E]
-                                       '(; ;; ;;;))
-                                 [STRINGP (SETQ PARSE (CAR (LISTP (CDR PARSE]
-                                 (STRPOS (CONCAT INITLS ": ")
-                                        PARSE 1 NIL NIL T))
-                       THEN 
-                            (* ;; 
+                                          (/ATTACH (EDITDATE NIL INITLS)
+                                                 E))
+                            ELSEIF (AND [EQ COMMENTFLG (CAR (LISTP (CAR E]
+                                        (MEMB [CAR (LISTP (SETQ PARSE (CDAR E]
+                                              '(; ;; ;;;))
+                                        [STRINGP (SETQ PARSE (CAR (LISTP (CDR PARSE]
+                                        (STRPOS (CONCAT INITLS ": ")
+                                               PARSE 1 NIL NIL T))
+                              THEN 
+                                   (* ;; 
   "Just an ordinary comment in first position, with initials: in front.  Upgrade it to an edit date.")
 
-                            (/RPLACA E (EDITDATE (CAR E)
-                                              NIL PARSE))
-                     ELSE 
-                          (* ;; 
+                                   (/RPLACA E (EDITDATE (CAR E)
+                                                     NIL PARSE))
+                            ELSE 
+                                 (* ;; 
     "First edit: we didn't see an old date to compare with or smash, not even an initials: xxx form.")
 
-                          (/ATTACH (EDITDATE NIL INITLS)
-                                 E)))
+                                 (/ATTACH (EDITDATE NIL INITLS)
+                                        E)) 
+
+                          (* ;; "Make sure that all the previous dates have the same comment level.")
+
+                          [SETQ COMMENTLEVEL (CADR (FOR C CFLAG IN E WHILE (EDITDATE? C)
+                                                      LARGEST (NCHARS (CADR C]
+                          (FOR C IN E WHILE (EDITDATE? C) UNLESS (EQ (CADR C)
+                                                                     COMMENTLEVEL)
+                             DO (/RPLACA (CDR C)
+                                       COMMENTLEVEL]
               (RETURN EXPR)))])
 
 (EDITDATE?
-  [LAMBDA (COMMENT PARSE)                                    (* ; "Edited  6-May-2022 23:39 by rmk")
+  [LAMBDA (COMMENT PARSE)                                    (* ; "Edited 13-May-2022 08:05 by rmk")
+                                                             (* ; "Edited  6-May-2022 23:39 by rmk")
 
     (* ;; "This determines whether this is a dated or initialed comment that is potentially reusable in the current context. It recognizes comments with edit-date strings of the following formats:")
 
 (* ;;; "        %"Edited <date> by <initials>(:)%"")
 
-(* ;;; "        %"Edited >date? by <initials>: <comment>%"")
+(* ;;; "        %"Edited <date> by <initials>: <comment>%"")
 
 (* ;;; "Value is NIL if the comment is not in one of these formats.  Otherwise, if PARSE, then the value is a list (<date> <initials> <comment>), else T.  ")
 
@@ -799,8 +807,7 @@ Copyright (c) 1986-1988, 1990-1991 by Venue & Xerox Corporation.
                                  STRING))
              (CL:WHEN [AND [STREQUAL "Edited " (SUBSTRING STRING 1 7 (CONSTANT (CONCAT]
                            (SETQ BYPOS (STRPOS " by " STRING 8))
-                           (IDATE (SETQ DATE (CL:STRING-TRIM `(#\Space)
-                                                    (SUBSTRING STRING 8 (SUB1 BYPOS]
+                           (SETQ DATE (IDATE (SUBSTRING STRING 8 (SUB1 BYPOS]
 
                  (* ;; "Standard format, initials should be next.  ")
 
@@ -929,11 +936,11 @@ Copyright (c) 1986-1988, 1990-1991 by Venue & Xerox Corporation.
 )
 (PUTPROPS EDITINTERFACE COPYRIGHT ("Venue & Xerox Corporation" 1986 1987 1988 1990 1991))
 (DECLARE%: DONTCOPY
-  (FILEMAP (NIL (4079 10378 (ED 4079 . 10378)) (10380 14356 (INSTALL-PROTOTYPE-DEFN 10380 . 14356)) (
-14357 31140 (EDITDEF.FNS 14367 . 15703) (EDITF 15705 . 16585) (EDITFB 16587 . 17435) (EDITFNS 17437 . 
-18757) (EDITLOADFNS? 18759 . 22559) (EDITMODE 22561 . 24571) (EDITP 24573 . 25084) (EDITV 25086 . 
-25725) (DC 25727 . 26408) (DF 26410 . 27452) (DP 27454 . 28538) (DV 28540 . 29112) (EDITPROP 29114 . 
-29333) (EF 29335 . 29664) (EP 29666 . 29849) (EV 29851 . 30030) (EDITE 30032 . 30910) (EDITL 30912 . 
-31138)) (31490 46288 (NEW/EDITDATE 31500 . 31722) (FIXEDITDATE 31724 . 39842) (EDITDATE? 39844 . 42842
-) (EDITDATE 42844 . 44291) (SETINITIALS 44293 . 46286)))))
+  (FILEMAP (NIL (4089 10388 (ED 4089 . 10388)) (10390 14366 (INSTALL-PROTOTYPE-DEFN 10390 . 14366)) (
+14367 31150 (EDITDEF.FNS 14377 . 15713) (EDITF 15715 . 16595) (EDITFB 16597 . 17445) (EDITFNS 17447 . 
+18767) (EDITLOADFNS? 18769 . 22569) (EDITMODE 22571 . 24581) (EDITP 24583 . 25094) (EDITV 25096 . 
+25735) (DC 25737 . 26418) (DF 26420 . 27462) (DP 27464 . 28548) (DV 28550 . 29122) (EDITPROP 29124 . 
+29343) (EF 29345 . 29674) (EP 29676 . 29859) (EV 29861 . 30040) (EDITE 30042 . 30920) (EDITL 30922 . 
+31148)) (31500 46179 (NEW/EDITDATE 31510 . 31732) (FIXEDITDATE 31734 . 39703) (EDITDATE? 39705 . 42733
+) (EDITDATE 42735 . 44182) (SETINITIALS 44184 . 46177)))))
 STOP
diff --git a/sources/EDITINTERFACE.LCOM b/sources/EDITINTERFACE.LCOM
index c04f34c5..e8babab4 100644
Binary files a/sources/EDITINTERFACE.LCOM and b/sources/EDITINTERFACE.LCOM differ
