(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP")
(FILECREATED "11-Sep-87 16:19:02" {ERINYES}<LISPUSERS>LYRIC>MANAGER.;19 103512 

      previous date%: " 3-Sep-87 17:00:30" {ERINYES}<LISPUSERS>LYRIC>MANAGER.;18)


(* "
Copyright (c) 1986, 1987, 1900 by Xerox Corporation.  All rights reserved.
")

(PRETTYCOMPRINT MANAGERCOMS)

(RPAQQ MANAGERCOMS ((* ;; "The Manager : a menu based interface to the file manager.  ") (* ;; "Originally written by: Jay Ferguson of Ford Aerospace & Communications Corp and Robert Noble of Intellicorp. ") (* ;; "Rewritten by Larry Masinter, winter of 1986.") (* ;; "Further modifications by Andrew J. Cameron III, summer of 1987.") (* ;; "Ongoing maintenance and performance tuning by Ron Fischer at Xerox AI Systems.") (* ;; "") (* ;; "There are two patches in here that should be removed if Xerox Lisp is fixed.  The first is the advice (MARKASCHANGED :IN DEFAULT.EDITDEFA0001) that removes a (mostly) redundant call to MARKASCHANGED in the editor interface, which otherwise slows down manager updates.  Somehow this call is not redundant when editing FILELST (perhaps there's a special case for FILELST or when items are not in any existing files).  The second is the fns Manager.REMOVE.DUPLICATE.ADVICE called by the advice on LOAD and LOADFNS, which removes redundant advice which would otherwise pile up and cause massive slow downs in manager updates!") (* ;; "") (* ;; "Edit history:") (* ;; "andyiii- All menus are sorted now.") (* ;; "andyiii - Appropiate sub-menu update when something is changed that they contain.") (* ;; "andyiii- un-marking a file in the main menu now works and updates all the sub-menus of that file.") (* ;; "andyiii - added option to MAKEFILE menu item for files to write CommonLisp source using common-makefile.") (* ;; "andyiii - added commonlisp DESCRIBE for items") (* ;; "andyiii - Added a way to add files to the file managers main menu") (* ;; "andyiii - Can edit files property list from CHANGES menu") (* ;; "andyiii - Can now mark a whole file from main menu") (* ;; "andyiii - Can chose between TCOMPL (.LCOM files) and compile-file (.dfasl files) This is awkard since is uses the global variable *default-cleanup-compiler*") (* ;; "andyiii - Can get CommonLisp documentation string and descriptons") (* ;; "andyiii - Can now PrettyPrint a value, function def, or prop list and also show how the item would be written to a file") (* ;; "andyiii - Cleaned up specialized menus for FNS, FUNCTIONS, VARS and PROPS") (* ;; "andyiii - All dialog now goes through the MANAGER ACTIVITY WINDOW") (* ;; "RAF 7/31/87 - Fixed the rename option to not specify a source file, uses the ? search (core then file).") (* ;; "RAF 7/31/87 - Added an %"edit all occurances of item's name%" option to file relations menu.") (* ;; "RAF 7/31/87 - Manager.ACTIVEFLG is now a special that is bound by all advice to avoid redundant updates inside of themselves.  This is a big speed improvement!") (* ;; "RAF 7/31/87 - Fixed Manager.HASITEM and Manager.HIGHLIGHT to use SASSOC, so that list items in menus get highlighted properly.") (* ;; "RAF 7/31/87 - Middle button on Manager file menu now brings up rename, etc.  Used to bring up coms to edit (inconsistent).") (* ;; "RAF 7/31/87 - Main menu flashes if bad button/command is given.") (* ;; "RAF 8/4/87 - MANAGER-ADDTOFILES? now initialized to NIL, reducing redundant updates.") (* ;; "RAF 8/14/87 - In Manager.ALTERMARKING: removed extra code which tracked the files containing updated menus.  Removed call to Manager.CHECKFILE.  Made call to Manager.MAINUPDATE pass T if the reason for marking was DEFINED or DELETED; these cases also call Manager.COMSOPEN.") (* ;; "RAF 8/15/87 - In Manager.DO.COMMAND: moved binding of ACTIVITY-WINDOW-WAS-SHRUNK into the form eval'ed in the process where references are made.  Moved setting of ACTIVITY-WINDOW-WAS-SHRUNK after the spot where its referent ACTIVITY-WINDOW is initialized.") (* ;; "RAF 8/16/87 - Advice for LOAD and LOADFNS now call Manager.CHECKFILE instead of Manager.MAINUPDATE (latter only does highlight updating, former can rebuild main menu).  Advice for ADDTOFILES? now doesn't disable manager inside of its advised form, so that the ADDTOCOMS and DELFROMCOMS advice will work.") (* ;; "RAF 8/17/87 - Added Manager.FILELSTCHANGED? (which is tricky, since sorting in the main menu changes its order).  Manager.CHECKFILE now tests whether the file being checked is in the main menu.  If not the main menu is rebuilt.  MANAGER fns disables manager around its call to UPDATEFILES.  Manager.GETFILE takes a prompt argument (which is now passed in by Manager.DO.COMMAND).") (* ;; "RAF 8/18/87 - Manager.REMOVE.DUPLICATE.ADVICE now disables the manager when it manipulates the advice (to avoid animating the changes in the menus).  The advice on LOAD and LOADFNS now call Manager.REMOVE.DUPLICATE.ADVICE.") (* ;; "RAF 8/20/87 - Fixed Manager.MAKEFILE.ADV to handle atomic cleanup options.  Also made the top level Manager.RESET call take Manager.ACTIVEFLG, so that manager stays on when reloaded if it was on already.  Manager.REMOVE.DUPLICATE.ADVICE now removes *all* duplicates of the first piece of advice (rather than only the second).") (* ;; "RAF 8/21/87 - Made MANAGER-WINDOWS be an initvar so that Manager.RESET from top level sees the right thing on first startup.") (* ;; "RAF 9/2/87 - Changed the manager shrunken bitmap to something more respectable.  Added ADVISE and UNADVISE menu options for the ADVICE definer.  Added a %"Show all advice in effect%" option to the manager main window middle button menu.  Changed the messages printed out by Manager.DO.COMMAND to all use printout and lambdafont for highlighting.") (* ;; "RAF 9/3/87 - Added a clause in the startup fns MANAGER which reports when FILELST is empty and manager can't start.  Also fixed a bug in where marking a file didn't bold the main menu entry (added an updatefiles in Manager.ALTERMARKING).  Also caused the advice on the %"redundant%" call to (MARKASCHANGED :IN DEFAULT.EDITDEFA0001) to fire when FILELST is being edited (seems it was the only way to call markaschanged in that one case).") (* ;; "") (* ;; "Bugs:") (* ;; "See Scrollable doesn't work. It produces a break.") (* ;; "The middle button main menu item DELETE doesn't do anything.") (* ;; "The middle button main menu item RENAME pretends to do something.") (* ;; "MAKEFILE of a new file from the EXEC window produces two manager windows on the screen.") (* ;; "Edited the COMS variable of a file (getting there via the MANAGER menus) but the display of the file name did not indicate change.") (* ;; "Manager RENAME loses items, doesn't read names in the correct readtable.") (* ;; "Manager loses slide off subtype menus when coms go into %"nested format%"; rename and friends cause the coms to go into a nested format which has as its tail the changes.  Manager then can't parse the coms.") (* ;; "Names displayed in the manager menus don't include package info (should prin2).") (* ;; "Manager rename command doesn't hack packages; it reads the new name as a string, always interning it in the IL package.") (* ;; "Andy Cameron claims code is missing from Manager.") (* ;; "When the default %"cleanup%" compiler is changed to %"compile-file%", it changes it to %"il:compile-file%", which doesn't work.") (* ;; "Need to normalize the comstype arguments of the advised fns into symbols in the IL package, various EQ checks for menu updates are failing.") (* ;; "") (* ;; "Major suggested features:") (* ;; "Shade selected items before popping menu?") (* ;; "Too manu mouse clicks to do common operations.") (* ;; "Use tablebrowser instead of menus.") (* ;; "Associate a %"working directory%" with a file.") (* ;; "Associate standard makefile options with a file (eg, (remake rc) for Interlisp files, (new c) for Common Lisp files, (remake f) for difficult to reload files, like system files).") (* ;; "Associate a dfnflg to particular files (perhaps linked to the F/ST flag in the previous item).") (* ;; "File Manager dumpable user programmed menu options (defdefiners) and rewrite the existing commands in terms of this programmatic interface.") (* ;; "Might want to have a MASTERSCOPE slide out option for fns and vars,") (* ;; "      eg: button on foo and slide off: masterscope > edit > who > calls") (* ;; "Options to MAKEFILE, CLEANUP and LISTFILES should be settable from the middle button menu on the main menu.  Default settings in cleanupoptions and such should show in menu defaults.  Should be able to %"set the current options on a file%" (put them on a prop that Manager knows about).") (* ;; "") (SPECVARS Manager.ACTIVEFLG MANAGER-CASES MANAGER-ADDTOFILES?) (GLOBALVARS LAMBDAFONT DEFAULTFONT MENUFONT MENUBOLDFONT MANAGER-WINDOWS LOADBFLG SAVEDBFLG MANAGER-ITEM-OPERATION-COMMANDS MANAGER-ITEM-FILE-RELATION-COMMANDS MANAGER-FILE-OPERATIONS-COMMANDS MANAGER-FILE-FILE-RELATION-COMMANDS MANAGER-MAIN-MENU-ITEMS MANAGER-ACTIVITY-WINDOW-TITLE BackgroundMenuCommands BackgroundMenu) (VARS *UNMANAGED-TYPES* MANAGER-ACTIVITY-WINDOW-TITLE (MANAGER-CASES) (MANAGER-ADDTOFILES?) MANAGER-FILE-FILE-RELATION-COMMANDS MANAGER-FILE-OPERATIONS-COMMANDS MANAGER-ITEM-FILE-RELATION-COMMANDS MANAGER-ITEM-OPERATION-COMMANDS MANAGER-MAIN-MENU-ITEMS MANAGER.BM MANAGER.BM.MASK) (INITVARS (Manager.ACTIVEFLG NIL) (Manager.SORTFILELSTFLG T) (Manager.MENUROWS 20) (Manager.DATASPACE NIL) (MANAGER-WINDOWS NIL) (MANAGER-MAIN-WINDOW NIL) (MANAGER-OPEN-WINDOWS NIL) (MANAGER-FILE-MENU NIL) (MANAGER-FILELST-MENU NIL) (MANAGER-FILE-OPERATIONS-MENU NIL) (MANAGER-FILE-FILE-RELATION-MENU NIL) (MENUBOLDFONT (FONTCOPY MENUFONT (QUOTE WEIGHT) (QUOTE BOLD))) (MANAGER-MARKED-SHADE MENUBOLDFONT)) (FILES FILEBROWSER) (* ; "for SEE command") (FNS MANAGER MANAGER.RESET Manager.ADDADV Manager.ADDTOFILES? Manager.ALTERMARKING Manager.DO.COMMAND Manager.HIGHLIGHT Manager.PROMPT Manager.WINDOW Manager.insurefilehighlights Manager.CHANGED? Manager.CHECKFILE Manager.COLLECTCOMS Manager.COMS.WSF Manager.COMSOPEN Manager.COMSUPDATE Manager.HIGHLIGHTED Manager.INSUREHIGHLIGHTS Manager.FILECHANGES Manager.FILELSTCHANGED? Manager.FILESUBTYPES Manager.GET.ENVIRONMENT Manager.GETFILE Manager.INTITLE? Manager.MAIN.WSF Manager.MAINCLOSE Manager.MAINMENUITEMS Manager.MAINOPEN Manager.MAINUPDATE Manager.MAKEFILE.ADV Manager.MENUCOLUMNS Manager.MENUHASITEM Manager.MENUITEMS Manager.REMOVE.DUPLICATE.ADVICE Manager.RESETSUBITEMS Manager.SORT.COMS Manager.SORTBYCOLUMN) (ADVISE ADDFILE ADDTOFILES? MAKEFILE MARKASCHANGED UNMARKASCHANGED UPDATEFILES ADDTOCOMS DELFROMCOMS \ADDTOFILEBLOCK/ADDNEWCOM LOAD LOADFNS (MARKASCHANGED :IN DEFAULT.EDITDEFA0001)) (MACROS GETDATUM PUTDATUM Manager.TTYCOMMAND) (PROP MANAGER-DEFINITION-TYPE-COMMANDS ADVICE FNS RECORDS VARS FUNCTIONS) (ADDVARS (BackgroundMenuCommands (File% Manager (MANAGER) "Starts the menu driven file manager"))) (P (LSUBST (QUOTE Manager) NIL BackgroundMenuCommands) (* ; "remove old manager entry if it exists") (SETQ BackgroundMenu NIL) (* ; " cause the backGround menu to be rebuilt") (MANAGER.RESET (CL:SYMBOL-VALUE (QUOTE Manager.ACTIVEFLG))) (* ; "Shutdown any old manager windows and restart if we're already running.") (if (STREQUAL MANAGER-ACTIVITY-WINDOW-TITLE (WINDOWPROP NIL (QUOTE TITLE))) then (* ; "If we're in the manager activity window, close it, since we dropped the pointer to it in MANAGER.RESET.") (CLOSEW NIL))) (PROP (MAKEFILE-ENVIRONMENT FILETYPE) MANAGER) (DECLARE%: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY COMPILERVARS (ADDVARS (NLAMA) (NLAML) (LAMA))))
)



(* ;; "The Manager : a menu based interface to the file manager.  ")




(* ;; 
"Originally written by: Jay Ferguson of Ford Aerospace & Communications Corp and Robert Noble of Intellicorp. "
)




(* ;; "Rewritten by Larry Masinter, winter of 1986.")




(* ;; "Further modifications by Andrew J. Cameron III, summer of 1987.")




(* ;; "Ongoing maintenance and performance tuning by Ron Fischer at Xerox AI Systems.")




(* ;; "")




(* ;; 
"There are two patches in here that should be removed if Xerox Lisp is fixed.  The first is the advice (MARKASCHANGED :IN DEFAULT.EDITDEFA0001) that removes a (mostly) redundant call to MARKASCHANGED in the editor interface, which otherwise slows down manager updates.  Somehow this call is not redundant when editing FILELST (perhaps there's a special case for FILELST or when items are not in any existing files).  The second is the fns Manager.REMOVE.DUPLICATE.ADVICE called by the advice on LOAD and LOADFNS, which removes redundant advice which would otherwise pile up and cause massive slow downs in manager updates!"
)




(* ;; "")




(* ;; "Edit history:")




(* ;; "andyiii- All menus are sorted now.")




(* ;; "andyiii - Appropiate sub-menu update when something is changed that they contain.")




(* ;; 
"andyiii- un-marking a file in the main menu now works and updates all the sub-menus of that file.")




(* ;; 
"andyiii - added option to MAKEFILE menu item for files to write CommonLisp source using common-makefile."
)




(* ;; "andyiii - added commonlisp DESCRIBE for items")




(* ;; "andyiii - Added a way to add files to the file managers main menu")




(* ;; "andyiii - Can edit files property list from CHANGES menu")




(* ;; "andyiii - Can now mark a whole file from main menu")




(* ;; 
"andyiii - Can chose between TCOMPL (.LCOM files) and compile-file (.dfasl files) This is awkard since is uses the global variable *default-cleanup-compiler*"
)




(* ;; "andyiii - Can get CommonLisp documentation string and descriptons")




(* ;; 
"andyiii - Can now PrettyPrint a value, function def, or prop list and also show how the item would be written to a file"
)




(* ;; "andyiii - Cleaned up specialized menus for FNS, FUNCTIONS, VARS and PROPS")




(* ;; "andyiii - All dialog now goes through the MANAGER ACTIVITY WINDOW")




(* ;; 
"RAF 7/31/87 - Fixed the rename option to not specify a source file, uses the ? search (core then file)."
)




(* ;; "RAF 7/31/87 - Added an %"edit all occurances of item's name%" option to file relations menu.")




(* ;; 
"RAF 7/31/87 - Manager.ACTIVEFLG is now a special that is bound by all advice to avoid redundant updates inside of themselves.  This is a big speed improvement!"
)




(* ;; 
"RAF 7/31/87 - Fixed Manager.HASITEM and Manager.HIGHLIGHT to use SASSOC, so that list items in menus get highlighted properly."
)




(* ;; 
"RAF 7/31/87 - Middle button on Manager file menu now brings up rename, etc.  Used to bring up coms to edit (inconsistent)."
)




(* ;; "RAF 7/31/87 - Main menu flashes if bad button/command is given.")




(* ;; "RAF 8/4/87 - MANAGER-ADDTOFILES? now initialized to NIL, reducing redundant updates.")




(* ;; 
"RAF 8/14/87 - In Manager.ALTERMARKING: removed extra code which tracked the files containing updated menus.  Removed call to Manager.CHECKFILE.  Made call to Manager.MAINUPDATE pass T if the reason for marking was DEFINED or DELETED; these cases also call Manager.COMSOPEN."
)




(* ;; 
"RAF 8/15/87 - In Manager.DO.COMMAND: moved binding of ACTIVITY-WINDOW-WAS-SHRUNK into the form eval'ed in the process where references are made.  Moved setting of ACTIVITY-WINDOW-WAS-SHRUNK after the spot where its referent ACTIVITY-WINDOW is initialized."
)




(* ;; 
"RAF 8/16/87 - Advice for LOAD and LOADFNS now call Manager.CHECKFILE instead of Manager.MAINUPDATE (latter only does highlight updating, former can rebuild main menu).  Advice for ADDTOFILES? now doesn't disable manager inside of its advised form, so that the ADDTOCOMS and DELFROMCOMS advice will work."
)




(* ;; 
"RAF 8/17/87 - Added Manager.FILELSTCHANGED? (which is tricky, since sorting in the main menu changes its order).  Manager.CHECKFILE now tests whether the file being checked is in the main menu.  If not the main menu is rebuilt.  MANAGER fns disables manager around its call to UPDATEFILES.  Manager.GETFILE takes a prompt argument (which is now passed in by Manager.DO.COMMAND)."
)




(* ;; 
"RAF 8/18/87 - Manager.REMOVE.DUPLICATE.ADVICE now disables the manager when it manipulates the advice (to avoid animating the changes in the menus).  The advice on LOAD and LOADFNS now call Manager.REMOVE.DUPLICATE.ADVICE."
)




(* ;; 
"RAF 8/20/87 - Fixed Manager.MAKEFILE.ADV to handle atomic cleanup options.  Also made the top level Manager.RESET call take Manager.ACTIVEFLG, so that manager stays on when reloaded if it was on already.  Manager.REMOVE.DUPLICATE.ADVICE now removes *all* duplicates of the first piece of advice (rather than only the second)."
)




(* ;; 
"RAF 8/21/87 - Made MANAGER-WINDOWS be an initvar so that Manager.RESET from top level sees the right thing on first startup."
)




(* ;; 
"RAF 9/2/87 - Changed the manager shrunken bitmap to something more respectable.  Added ADVISE and UNADVISE menu options for the ADVICE definer.  Added a %"Show all advice in effect%" option to the manager main window middle button menu.  Changed the messages printed out by Manager.DO.COMMAND to all use printout and lambdafont for highlighting."
)




(* ;; 
"RAF 9/3/87 - Added a clause in the startup fns MANAGER which reports when FILELST is empty and manager can't start.  Also fixed a bug in where marking a file didn't bold the main menu entry (added an updatefiles in Manager.ALTERMARKING).  Also caused the advice on the %"redundant%" call to (MARKASCHANGED :IN DEFAULT.EDITDEFA0001) to fire when FILELST is being edited (seems it was the only way to call markaschanged in that one case)."
)




(* ;; "")




(* ;; "Bugs:")




(* ;; "See Scrollable doesn't work. It produces a break.")




(* ;; "The middle button main menu item DELETE doesn't do anything.")




(* ;; "The middle button main menu item RENAME pretends to do something.")




(* ;; "MAKEFILE of a new file from the EXEC window produces two manager windows on the screen.")




(* ;; 
"Edited the COMS variable of a file (getting there via the MANAGER menus) but the display of the file name did not indicate change."
)




(* ;; "Manager RENAME loses items, doesn't read names in the correct readtable.")




(* ;; 
"Manager loses slide off subtype menus when coms go into %"nested format%"; rename and friends cause the coms to go into a nested format which has as its tail the changes.  Manager then can't parse the coms."
)




(* ;; "Names displayed in the manager menus don't include package info (should prin2).")




(* ;; 
"Manager rename command doesn't hack packages; it reads the new name as a string, always interning it in the IL package."
)




(* ;; "Andy Cameron claims code is missing from Manager.")




(* ;; 
"When the default %"cleanup%" compiler is changed to %"compile-file%", it changes it to %"il:compile-file%", which doesn't work."
)




(* ;; 
"Need to normalize the comstype arguments of the advised fns into symbols in the IL package, various EQ checks for menu updates are failing."
)




(* ;; "")




(* ;; "Major suggested features:")




(* ;; "Shade selected items before popping menu?")




(* ;; "Too manu mouse clicks to do common operations.")




(* ;; "Use tablebrowser instead of menus.")




(* ;; "Associate a %"working directory%" with a file.")




(* ;; 
"Associate standard makefile options with a file (eg, (remake rc) for Interlisp files, (new c) for Common Lisp files, (remake f) for difficult to reload files, like system files)."
)




(* ;; "Associate a dfnflg to particular files (perhaps linked to the F/ST flag in the previous item)."
)




(* ;; 
"File Manager dumpable user programmed menu options (defdefiners) and rewrite the existing commands in terms of this programmatic interface."
)




(* ;; "Might want to have a MASTERSCOPE slide out option for fns and vars,")




(* ;; "      eg: button on foo and slide off: masterscope > edit > who > calls")




(* ;; 
"Options to MAKEFILE, CLEANUP and LISTFILES should be settable from the middle button menu on the main menu.  Default settings in cleanupoptions and such should show in menu defaults.  Should be able to %"set the current options on a file%" (put them on a prop that Manager knows about)."
)




(* ;; "")

(DECLARE%: DOEVAL@COMPILE DONTCOPY

(SPECVARS Manager.ACTIVEFLG MANAGER-CASES MANAGER-ADDTOFILES?)
)
(DECLARE%: DOEVAL@COMPILE DONTCOPY

(GLOBALVARS LAMBDAFONT DEFAULTFONT MENUFONT MENUBOLDFONT MANAGER-WINDOWS LOADBFLG SAVEDBFLG MANAGER-ITEM-OPERATION-COMMANDS MANAGER-ITEM-FILE-RELATION-COMMANDS MANAGER-FILE-OPERATIONS-COMMANDS MANAGER-FILE-FILE-RELATION-COMMANDS MANAGER-MAIN-MENU-ITEMS MANAGER-ACTIVITY-WINDOW-TITLE BackgroundMenuCommands BackgroundMenu)
)

(RPAQQ *UNMANAGED-TYPES* (EXPRESSIONS FILES FIELDS FILEVARS-ARE-NOW-OK))

(RPAQQ MANAGER-ACTIVITY-WINDOW-TITLE "Manager Command Activity")

(RPAQQ MANAGER-CASES NIL)

(RPAQQ MANAGER-ADDTOFILES? NIL)

(RPAQQ MANAGER-FILE-FILE-RELATION-COMMANDS ((" Delete " (QUOTE DELETE) "Delete this file") ("Rename" (QUOTE RENAME) "Rename this file") ("Copy" (QUOTE COPY) "Copy this item to another file") ("Mark" (QUOTE CHANGED) "Mark this file as being changed") ("Unmark" (QUOTE UNMARK) "Unmark this file as being changed"))
)

(RPAQQ MANAGER-FILE-OPERATIONS-COMMANDS (("See" (QUOTE SEE) "Show file in a window" (SUBITEMS ("Fast" (QUOTE SEE) "Show file in a window") (" Scrollable " (QUOTE TEDIT-SEE) "Show file in a scrollable window"))) ("(Re)Load" (QUOTE LOAD) "Load the source of this file" (SUBITEMS ("Load" (QUOTE LOAD) "Load the source of this file") (" SysLoad " (QUOTE SYSLOAD) "SysLoad the file: smashes everything on the way in and is not UNDOable"))) ("MakeFile" (QUOTE MAKEFILE) "Dump the source of this file" (SUBITEMS ("MakeFile" (QUOTE MAKEFILE) "Dump the source of this file, by remaking it") ("New" (QUOTE NEW) "Don't copy any definitions from old version") ("Fast" (QUOTE FAST) "Dump the source without pretty printing") (" CommonLisp " (QUOTE COMMON-MAKEFILE) "Create a .LSP file containing plain CommonLisp source
Will load Common-MakeFile if necessary"))) ("List" (QUOTE LIST) "List this file on the default printer") ("CleanUp" (QUOTE CLEANUP) "Dump, list and recompile this file" (SUBITEMS ("CleanUp" (QUOTE CLEANUP) "Dump, list and recompile this file, using the default cleanup compiler") (" Set default: compile-file " CLEANUPC "Change the default cleanup compiler to compile-file; yeilding .dfasl files") ("Set default: TCOMPL" CLEANUPT "Change the default cleanup compiler to TCOMPL; yeilding .LCOM files
This compiler will be going away soon"))) ("MasterScope" (QUOTE ANALYZE) "Analyze the FNS on the selected file with MasterScope" (SUBITEMS ("Analyze" (QUOTE ANALYZE) "Analyze the FNS on the selected file with MasterScope") ("Check" (QUOTE CHECK) "Check the file for problems through MasterScope") ("Show Paths" (QUOTE SHOWPATHFILE) "Show all functions called by functions in this file") (" DataBaseFNS " (QUOTE DBFILE) "Display DATABASE property for this file
Will load DataBaseFNS if necessary" (SUBITEMS ("Set to Ask" (QUOTE DBFILEASK) "Ask about disposition of MasterScope information when loading and storing this file") ("Set to On" (QUOTE DBFILEON) "Automatically maintain the MasterScope information for this file") ("Set to Off" (QUOTE DBFILEOFF) "Do not automatically maintain the MasterScope information for this file") (" Load DB " (QUOTE LOADDB) "Load this file's MasterScope information, if it exists and make it's upkeep automatic") ("Dump DB" (QUOTE DUMPDB) "Dump this file's MasterScope information, if it exists and make it's upkeep automatic"))))) ("Compile" (QUOTE COMPILE) "Compile this file" (SUBITEMS ("Compile" (QUOTE COMPILE) "InterLisp compiler") (" CL:COMPILE-FILE " (QUOTE CL:COMPILE-FILE) "CommonLisp compiler"))) ("Changes" (QUOTE CHANGES) "Show the changes that have been made to this file." (SUBITEMS ("Brief" (QUOTE CHANGES) "Show the changes that have been made to this file.") (" Everything " (QUOTE PL) "Display everything on this file's property list") ("Edit PL" (QUOTE EDIT) "Edit this file's property list"))))
)

(RPAQQ MANAGER-ITEM-FILE-RELATION-COMMANDS ((" Delete " (QUOTE DELETE) "Delete this item") ("EditAll" (QUOTE EDITCALLERS) "Edit occurances of this item's name in its file") ("Rename" (QUOTE RENAME) "Rename this item and update its file with new name" (SUBITEMS ("Rename" (QUOTE RENAME) "Rename this item locally and update its file with new name") ("CopyDef" (QUOTE COPYDEF) "Make a copy with a new name") (" Rename All " (QUOTE RENAME-ALL) "Rename this item in *ALL* loaded files"))) ("Move" (QUOTE MOVE) "Move this item to another file") ("Copy" (QUOTE COPY) "Copy this item to another file") ("Mark" (QUOTE CHANGED) "Mark this item as being changed" (SUBITEMS ("Changed" (QUOTE CHANGED) "Mark item as being CHANGED") (" Defined " (QUOTE DEFINED) "Mark item as being DEFINED") ("Deleted" (QUOTE DELETED) "Mark item as being DELETED"))) ("Unmark" (QUOTE UNMARK) "Unmark this item as being changed"))
)

(RPAQQ MANAGER-ITEM-OPERATION-COMMANDS (("Edit" (QUOTE EDIT) "Edit this item") (" PrettyPrint " (QUOTE SHOWDEF) "Show how this item would be written to a file" (SUBITEMS ("Show" (QUOTE SHOWDEF) "Show how this item would be written to a file") ("Value" (QUOTE PV) "Display (Pretty-Print) this item's value") ("Function Def" (QUOTE PF) "Display (Pretty-Print) this item's function definition") (" Property List " (QUOTE PL) "Display this item's property list"))) (" Documentation " (QUOTE CLDOC) "Show the CommonLisp documentation string for this item" (SUBITEMS (" Documentation " (QUOTE CLDOC) "Show the CommonLisp documentation string for this item") (" Describe " (QUOTE CLDESCRIBE) "Show the CommonLisp description of this item"))))
)

(RPAQQ MANAGER-MAIN-MENU-ITEMS (("MakeFiles" (QUOTE MAKEFILE) "Update the source of all changed files") ("CleanUp" (QUOTE CLEANUP) "Dump, list and recompile any changed files" (SUBITEMS ("CleanUp" (QUOTE CLEANUP) "Dump, list and recompile any changed files, using the default cleanup compiler") (" Set default: compile-file " (QUOTE CLEANUPC) "Change the default cleanup compiler to compile-file; yielding .dfasl files") ("Set default: TCOMPL" (QUOTE CLEANUPT) "Change the default cleanup compiler to TCOMPL; yielding .LCOM files
This compiler will be going away soon"))) ("Changes" (QUOTE CHANGES) "Prints all the changes that have been made") ("MS DataBaseFNS" (QUOTE DB) "Displays the current MasterScope database flags,
Will load DataBaseFNS if necessary" (SUBITEMS ("All" (QUOTE DB) "Displays the current MasterScope database flags" (SUBITEMS (" Set to Ask " (QUOTE DBASK) "Ask user when Loading and/or Saving files") ("Set to On" (QUOTE DBON) "Always maintain MasterScope database information") ("Set to Off" (QUOTE DBOFF) "Stop maintaining MasterScope database information"))) ("Load" (QUOTE DB) "Displays the current MasterScope database flags" (SUBITEMS (" Set to Ask " (QUOTE DBLOADASK) "Ask user when Loading files") ("Set to On" (QUOTE DBLOADON) "Maintain MasterScope database information when Loading") ("Set to Off" (QUOTE DBLOADOFF) "Don't load MasterScore information from database files"))) (" Save " (QUOTE DB) "Displays the current MasterScope database flags" (SUBITEMS (" Set to Ask " (QUOTE DBSAVEASK) "Ask user when Saving files") ("Set to On" (QUOTE DBSAVEON) "Maintain MasterScope database information when Loading") ("Set to Off" (QUOTE DBSAVEOFF) "Don't save MasterScore information in database files"))))) ("Files?" (QUOTE FILES?) "Ask for updates and display status of files") ("Add" (QUOTE LOADFNSLATER) "Add a file to the FileManager's menu" (SUBITEMS ("LoadFns" (QUOTE LOADFNSLATER) "Notice a file using LOADFNS" (SUBITEMS (" LoadFns Later " (QUOTE LOADFNSLATER) "Notice a file, but don't load the function defs until needed") ("LoadFns Now" (QUOTE LOADFNSNOW) "Notice a file and loads all it's function defs"))) ("LoadFrom" (QUOTE LOADFROMLATER) "Notice a file using LOADFROM" (SUBITEMS (" LoadFrom Later " (QUOTE LOADFROMLATER) "Notice a file with side-effects, but don't load the function defs until needed") ("LoadFrom Now" (QUOTE LOADFROMNOW) "Notice a file with side-effects and load all it's function defs"))) ("Load" (QUOTE LOAD) "Notice a file by actually LOADing it") ("AddFile" (QUOTE ADDFILE) "Notices a file via ADDFILE (buggy)") ("Edit FILELST" (QUOTE EDIT) "Edit the variable which lists the files noticed by the file package"))) ("Advice" (QUOTE SHOWADVICE) "Display the list of advised or traced fns and functions.") ("Quit" (QUOTE QUIT) "Shut down all manager windows" (SUBITEMS ("Quit" (QUOTE QUIT) "Shut down all manager windows") (" Reset " (QUOTE RESET) "Reset the manager, leaving only the main window open"))))
)

(RPAQQ MANAGER.BM #*(72 40)@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@OOOOOOOOOOL@@@@@@@@@OOOOOOOOOOL@@@@@@@@@LIOOOOOOOOL@@@@@@@@@MEAAAAAAOOL@@@@@@@@@MMMEMEEGOOL@@@@@@@@@MMAEAAGGOOL@@@@@@@@@MMAEAMAGOOL@@@@@@@@@OOOOOAOOOOL@@@@@@@@@OOOOOOOOOOL@@@@@@@@@H@@@@@@@@HD@@@@@@@@@IK@@@@@@@DD@@@@@@@@@IEGGE@@@@JD@@@@@@@@FIAEEE@@@@EEOOOOOO@@FIADEE@@@@JEOOOOOO@@FIAGEG@@@@DEOGOOOO@@FH@@@@@@@@HENBCOOO@@FOOOOOOOOOOMOFKOOO@@FH@@@@@@@@HEOFKOOO@@FIL@@@B@@@DEOFCOOO@@FIB@@@B@@@JEOOOOOO@@FILNNNN@@@EEOOOOOO@@DIBBLNN@@@JD@@@@@A@@DIBNFHJ@@@DDLIEHMM@@DILNNNN@@@HEAEEEAA@@DH@@@@@@@@@DIEEIAI@@DOOOOOOOOOOLEEEEAA@@DH@@@@@@@@HEHHIDMM@@DI@B@@F@@@DD@@@@@A@@FIGGGGDNNNJEOOOOOO@@DIEBEEFBHJED@@@@@A@@DIEBDDDNHHJD@@@@@A@@DIECGDDNNNDDNJCIJA@@DH@@@@@@@@HDHJBBAA@@DOOOOOOOOOOLLJCCIA@@D@@@@@@@@@@@HJB@IA@@DDANANDDDDHLHKKKBA@@D@@@@@@@@@@@@@@@@A@@GOOOOOOOOOOOOOOOOO@@
)

(RPAQQ MANAGER.BM.MASK #*(72 40)@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@OOOOOOOOOOL@@@@@@@@@OOOOOOOOOOL@@@@@@@@@OOOOOOOOOOL@@@@@@@@@OOOOOOOOOOL@@@@@@@@@OOOOOOOOOOL@@@@@@@@@OOOOOOOOOOL@@@@@@@@@OOOOOOOOOOL@@@@@@@@@OOOOOOOOOOL@@@@@@@@@OOOOOOOOOOL@@@@@@@@@OOOOOOOOOOL@@@@@@@@@OOOOOOOOOOL@@@@@@@@@OOOOOOOOOOL@@@@@@@@GOOOOOOOOOOOOOOOOO@@GOOOOOOOOOOOOOOOOO@@GOOOOOOOOOOOOOOOOO@@GOOOOOOOOOOOOOOOOO@@GOOOOOOOOOOOOOOOOO@@GOOOOOOOOOOOOOOOOO@@GOOOOOOOOOOOOOOOOO@@GOOOOOOOOOOOOOOOOO@@GOOOOOOOOOOOOOOOOO@@GOOOOOOOOOOOOOOOOO@@GOOOOOOOOOOOOOOOOO@@GOOOOOOOOOOOOOOOOO@@GOOOOOOOOOOOOOOOOO@@GOOOOOOOOOOOOOOOOO@@GOOOOOOOOOOOOOOOOO@@GOOOOOOOOOOOOOOOOO@@GOOOOOOOOOOOOOOOOO@@GOOOOOOOOOOOOOOOOO@@GOOOOOOOOOOOOOOOOO@@GOOOOOOOOOOOOOOOOO@@GOOOOOOOOOOOOOOOOO@@GOOOOOOOOOOOOOOOOO@@GOOOOOOOOOOOOOOOOO@@GOOOOOOOOOOOOOOOOO@@GOOOOOOOOOOOOOOOOO@@GOOOOOOOOOOOOOOOOO@@
)

(RPAQ? Manager.ACTIVEFLG NIL)

(RPAQ? Manager.SORTFILELSTFLG T)

(RPAQ? Manager.MENUROWS 20)

(RPAQ? Manager.DATASPACE NIL)

(RPAQ? MANAGER-WINDOWS NIL)

(RPAQ? MANAGER-MAIN-WINDOW NIL)

(RPAQ? MANAGER-OPEN-WINDOWS NIL)

(RPAQ? MANAGER-FILE-MENU NIL)

(RPAQ? MANAGER-FILELST-MENU NIL)

(RPAQ? MANAGER-FILE-OPERATIONS-MENU NIL)

(RPAQ? MANAGER-FILE-FILE-RELATION-MENU NIL)

(RPAQ? MENUBOLDFONT (FONTCOPY MENUFONT (QUOTE WEIGHT) (QUOTE BOLD)))

(RPAQ? MANAGER-MARKED-SHADE MENUBOLDFONT)
(FILESLOAD FILEBROWSER)



(* ; "for SEE command")

(DEFINEQ

(MANAGER
  [LAMBDA (POSITION)                                         (* ; "Edited  3-Sep-87 13:58 by raf")

(* ;;; "Turns manager on if its not already on")

    (if (OR (NULL Manager.ACTIVEFLG)
            (NULL MANAGER-MAIN-WINDOW)
            (Manager.FILELSTCHANGED?))
        then
          
          (* ;; "If either the manager was off or FILELST changed, rebuild main menu.")

        (if Manager.ACTIVEFLG then (Manager.MAINCLOSE))
        (LET ((Manager.ACTIVEFLG NIL))
             (UPDATEFILES))
        (if FILELST then (Manager.MAINOPEN POSITION)
            else
            (PROMPTPRINT "FILELST is empty; there are no files to manage."))
        else
        (TOTOPW MANAGER-MAIN-WINDOW])

(MANAGER.RESET
  [LAMBDA (RESTARTFLG)                                       (* ; "Edited 21-Aug-87 11:41 by raf")

(* ;;; "Remove all cached menu info, close the main window, clear the global data space.  If the RESTARTFLG is true, turn everything on again.")
          
          (* ;; "Delete all of the menu caches")

    (for X in FILEPKGCOMSPLST when (LITATOM X)
         do
         (REMPROP X 'MANAGER-ITEM-OPERATION-MENU))
    (SETQ MANAGER-MAIN-MENU NIL)
    (SETQ MANAGER-FILE-OPERATIONS-MENU NIL)
    (SETQ MANAGER-ITEM-FILE-RELATION-MENU NIL)
    (SETQ MANAGER-ITEM-OPERATION-MENU NIL)
    (LET [(REGION (AND RESTARTFLG (WINDOWP MANAGER-MAIN-WINDOW)
                       (WINDOWPROP MANAGER-MAIN-WINDOW 'REGION]
                                                             (* ; 
                                                        "Save away the old region (if there was one.")
          
          (* ;; "Close the main window and all subwindows.")

         (Manager.MAINCLOSE T)
          
          (* ;; "Clear the data space.")

         [SETQ Manager.DATASPACE (COPY '((NIL]
         (if RESTARTFLG then 
          
          (* ;; "Now turn it all on again.")

             [MANAGER (AND REGION (create POSITION XCOORD ← (fetch (REGION LEFT)
                                                                   of REGION)
                                         YCOORD ← (fetch (REGION BOTTOM)
                                                         of REGION]
             else
             (SETQ Manager.ACTIVEFLG NIL])

(Manager.ADDADV
  [LAMBDA (!VALUE FILECOMS NAME COMSTYPE)                    (* ; "Edited 16-Aug-87 22:38 by raf")

(* ;;; "Called when any file's COMS are added to or deleted from.  For each open subitem window of that file, if we're under ADDTOFILES? save the change, otherwise update the window.")

    (PROG (FILE SUBITEMS ITEMS)
          (if (OR (NULL !VALUE)
                  (LISTP FILECOMS))
              then
              (RETURN)
              else
              (if [SETQ FILE (for F in FILELST thereis (EQ FILECOMS (FILECOMS F]
                  then
                  (for WINDOW in MANAGER-OPEN-WINDOWS bind STUFF when
                       (AND (OPENWP WINDOW)
                            (EQ [CDR (SETQ STUFF (GETDATUM (CAR (WINDOWPROP WINDOW 'MENU]
                                COMSTYPE)
                            (EQ (CAR STUFF)
                                FILE))
                       do
                       (if MANAGER-ADDTOFILES? then (pushnew MANAGER-CASES STUFF)
                           else
                           (Manager.COMSOPEN FILE COMSTYPE)))
                  (Manager.RESETSUBITEMS FILE COMSTYPE])

(Manager.ADDTOFILES?
  [LAMBDA NIL                                                (* lmm "16-Nov-86 23:16")
    (for CASE in MANAGER-CASES do (Manager.COMSOPEN (CAR CASE)
                                         (CDR CASE)))
    (SETQ MANAGER-CASES NIL])

(Manager.ALTERMARKING
  [LAMBDA (ITEM TYPE MARKING?)                               (* ; "Edited  3-Sep-87 16:39 by raf")

(* ;;; "Called from MARKSCHANGED or UNMARKASCHANGED.")

    (COND
       ((EQ MARKING? 'CLISP)                                 (* ; " ignore")

        )
       ((AND (EQ ITEM 'FILELST)
             (EQ TYPE 'VARS))                                (* ; "FILELST has been edited.")

        (MANAGER))
       ((EQ TYPE 'FILES)                                     (* ; "A whole file has been marked.")

        (UPDATEFILES))
       (T (* ;; "For each manager menu window that's open we look to see if it contains the named definition.  We can only update a menu if the window is expanded (and can't see the menu when its window is shrunk).")

          (for WINDOW in MANAGER-OPEN-WINDOWS bind MENU (UPDATEFILES ← NIL)
               when
               [AND (OPENWP WINDOW)
                    (SETQ MENU (CAR (WINDOWPROP WINDOW 'MENU]
               do
               (if [AND (Manager.MENUHASITEM ITEM MENU)
                        (EQ TYPE (CDR (GETDATUM MENU]
                   then
                   (SELECTQ MARKING?
                       ((DELETED DEFINED) 
                            (SETQ UPDATEFILES T)
                            (Manager.COMSOPEN (CAR (GETDATUM MENU))
                                   TYPE NIL))
                       (Manager.HIGHLIGHT ITEM MENU MARKING?)))
               finally
               (Manager.MAINUPDATE UPDATEFILES])

(Manager.DO.COMMAND
  [LAMBDA (COMMAND ITEM COMSTYPE FILE MENU)                  (* ; "Edited  3-Sep-87 16:41 by raf")

    (if (EQ COMSTYPE 'FILEVARS)
        then
        (SETQ COMSTYPE 'VARS)                                (* ; "The Manager currently does unnatural things with the FILEVARS type, this is a hack to compensate for it. E.g., editing a FILEVARS = editing the VARS, etc.")

        )
    (SELECTQ COMMAND
        (NIL                                                 (* ; "Do nothing.")
)
        (EDIT [WITH-READER-ENVIRONMENT (if FILE then (Manager.GET.ENVIRONMENT FILE)
                                           else
                                           (MAKE-READER-ENVIRONMENT *PACKAGE* *READTABLE* *READ-BASE*
                                                  ))         (* ; "SEdit does not use *package*. ")

                     (COND
                        ((EQ COMSTYPE 'FILES)
                         (ED ITEM 'PROPERTY-LIST))
                        ((NULL COMSTYPE)
                         (EDITDEF 'FILELST 'VARS))
                        (T (EDITDEF ITEM COMSTYPE])
        (ADD.PROCESS
         `[CL:APPLY
           ',[FUNCTION (LAMBDA (COMMAND ITEM COMSTYPE FILE MENU)
                         (WITH-READER-ENVIRONMENT
                          (if FILE then (Manager.GET.ENVIRONMENT FILE)
                              else
                              (MAKE-READER-ENVIRONMENT *PACKAGE* *READTABLE* *READ-BASE*))
                          (LET
                           ((ACTIVITY-WINDOW NIL)
                            (ACTIVITY-WINDOW-WAS-SHRUNK NIL))
                           [RESETLST
                            (RESETSAVE (TTY.PROCESS (THIS.PROCESS)))
                            [if [NOT (FMEMB COMMAND
                                            '(BREAK TRACE UNBREAK CHANGED DELETED DEFINED UNMARK SEE 
                                                    LIST HARDCOPY REMOVE NIL]
                                then                         (* ; "steal the TTY, if we really need it (there are also further complementary lists at the bottom of the following BLOCK).")

                                (TTYDISPLAYSTREAM (SETQ ACTIVITY-WINDOW (Manager.WINDOW)))
                                (SETQ ACTIVITY-WINDOW-WAS-SHRUNK (NOT (OPENWP ACTIVITY-WINDOW]
                            (CL:BLOCK
                             NIL
                             (CL:ECASE
                              COMMAND
                              (READVISE (APPLY* (FUNCTION READVISE)
                                               ITEM))
                              (UNADVISE (APPLY* (FUNCTION UNADVISE)
                                               ITEM))
                              (SHOWADVICE (printout T .FONT LAMBDAFONT 
                                                 "Advised and traced fns and functions:" .FONT 
                                                 DEFAULTFONT T)
                                     (for ITEM in ADVISEDFNS do (printout T 10 ITEM T)))
                              [RESET (COND
                                        ((MOUSECONFIRM "Reset the Manager destroying all the menus? " 
                                                NIL T)
                                         (CL:FORMAT T 
                                "Expunging and reconstructing the Manager's menus~%%Please Stand By."
                                                )
                                         (MANAGER.RESET T)
                                         (CL:FORMAT T "~&Done.~%%-----")
                                         (CLOSEW T]
                              [QUIT (COND
                                       ((MOUSECONFIRM "Quit the Manager? " NIL T)
                                        (Manager.MAINCLOSE T)
                                        (CLOSEW T]
                              (RELOAD (CL:FORMAT T "~&Loading ~A definition of ~S from ~A." ITEM 
                                             COMSTYPE FILE)
                                     (LOADDEF ITEM COMSTYPE FILE))
                              (SHOWDEF (printout T .FONT LAMBDAFONT COMSTYPE " definition of " ITEM 
                                              .FONT DEFAULTFONT " (source file format):" T)
                                     (SHOWDEF ITEM COMSTYPE))
                              (BREAK (APPLY* 'BREAK ITEM))
                              (TRACE (EVAL (LIST 'TRACE ITEM)))
                              (UNBREAK (EVAL (LIST 'UNBREAK ITEM)))
                              (DISASSEMBLE (printout T .FONT LAMBDAFONT "Compiled code for " ITEM ":" 
                                                  .FONT DEFAULTFONT T)
                                     (INSPECTCODE ITEM))
                              (PV (printout T .FONT LAMBDAFONT "Value of " ITEM ":" .FONT DEFAULTFONT 
                                         T (if (BOUNDP ITEM)
                                               then
                                               (EVAL ITEM)
                                               else "Not bound!")))
                              (PF (printout T .FONT LAMBDAFONT "Function definition of " ITEM ":" 
                                         .FONT DEFAULTFONT T)
                                  (PF ITEM))
                              (PL (printout T .FONT LAMBDAFONT "Property list for " ITEM ":" .FONT 
                                         DEFAULTFONT T)
                                  (PRINTPROPS (if (EQ COMSTYPE 'PROPS)
                                                  then
                                                  (CAR ITEM)
                                                  else ITEM)))
                              (CLDESCRIBE (printout T .FONT LAMBDAFONT "Description of " ITEM ":" 
                                                 .FONT DEFAULTFONT T)
                                     (CL:DESCRIBE ITEM))
                              (CLDOC (printout T .FONT LAMBDAFONT "Documentation for " ITEM ":" .FONT 
                                            DEFAULTFONT T)
                                     (CL:DOCUMENTATION ITEM))
                              [FIELDS (printout T .FONT LAMBDAFONT "Fields of " ITEM ":" .FONT 
                                             DEFAULTFONT T (REVERSE (RECORDFIELDNAMES ITEM]
                              (ARGS (printout T .FONT LAMBDAFONT "Arguments of " ITEM ": " .FONT 
                                           DEFAULTFONT T 10 (SMARTARGLIST ITEM)
                                           T))
                              (EDITCALLERS (EDITCALLERS ITEM FILE))
                              [COPYDEF (LET [(FILENAME (Manager.PROMPT (CONCAT "Rename " ITEM " to: "
                                                                              ]
                                            (if FILENAME then (COPYDEF ITEM FILENAME COMSTYPE]
                              [RENAME (LET [(FILENAME (Manager.PROMPT (CONCAT "Rename " ITEM " to: "]
                                           (if FILENAME then (RENAME ITEM FILENAME COMSTYPE FILE]
                              [RENAME-ALL (LET [(FILENAME (Manager.PROMPT (CONCAT "Rename " ITEM 
                                                                                 " to: "]
                                               (if FILENAME then (RENAME ITEM FILENAME COMSTYPE 
                                                                        FILELST]
                              (DELETE (if (MOUSECONFIRM (CONCAT "DELETE the " COMSTYPE " " ITEM 
                                                               " from " FILE "?"))
                                          then
                                          (DELFROMFILES ITEM COMSTYPE FILE)))
                              [LOAD (LET ((FILENAME (Manager.PROMPT "Filename: ")))
                                         (if FILENAME then (LOAD FILENAME]
                              [LOADFNSLATER (LET ((FILENAME (Manager.PROMPT "Filename: ")))
                                                 (if FILENAME then (LOADFNS NIL FILENAME 'ALLPROP
                                                                          'VARS]
                              [LOADFNSNOW (LET ((FILENAME (Manager.PROMPT "Filename: ")))
                                               (if FILENAME then (LOADFNS T FILENAME 'ALLPROP
                                                                        'VARS]
                              [LOADFROMLATER (LET ((FILENAME (Manager.PROMPT "Filename: ")))
                                                  (if FILENAME then (LOADFROM FILENAME]
                              [LOADFROMNOW (LET ((FILENAME (Manager.PROMPT "Filename: ")))
                                                (if FILENAME then (LOADFROM FILENAME T]
                              [ADDFILE (LET ((FILENAME (Manager.PROMPT "Filename: ")))
                                            (if FILENAME then (ADDFILE FILENAME]
                              [SYSLOAD (COND
                                          ((MOUSECONFIRM (CONCAT "Do you really want to SYSLOAD " 
                                                                FILE "?" NIL T))
                                           NIL
                                           (LOAD FILE 'SYSLOAD]
                              [MOVE (LET [(ANSWER (Manager.GETFILE (CONCAT "File to move " COMSTYPE 
                                                                          " " ITEM " to"]
                                         (AND ANSWER (MOVETOFILE ANSWER ITEM COMSTYPE FILE]
                              [COPY (LET [(ANSWER (Manager.GETFILE (CONCAT "File to copy " COMSTYPE 
                                                                          " " ITEM " to"]
                                         (AND ANSWER (ADDTOFILE ITEM COMSTYPE ANSWER]
                              ((CHANGED DELETED DEFINED)
                               (if COMSTYPE then (MARKASCHANGED ITEM COMSTYPE COMMAND)
                                   else
                                   (MARKASCHANGED (FILECOMS ITEM)
                                          'VARS COMMAND)
                                   (UPDATEFILES)             (* ; "This is needed because the main menu is a special case.  Its not in the open windows list, nor does it carry %"type%" information (like that it contains filevars).")

                                   ))
                              (UNMARK (if (EQ COMSTYPE 'FILES)
                                          then               (* ; "whole file")

                                          (COND
                                             ((MOUSECONFIRM (CONCAT "Unmark entire contents of " FILE 
                                                                   "?" NIL T))
                                              (/RPLACD (GETPROP FILE 'FILE)
                                                     NIL)
                                              (Manager.insurefilehighlights FILE)
                                              (Manager.HIGHLIGHT FILE MENU)))
                                          else               (* ; "single item")

                                          (UNMARKASCHANGED ITEM COMSTYPE)))
                              (SEE (FB.FASTSEE.ONEFILE FILE
                                          (LET [(W (CREATEW NIL (CONCAT "Seeing " FILE "..."]
                                               (DSPSCROLL 'ON W)
                                               (WINDOWPROP W 'PAGEFULLFN 'FB.SEEFULLFN)
                                               (TTYDISPLAYSTREAM W)
                                               W)))
                              (LOAD (printout T .FONT LAMBDAFONT "Loading file " FILE "." .FONT 
                                           DEFAULTFONT T)
                                    (LOAD FILE))
                              ((MAKEFILE NEW FAST)
                               (if FILE then (printout T .FONT LAMBDAFONT "Writing file " FILE "." 
                                                    .FONT DEFAULTFONT T)
                                   (PRINT (MAKEFILE FILE (if (EQ COMMAND 'MAKEFILE)
                                                             then NIL else COMMAND))
                                          T)
                                   else
                                   (printout T .FONT LAMBDAFONT "Writing files ")
                                   [PRINT (MAKEFILES (if (EQ COMMAND 'MAKEFILE)
                                                         then NIL else (LIST COMMAND]
                                   (printout T .FONT DEFAULTFONT T)))
                              (COMMON-MAKEFILE (FILESLOAD 'COMMON-MAKEFILE)
                                     (if FILE then
                                         (printout T .FONT LAMBDAFONT 
                                                "Writing CommonLisp source into " FILE ".LSP" .FONT 
                                                DEFAULTFONT T)
                                         (PRINT (USER::COMMON-MAKEFILE FILE)
                                                T)
                                         else
                                         (CL:FORMAT T 
                                          "~&CommonLispify must be selected separately for each file"
                                                )))
                              ((LIST HARDCOPY)
                               (LISTFILES1 FILE))
                              (CLEANUP (printout T .FONT LAMBDAFONT "Cleanup..." .FONT DEFAULTFONT T)
                                                             (* ; 
                                     "These are different, presumably because CLEANUP is an NLAMBDA.")

                                     (if FILE then (APPLY* (FUNCTION CLEANUP)
                                                          FILE)
                                         else
                                         (CLEANUP)))
                              (CLEANUPT (printout T .FONT LAMBDAFONT 
                                               "Changing default cleanup compiler:" .FONT DEFAULTFONT 
                                               T "Old value " *DEFAULT-CLEANUP-COMPILER* T 
                                               "New value: " (SETQ *DEFAULT-CLEANUP-COMPILER*
                                                              'TCOMPL)
                                               T))
                              (CLEANUPC (printout T .FONT LAMBDAFONT 
                                               "Changing default cleanup compiler:" .FONT DEFAULTFONT 
                                               T "Old value " *DEFAULT-CLEANUP-COMPILER* T 
                                               "New value: " (SETQ *DEFAULT-CLEANUP-COMPILER*
                                                              'COMPILE-FILE)
                                               T))
          
          (* ;; " Masterscope stuff")

                              [ANALYZE (printout T .FONT LAMBDAFONT "Analyzing the file " FILE 
                                              " with MasterScope..." .FONT DEFAULTFONT T)
                                     (MASTERSCOPE `(ANALYZE FNS ON %, FILE]
                              [CHECK (printout T .FONT LAMBDAFONT "Checking the file " FILE 
                                            " with MasterScope..." .FONT DEFAULTFONT T)
                                     (MASTERSCOPE `(CHECK %, FILE]
                              [DESCRIBE (SELECTQ COMSTYPE
                                            (VARS [CL:FORMAT T "~&~a is used by:~%% ~a" ITEM
                                                         (MASTERSCOPE
                                                          `(WHO USES ',ITEM])
                                            (PROGN NIL
                                                   (printout T .FONT LAMBDAFONT 
                                                          "MasterScope analysis of " ITEM ":" .FONT 
                                                          DEFAULTFONT T)
                                                   (MSDESCRIBE ITEM]
                              [SHOWPATHTO (printout T .FONT LAMBDAFONT "Showing who calls " ITEM 
                                                 " with MasterScope..." .FONT DEFAULTFONT T)
                                     (MASTERSCOPE `(SHOW PATHS TO %, ITEM]
                              [SHOWPATHFROM (printout T .FONT LAMBDAFONT "Showing who is called by " 
                                                   ITEM " with MasterScope..." .FONT DEFAULTFONT T)
                                     (MASTERSCOPE `(SHOW PATHS FROM %, ITEM]
                              [SHOWPATHFILE (printout T .FONT LAMBDAFONT 
                                                   "Showing who is called by functions in the file " 
                                                   ITEM " with MasterScope..." .FONT DEFAULTFONT T)
                                     (MASTERSCOPE `(SHOW PATHS FROM ON %, FILE]
          
          (* ;; "DATABASEFNS stuff")

                              (DB (FILESLOAD 'DATABASEFNS)
                                  (CL:FORMAT T 
                                       "~&Global DataBaseFNS Flags:~%%SAVEDBFLG = ~a, LOADDBFLG = ~a" 
                                         SAVEDBFLG LOADBFLG))
                              (DBFILE (FILESLOAD 'DATABASEFNS)
                                     (CL:FORMAT T "~&The DATABASE prop for ~a is: ~a" FILE
                                            (GETPROP FILE 'DATABASE))
                                     (CL:FORMAT T 
                                       "~&Global DataBaseFNS Flags:~%%SAVEDBFLG = ~a, LOADDBFLG = ~a" 
                                            SAVEDBFLG LOADBFLG))
                              (DBON (FILESLOAD 'DATABASEFNS)
                                    (SETQ LOADBFLG 'ON)
                                    (SETQ SAVEDBFLG 'ON))
                              (DBOFF (FILESLOAD 'DATABASEFNS)
                                     (SETQ LOADBFLG 'OFF)
                                     (SETQ SAVEDBFLG 'OFF))
                              (DBASK (FILESLOAD 'DATABASEFNS)
                                     (SETQ LOADBFLG 'ASK)
                                     (SETQ SAVEDBFLG 'ASK))
                              (DBLOADON (FILESLOAD 'DATABASEFNS)
                                     (SETQ LOADBFLG 'ON))
                              (DBSAVEON (FILESLOAD 'DATABASEFNS)
                                     (SETQ SAVEDBFLG 'ON))
                              (DBLOADOFF (FILESLOAD 'DATABASEFNS)
                                     (SETQ LOADBFLG 'OFF))
                              (DBSAVEOFF (FILESLOAD 'DATABASEFNS)
                                     (SETQ SAVEDBFLG 'OFF))
                              (DBLOADASK (FILESLOAD 'DATABASEFNS)
                                     (SETQ LOADBFLG 'ASK))
                              (DBSAVEASK (FILESLOAD 'DATABASEFNS)
                                     (SETQ SAVEDBFLG 'ASK))
                              (DBFILEON (FILESLOAD 'DATABASEFNS)
                                     (PUTPROP FILE 'DATABASE 'ON))
                              (DBFILEOFF (FILESLOAD 'DATABASEFNS)
                                     (PUTPROP FILE 'DATABASE 'OFF))
                              (DBFILEASK (FILESLOAD 'DATABASEFNS)
                                     (PUTPROP FILE 'DATABASE 'ASK))
                              (DUMPDB (printout T .FONT LAMBDAFONT 
                                             "Dumping the Masterscope Database for file " FILE .FONT 
                                             DEFAULTFONT T)
                                     (FILESLOAD 'DATABASEFNS)
                                     (DUMPDB FILE))
                              (LOADDB (printout T .FONT LAMBDAFONT 
                                             "Loading the Masterscope Database for file " FILE .FONT 
                                             DEFAULTFONT T)
                                     (FILESLOAD 'DATABASEFNS)
                                     (LOADDB FILE))
                              (COMPILE (printout T .FONT LAMBDAFONT "Compiling..." .FONT DEFAULTFONT 
                                              T)
                                     (if (EQ COMSTYPE 'FILES)
                                         then
                                         (APPLY* (FUNCTION COMPILEFILES)
                                                FILE)
                                         (Manager.REMOVE.DUPLICATE.ADVICE FILE)
                                         else
                                         (PRINT (CL:COMPILE ITEM)
                                                T)))
                              (CL:COMPILE-FILE (printout T .FONT LAMBDAFONT 
                                                      "Compiling using compile-file..." .FONT 
                                                      DEFAULTFONT T)
                                     (CL:COMPILE-FILE FILE)
                                     (Manager.REMOVE.DUPLICATE.ADVICE FILE))
                              (REMOVE (DELDEF FILE 'FILE))
                              (CHANGES                       (* ; "FILE is NIL from main menu")

                                     (Manager.CHANGED? FILE))
                              (FILES? (printout T .FONT LAMBDAFONT "Files and their changes:" .FONT 
                                             DEFAULTFONT T)
                                     (FILES?)))
          
          (* ;; "Relase the window now, but get ready to shrink it back down unless another manager command comes along and need the window.")

                             (if [NOT (FMEMB COMMAND
                                             '(BREAK TRACE UNBREAK CHANGED DELETED DEFINED UNMARK SEE 
                                                     LIST HARDCOPY REMOVE QUIT RESET NIL]
                                 then
                                 (CL:FORMAT T "~&------"]
          
          (* ;; 
    "Shink the dialog window after ten seconds so long as its not in use by another manager command.")

                           (if ACTIVITY-WINDOW-WAS-SHRUNK then
                               (if (FMEMB COMMAND
                                          '(SHOWDEF SHOWADVICE PV PF PL CLDESCRIBE CLDOC FIELDS ARGS 
                                                  DB DBFILE MAKEFILE NEW FAST COMMON-MAKEFILE 
                                                  CLEANUPT CLEANUPC CLEANUP ANALYZE CHECK DESCRIBE 
                                                  CHANGES FILES? COMPILE CL:COMPILE NIL))
                                   then
                                   (DISMISS 10000)
                                   else
                                   (DISMISS NIL))
                               (if (EQ ACTIVITY-WINDOW (CAR MANAGER-WINDOWS))
                                   then
                                   (SHRINKW T]
           '(,COMMAND ,ITEM ,COMSTYPE ,FILE ,MENU]
         'NAME
         'MANAGER-COMMAND))
    NIL])

(Manager.HIGHLIGHT
  [LAMBDA (ITEM MENU ON)                                     (* ; "Edited 31-Jul-87 17:33 by raf")

    (SHADEITEM (SASSOC ITEM (fetch ITEMS of MENU))
           MENU
           (if ON then MANAGER-MARKED-SHADE else 0])

(Manager.PROMPT
  [LAMBDA (PROMPT)                                           (* ; "Edited 17-Aug-87 14:31 by raf")

    (LET (W (Manager.WINDOW))
         (RESETFORM (TTY.PROCESS (THIS.PROCESS))
                (PROG1 (MKATOM (PROMPTFORWORD PROMPT NIL NIL W))
                       (printout W T])

(Manager.WINDOW
  [LAMBDA NIL                                                (* ; "Edited 21-Aug-87 12:04 by raf")

(* ;;; "Make a window for manager activity, and set TTYDISPLAYSTREAM into it.")

    (LET [(W (OR (pop MANAGER-WINDOWS)
                 (CREATEW NIL MANAGER-ACTIVITY-WINDOW-TITLE]
         (RESETSAVE NIL (LIST [FUNCTION (LAMBDA (W)
                                          (AND (OPENWP W)
                                               (TERPRI W))
                                          (push MANAGER-WINDOWS W]
                              W))
         (TTYDISPLAYSTREAM W)
         W])

(Manager.insurefilehighlights
  [LAMBDA (FILE)                                           (* ; "Edited 26-Jun-87 16:30 by andyiii")
                                                             (* ; 
                                             "insures open menus of a file are correctly highlighted")

    (SETQ FILE (ROOTFILENAME FILE))
    (for WINDOW in MANAGER-OPEN-WINDOWS bind MENU when
         (AND (OPENWP WINDOW)
              (EQ [CAR (GETDATUM (SETQ MENU (CAR (WINDOWPROP WINDOW 'MENU]
                  FILE))
         do
         [if (EQUAL (Manager.COLLECTCOMS FILE (CDR (GETDATUM MENU)))
                    (fetch (MENU ITEMS)
                           of MENU))
             then
             (Manager.COMSUPDATE WINDOW)                     (* ; "no change in contents")

             else
             (Manager.COMSOPEN FILE (CDR (GETDATUM MENU]     (* ; "contents changed")

         ])

(Manager.CHANGED?
  [LAMBDA (FILES)                                          (* ; "Edited 26-Jun-87 03:42 by andyiii")

    (bind CHANGES for FILE inside (OR FILES FILELST)
          first
          (TERPRI T)
          when
          [SETQ CHANGES (CDR (GETPROP FILE 'FILE]
          do
          (printout T .FONT LAMBDAFONT "Changes to " FILE .FONT DEFAULTFONT T)
          (for CHANGE in CHANGES do (printout T (CAR CHANGE)
                                           ":" 10 .PARA 10 0 (CDR CHANGE)
                                           T])

(Manager.CHECKFILE
  [LAMBDA (FILE)                                             (* ; "Edited 17-Aug-87 14:26 by raf")

(* ;;; "If called from ADDTOFILES? (special flag indicates this) and the file being checked is on the main menu, checks all of a particular FILE's submenus, otherwise rebuilds the main (FILELST) menu.  Called from advice on ADDFILE, ADDTOFILES? and LOAD.")

    (if (AND (NULL MANAGER-ADDTOFILES?)
             (Manager.MENUHASITEM FILE MANAGER-FILE-MENU))
        then
        (SETQ FILE (ROOTFILENAME FILE))
        [for WINDOW in MANAGER-OPEN-WINDOWS bind MENU when
             [AND (OPENWP WINDOW)
                  (EQ [CAR (GETDATUM (SETQ MENU (CAR (WINDOWPROP WINDOW 'MENU]
                      FILE)
                  (NOT (EQUAL (Manager.COLLECTCOMS FILE (CDR (GETDATUM MENU)))
                              (fetch (MENU ITEMS)
                                     of MENU]
             do
             (Manager.COMSOPEN FILE (CDR (GETDATUM MENU]
        else
        (MANAGER)
        (Manager.RESETSUBITEMS FILE])

(Manager.COLLECTCOMS
  [LAMBDA (FILE TYPE)                                        (* ; "Edited 16-Aug-87 22:13 by raf")

(* ;;; 
"Collect all the names of a particular type in a file, returning them in correct menu item format.")

    (PROG ((COMSLST (FILECOMSLST FILE TYPE)))
          (RETURN (Manager.SORTBYCOLUMN (COND
                                           ((NULL COMSLST)
                                            (RETURN))
                                           ((EQ TYPE 'VARS)
                                            (for VAR in COMSLST bind (FILEVARS ← (FILECOMSLST
                                                                                  FILE
                                                                                  'FILEVARS))
                                                 when
                                                 (NOT (FMEMB VAR FILEVARS))
                                                 collect
          
          (* ;; "List of item to get around menu feature that list's first item is used for display.")

                                                 (LIST VAR)))
                                           (T 
          
          (* ;; "List of item to get around menu feature that list's first item is used for display.")

                                              (MAPCAR (INTERSECTION COMSLST COMSLST)
                                                     (FUNCTION LIST])

(Manager.COMS.WSF
  [LAMBDA (ITEM MENU KEY)                                  (* ; "Edited 25-Jun-87 02:00 by andyiii")

    (SETQ ITEM (CAR ITEM))                                   (* ; "Menu items handed in are list of item to get around menu feature that list has first item used to display!")

    (PROG (FILE COMSTYPE COMSLST FILECOMS COMMAND)
          (DECLARE (SPECVARS ITEM COMSTYPE))
          (if (NULL ITEM)
              then
              (RETURN))
          (if (.COPYKEYDOWNP.)
              then
              (RETURN (BKSYSBUF.GENERAL ITEM)))
          (SETQ COMSLST (GETDATUM MENU))
          (SETQ FILE (CAR COMSLST))
          (SETQ COMSTYPE (CDR COMSLST))
          [SETQ COMMAND
           (MENU (SELECTQ KEY
                     (LEFT [OR (GETPROP COMSTYPE 'MANAGER-ITEM-OPERATION-MENU)
                               [AND (GETPROP COMSTYPE 'MANAGER-DEFINITION-TYPE-COMMANDS)
                                    (PUTPROP COMSTYPE 'MANAGER-ITEM-OPERATION-MENU
                                           (create MENU ITEMS ← (APPEND 
                                                                      MANAGER-ITEM-OPERATION-COMMANDS
                                                                       (GETPROP COMSTYPE '
                                                                     MANAGER-DEFINITION-TYPE-COMMANDS
                                                                              ))
                                                  CENTERFLG ← T TITLE ← (CONCAT COMSTYPE 
                                                                               " operations")
                                                  CHANGEOFFSETFLG ← 'Y]
                               MANAGER-ITEM-OPERATION-MENU
                               (SETQ MANAGER-ITEM-OPERATION-MENU
                                (create MENU ITEMS ← MANAGER-ITEM-OPERATION-COMMANDS CENTERFLG ← T 
                                       TITLE ← (CONCAT COMSTYPE " operations")
                                       CHANGEOFFSETFLG ← 'Y])
                     (MIDDLE (OR MANAGER-ITEM-FILE-RELATION-MENU
                                 (create MENU ITEMS ← MANAGER-ITEM-FILE-RELATION-COMMANDS CENTERFLG ← 
                                        T TITLE ← "Other operations" CHANGEOFFSETFLG ← 'Y)))
                     (SHOULDNT]
          (if COMMAND then (Manager.DO.COMMAND COMMAND ITEM COMSTYPE FILE])

(Manager.COMSOPEN
  [LAMBDA (FILE TYPE FLASHFLG)                               (* ; "Edited 16-Aug-87 22:30 by raf")

(* ;;; "Open a subitems window.  If it already exists, and all subitems of this type have been deleted, close the window, otherwise open it, flash and check the highlights.  If the file's subitems for this type have changed, then rebuild the menu. ")

    (PROG ((COMSLST (Manager.COLLECTCOMS FILE TYPE))
           (COMSTYPE (FILECOMS FILE TYPE))
           MENU WINDOW POSITION)
          (COND
             [COMSLST (COND
                         ([AND (SETQ MENU (GETDATUM COMSTYPE))
                               (EQUAL (fetch (MENU ITEMS)
                                             of MENU)
                                      COMSLST)
                               (SETQ WINDOW (OR (WFROMMENU MENU)
                                                (for W in MANAGER-OPEN-WINDOWS thereis
                                                     (EQ (WINDOWPROP W 'COMSTYPE)
                                                         COMSTYPE]
                          (COND
                             (FLASHFLG (FLASHWINDOW WINDOW 2))
                             (T (TOTOPW WINDOW)))
                          (Manager.INSUREHIGHLIGHTS MENU (Manager.FILECHANGES FILE TYPE)))
                         (T 
          
          (* ;; "make sure all the title is visible. This is hard since the menu does not exist yet.")

                            (SETQ MENU (create MENU ITEMS ← COMSLST MENUCOLUMNS ← (
                                                                                  Manager.MENUCOLUMNS
                                                                                   COMSLST)
                                              WHENSELECTEDFN ← (FUNCTION Manager.COMS.WSF)
                                              MENUOUTLINESIZE ← 0))
                            (COND
                               ((SETQ WINDOW (WFROMMENU (GETDATUM COMSTYPE)))
                                (SETQ POSITION (with REGION (WINDOWPROP WINDOW 'REGION)
                                                     (create POSITION XCOORD ← LEFT YCOORD ← BOTTOM))
                                 )
                                (CLOSEW WINDOW)))
                            [ADDMENU MENU
                                   (SETQ WINDOW
                                    (CREATEW [with MENU MENU
                                                   (LET ((IW (WIDTHIFWINDOW IMAGEWIDTH))
                                                         (IH (HEIGHTIFWINDOW IMAGEHEIGHT T)))
                                                        (with POSITION (OR POSITION (GETBOXPOSITION
                                                                                     IW IH))
                                                              (create REGION LEFT ← XCOORD WIDTH ← IW 
                                                                     BOTTOM ← YCOORD HEIGHT ← IH]
                                           (CONCAT TYPE " on " FILE]
                            [WINDOWPROP WINDOW 'CLOSEFN (FUNCTION (LAMBDA (WINDOW)
                                                                    [PUTDATUM
                                                                     (CAR (WINDOWPROP WINDOW
                                                                                 'MENU]
                                                                    (PUTDATUM (WINDOWPROP
                                                                               WINDOW
                                                                               'COMSTYPE))
                                                                    (SETQ MANAGER-OPEN-WINDOWS
                                                                     (DREMOVE WINDOW 
                                                                            MANAGER-OPEN-WINDOWS]
                            (for ITEM in (Manager.FILECHANGES FILE TYPE)
                                 do
                                 (Manager.HIGHLIGHT ITEM MENU T))
                            (PUTDATUM COMSTYPE MENU)
                            (PUTDATUM MENU (CONS FILE TYPE))
                            (push MANAGER-OPEN-WINDOWS WINDOW)
                            (WINDOWPROP WINDOW 'COMSTYPE COMSTYPE]
             ((SETQ WINDOW (WFROMMENU (GETDATUM COMSTYPE)))
              (CLOSEW WINDOW])

(Manager.COMSUPDATE
  [LAMBDA (WINDOW FLASHFLG)                                  (* ; "Edited 16-Aug-87 22:30 by raf")

(* ;;; "Open a window (if closed) and update the coms listed on the menu therein.  If items are the same, their highlighting is checked, otherwise the menu is rebuilt.")

    (PROG ([MENU (CAR (WINDOWPROP WINDOW 'MENU]
           CHANGELST FILE TYPE)
          (SETQ FILE (CAR (GETDATUM MENU)))
          (SETQ TYPE (CDR (GETDATUM MENU)))
          (SETQ CHANGELST (Manager.FILECHANGES FILE TYPE))
          [COND
             [(NULL (OPENWP WINDOW))
              (if (OPENWP (WINDOWPROP WINDOW 'ICONWINDOW))
                  then
                  (EXPANDW (WINDOWPROP WINDOW 'ICONWINDOW]
             (T (if FLASHFLG then (FLASHWINDOW WINDOW 2)
                    else
                    (TOTOPW WINDOW]
          (COND
             ((EQUAL (fetch (MENU ITEMS)
                            of MENU)
                     (Manager.COLLECTCOMS FILE TYPE))
              (Manager.INSUREHIGHLIGHTS MENU CHANGELST))
             (T (Manager.COMSOPEN FILE TYPE])

(Manager.HIGHLIGHTED
  [LAMBDA (MENU)                                             (* ; "Edited  9-Jul-87 13:57 by raf")

    (for X in (fetch (MENU SHADEDITEMS)
                     of MENU)
         collect
         (CAR (CAR (NTH (fetch (MENU ITEMS)
                               of MENU)
                        (CAR X])

(Manager.INSUREHIGHLIGHTS
  [LAMBDA (MENU SHOULD-BE-HIGHLIGHTED)                     (* ; "Edited 26-Jun-87 18:10 by andyiii")

    (LET ((HIGH (Manager.HIGHLIGHTED MENU)))
         (if (WFROMMENU MENU)
             then
             (REDISPLAYW (WFROMMENU MENU)))
         (for ITEM in HIGH when (NOT (FMEMB ITEM SHOULD-BE-HIGHLIGHTED))
              do
              (Manager.HIGHLIGHT ITEM MENU NIL))
         (for ITEM in SHOULD-BE-HIGHLIGHTED when (NOT (FMEMB ITEM HIGH))
              do
              (Manager.HIGHLIGHT ITEM MENU T])

(Manager.FILECHANGES
  [LAMBDA (FILE COMSTYPE)                                  (* ; "Edited 26-Jun-87 04:35 by andyiii")

    (CDR (FASSOC (if (EQ COMSTYPE 'FILEVARS)
                     then
                     'VARS else COMSTYPE)
                (CDR (GETPROP FILE 'FILE])

(Manager.FILELSTCHANGED?
  [LAMBDA NIL                                                (* ; "Edited 17-Aug-87 14:16 by raf")

    (NOT (EQUAL (if Manager.SORTFILELSTFLG then (SORT (COPY FILELST))
                    else FILELST)
                (Manager.MENUITEMS MANAGER-FILE-MENU])

(Manager.FILESUBTYPES
  [LAMBDA (FILE)                                             (* ; "Edited 16-Aug-87 22:05 by raf")

(* ;;; "Gather the names of all subtypes in a file's coms.")

    (for TYPE in FILEPKGTYPES bind COMSLST when
         (AND (NOT (FMEMB TYPE *UNMANAGED-TYPES*))
              (SETQ COMSLST (FILECOMSLST FILE TYPE))
              (if (EQ TYPE 'VARS)
                  then
                  (for VAR in COMSLST bind (FILEVARS ← (FILECOMSLST FILE 'FILEVARS))
                       thereis
                       (NOT (FMEMB VAR FILEVARS)))
                  else T))
         collect TYPE])

(Manager.GET.ENVIRONMENT
  [LAMBDA (FILE)                                           (* ; "Edited 26-Jun-87 18:53 by andyiii")
          
          (* ;; "Get's a file's environment, either from the cache in the makefile-environment property (which we initialize here if it hasn't been already) or as per the defaulting described in the Lyric release notes:")
          
          (* ;; "cache property exists?  use it,")
          
          (* ;; "new file? use *DEFAULT-MAKEFILE-ENVIRONMENT*,")
          
          (* ;; "old file which has environment in it?  use environment from old file,")
          
          (* ;; "otherwise use an interlisp style environment.")

    (LET
     [(ENVIRONMENT
       (OR (GETPROP FILE 'MAKEFILE-ENVIRONMENT)
           (PUTPROP FILE 'MAKEFILE-ENVIRONMENT
                  (LET ((DATE (FILEDATE FILE)))
                       (if (NULL DATE)
                           then *DEFAULT-MAKEFILE-ENVIRONMENT* else
                           (LET [(FORM (CL:WITH-OPEN-FILE (STREAM (OR (FINDFILE FILE)
                                                                      (CL:ERROR 
                                                          "Can't find file ~s to get its environment" 
                                                                             FILE)))
                                              (LET ((*READTABLE* (FIND-READTABLE "OLD-INTERLISP-FILE"
                                                                        ))
                                                    (*PACKAGE* (CL:FIND-PACKAGE "INTERLISP")))
                                                   (CL:READ STREAM]
                                (if (EQ 'DEFINE-FILE-INFO (CAR FORM))
                                    then
                                    (CDR FORM)
                                    else
                                    '(:READTABLE "INTERLISP" :PACKAGE "INTERLISP" :BASE 10]
     (APPLY #'MAKE-READER-ENVIRONMENT (CL:MAPCAR #'[LAMBDA (KEY TYPE COERCE)
                                                     (LET [(VALUE (EVAL (CL:GETF ENVIRONMENT KEY]
                                                          (if (TYPEP VALUE TYPE)
                                                              then VALUE else (CL:FUNCALL COERCE 
                                                                                     VALUE]
                                             '(:PACKAGE :READTABLE :BASE)
                                             '(PACKAGE CL:READTABLE INTEGER)
                                             '(CL:FIND-PACKAGE FIND-READTABLE CL:IDENTITY])

(Manager.GETFILE
  [LAMBDA (PROMPT PASSED-IN-FILE-LIST)                       (* ; "Edited 17-Aug-87 14:32 by raf")

    (LET ((FILE-LIST (OR PASSED-IN-FILE-LIST FILELST)))
         [COND
            ((OR (NULL (CAR MANAGER-FILELST-MENU))
                 (Manager.FILELSTCHANGED?))                  (* ; "what is this doing ???")

             (SETQ MANAGER-FILELST-MENU (create MENU TITLE ← PROMPT ITEMS ← (CONS '*newfile* 
                                                                                  FILE-LIST)
                                               WHENSELECTEDFN ← (FUNCTION (LAMBDA (ITEM MENU KEY)
                                                                            (PROG (ANSWER FILECOMS)
                                                                                  (COND
                                                                                     ((EQ
                                                                                       ITEM
                                                                                       '*newfile*)
                                                                                      (SETQ ANSWER
                                                                                       (
                                                                                       Manager.PROMPT
                                                                                        
                                                                                    "New file Name: "
                                                                                        ))
                                                                                      (ADDFILE ANSWER
                                                                                             )
                                                                                      (RETURN ANSWER)
                                                                                      )
                                                                                     (T (RETURN
                                                                                         ITEM]
         (MENU MANAGER-FILELST-MENU])

(Manager.INTITLE?
  [LAMBDA (WINDOW)                                           (* edited%: "31-Dec-00 16:40")
    (PROG (INTERIOR.HEIGHT REGION MENU)
          [SETQ MENU (CAR (WINDOWPROP WINDOW 'MENU]
          (SETQ INTERIOR.HEIGHT (FONTPROP (OR (fetch MENUTITLEFONT of MENU)
                                              (fetch MENUFONT of MENU))
                                       'HEIGHT))
          (with REGION (WINDOWPROP WINDOW 'REGION)
                (SETQ REGION (CREATEREGION LEFT (IDIFFERENCE TOP INTERIOR.HEIGHT)
                                    WIDTH INTERIOR.HEIGHT)))
          (RETURN (INSIDEP REGION LASTMOUSEX LASTMOUSEY])

(Manager.MAIN.WSF
  [LAMBDA (ITEM MENU KEY)
    (DECLARE (SPECVARS ITEM))                                (* ; "Edited 31-Jul-87 18:25 by raf")

    (PROG NIL
          [if (.COPYKEYDOWNP.)
              then
              (RETURN (COPYINSERT (CAR ITEM]
          (LET ((SLIDEOFFITEM (EQLENGTH ITEM 3)))            (* ; "A slideoff subitem was selected.")

               (SETQ ITEM (CADR ITEM))
               (SELECTQ KEY
                   (MIDDLE (COND
                              ((NOT SLIDEOFFITEM)
                               (Manager.DO.COMMAND [MENU (OR MANAGER-FILE-FILE-RELATION-MENU
                                                             (create MENU ITEMS ← 
                                                                  MANAGER-FILE-FILE-RELATION-COMMANDS 
                                                                    CENTERFLG ← T TITLE ← 
                                                                    "Other operations" 
                                                                    CHANGEOFFSETFLG ← 'Y]
                                      (CAR ITEM)
                                      'FILES
                                      (CAR ITEM)
                                      MENU))
                              (T (FLASHWINDOW (WFROMMENU MENU)
                                        1))))
                   (LEFT (COND
                            (SLIDEOFFITEM (Manager.COMSOPEN (CAR ITEM)
                                                 (CDR ITEM)
                                                 T))
                            (T                               (* ; "Standard selection.")

                               (Manager.DO.COMMAND [MENU (OR MANAGER-FILE-OPERATIONS-MENU
                                                             (SETQ MANAGER-FILE-OPERATIONS-MENU
                                                              (create MENU ITEMS ← 
                                                                     MANAGER-FILE-OPERATIONS-COMMANDS 
                                                                     CENTERFLG ← T TITLE ← 
                                                                     "File operations"]
                                      (CAR ITEM)
                                      'FILES
                                      (CAR ITEM)
                                      MENU))))
                   (FLASHWINDOW (WFROMMENU MENU)
                          1])

(Manager.MAINCLOSE
  [LAMBDA (SHUTDOWNFLG)                                      (* ; "Edited 20-Aug-87 16:18 by raf")

    (PROG (MENU ICON.WINDOW)
          (for WINDOW in (APPEND MANAGER-OPEN-WINDOWS)
               when
               (OR SHUTDOWNFLG (NOT (FMEMB [CAR (GETDATUM (CAR (WINDOWPROP WINDOW 'MENU]
                                           FILELST)))
               do
               (CLOSEW WINDOW))
          (if (SETQ ICON.WINDOW (WINDOWPROP MANAGER-MAIN-WINDOW 'ICON))
              then
              (CLOSEW ICON.WINDOW))
          (if SHUTDOWNFLG then (if (SETQ ICON.WINDOW (WINDOWPROP MANAGER-MAIN-WINDOW 'ICON))
                                   then
                                   (CLOSEW ICON.WINDOW))
              (AND MANAGER-MAIN-WINDOW (CLOSEW MANAGER-MAIN-WINDOW))
              (SETQ MANAGER-MAIN-WINDOW NIL))
          (for WINDOW in MANAGER-WINDOWS do (if SHUTDOWNFLG then (EXPANDW WINDOW))
               (CLOSEW WINDOW))
          (if SHUTDOWNFLG then (SETQ MANAGER-WINDOWS NIL])

(Manager.MAINMENUITEMS
  [LAMBDA NIL                                                (* ; "Edited 17-Aug-87 14:14 by raf")

(* ;;; "Returns the menu 'items' for the main manager file menu.  This is, for each file, the menu element and the subitems which contain all of the 'types' .  If there is already a file menu, we reuse the subitems rather than recomputing them.")

    (for FILE in (if Manager.SORTFILELSTFLG then (SORT (COPY FILELST))
                     else FILELST)
         collect
         `(%, FILE (%, FILE . FILEVARS)
              %,
              (CONCAT "Brings up a File Operations menu for the file " FILE)
              (SUBITEMS %,@ (for TYPE in (SORT (Manager.FILESUBTYPES FILE))
                                 collect
                                 `(%, TYPE (%, FILE %,@ TYPE)
                                      %,
                                      (CONCAT "Creates a " TYPE " submenu for the file " FILE])

(Manager.MAINOPEN
  [LAMBDA (POSITION)                                         (* ; "Edited 17-Aug-87 13:59 by raf")

(* ;;; "Builds the manager main (FILELST) menu at the indicated position.")

    (SETQ MANAGER-FILE-MENU (create MENU ITEMS ← (Manager.MAINMENUITEMS)
                                   WHENSELECTEDFN ← (FUNCTION Manager.MAIN.WSF)
                                   MENUCOLUMNS ← 1 MENUOUTLINESIZE ← 0))
    (LET (IW IH)
          
          (* ;; "some of the complexity here is so that, in the odd case that there are more files than will fit on the screen, the result will be a scrollable window")

         (ADDMENU MANAGER-FILE-MENU
                (SETQ MANAGER-MAIN-WINDOW
                 (CREATEW (with POSITION
                                (with MENU MANAGER-FILE-MENU (SETQ IW (MIN (WIDTHIFWINDOW IMAGEWIDTH)
                                                                           SCREENWIDTH))
                                                             (* ; 
                            "width of file menu.  Actually unlikely to be wider than screenwidth (!)")

                                      (SETQ IH (MIN (HEIGHTIFWINDOW IMAGEHEIGHT T)
                                                    SCREENHEIGHT))
                                                             (* ; 
                           "height of window;  could possibly be higher than screen if lots of files")

                                      (if (POSITIONP POSITION)
                                          then               (* ; 
                                                 "gave an initial position for the manager file menu")

                                          POSITION elseif (WINDOWP MANAGER-MAIN-WINDOW)
                                          then               (* ; 
                   "if there was a window, put the new one in the same place (and close the old one)")

                                          (PROG1 (with REGION (WINDOWPROP MANAGER-MAIN-WINDOW
                                                                     'REGION)
                                                       (create POSITION XCOORD ← LEFT YCOORD ← BOTTOM
                                                              ))
                                                 (CLOSEW MANAGER-MAIN-WINDOW))
                                          else               (* ; 
                                                             "let user say where to put the menu")

                                          (GETBOXPOSITION IW IH)))
                                (create REGION LEFT ← XCOORD WIDTH ← IW BOTTOM ← YCOORD HEIGHT ← IH))
                        "Manager")))
         [WINDOWPROP MANAGER-MAIN-WINDOW 'BUTTONEVENTFN
                (FUNCTION (LAMBDA (WINDOW)
                            (if (Manager.INTITLE? WINDOW)
                                then
                                [Manager.DO.COMMAND (MENU (OR MANAGER-MAIN-MENU
                                                              (SETQ MANAGER-MAIN-MENU
                                                               (create MENU TITLE ← 
                                                                      "Manager operations" ITEMS ← 
                                                                      MANAGER-MAIN-MENU-ITEMS 
                                                                      CENTERFLG ← T]
                                else
                                (MENUBUTTONFN WINDOW]
          
          (* ;; "Shrink to the manager icon, and remember to update when the expanding")

         [WINDOWPROP MANAGER-MAIN-WINDOW 'ICONFN (FUNCTION (LAMBDA (WIN OICON)
                                                             (LET ((IW (if (NULL OICON)
                                                                           then
                                                                           (ICONW MANAGER.BM 
                                                                                  MANAGER.BM.MASK)
                                                                           else OICON)))
                                                                  [WINDOWPROP IW 'EXPANDFN
                                                                         (FUNCTION (LAMBDA NIL
                                                                                     (
                                                                                   Manager.MAINUPDATE
                                                                                      NIL]
                                                                  IW]
         (SETQ Manager.ACTIVEFLG T)
         (Manager.MAINUPDATE T])

(Manager.MAINUPDATE
  [LAMBDA (FROMUPDATE)                                       (* ; "Edited 16-Aug-87 21:34 by raf")

(* ;;; "Updates the highlighting of the main (FILELST) menu.  Does not handle adding or removing of names from FILELST.  Typically called after Manager.ALTERMARKING.")

    (if (NOT FROMUPDATE)
        then
        (LET ((Manager.ACTIVEFLG NIL))
             (UPDATEFILES)))
    (Manager.INSUREHIGHLIGHTS MANAGER-FILE-MENU (for ITEM in (Manager.MENUITEMS MANAGER-FILE-MENU)
                                                     when
                                                     (CDR (GETPROP ITEM 'FILE))
                                                     collect ITEM])

(Manager.MAKEFILE.ADV
  [LAMBDA (FILE OPTIONS)                                     (* ; "Edited 20-Aug-87 15:04 by raf")

(* ;;; "After MAKEFILE(FILE), clear out all of file's marks")

    (LET ((OPTIONS (OR OPTIONS CLEANUPOPTIONS)))
         (if [if (LISTP OPTIONS)
                 then
                 (INTERSECTION '(ST STF) OPTIONS)
                 else
                 (FMEMB OPTIONS '(ST STF]
             then                                            (* ; 
                                    "If we stored definitions (I.E. advice) remove duplicate advice.")

             (Manager.REMOVE.DUPLICATE.ADVICE FILE)))
    (bind MENU (FILENAME ← (ROOTFILENAME FILE))
          for WINDOW in MANAGER-OPEN-WINDOWS when
          (AND (OPENWP WINDOW)
               (EQ [CAR (GETDATUM (SETQ MENU (CAR (WINDOWPROP WINDOW 'MENU]
                   FILENAME))
          do
          (Manager.INSUREHIGHLIGHTS MENU NIL)
          finally
          (Manager.HIGHLIGHT FILENAME MANAGER-FILE-MENU NIL])

(Manager.MENUCOLUMNS
  [LAMBDA (ITEMSLST)                                         (* ; "Edited 27-May-87 17:26 by raf")

    (PROG (NUMBER.COLUMNS MAX.ROW.WIDTH (BORDER 1))
          [SETQ MAX.ROW.WIDTH (IPLUS BORDER BORDER (for NAME in ITEMSLST largest (STRINGWIDTH NAME 
                                                                                        MENUFONT)
                                                        finally
                                                        (RETURN $$EXTREME]
          (SETQ NUMBER.COLUMNS (ADD1 (IQUOTIENT (SUB1 (LENGTH ITEMSLST))
                                            Manager.MENUROWS)))
          [if (IGREATERP (ITIMES NUMBER.COLUMNS MAX.ROW.WIDTH)
                     SCREENWIDTH)
              then
              (SETQ NUMBER.COLUMNS (MAX 1 (QUOTIENT SCREENWIDTH MAX.ROW.WIDTH]
          (RETURN NUMBER.COLUMNS])

(Manager.MENUHASITEM
  [LAMBDA (ITEM MENU)                                        (* ; "Edited 31-Jul-87 17:33 by raf")
                                                             (* ; 
          "Elaborate member check, since menu items are nested in an extra list to display properly.")

    (SASSOC ITEM (fetch ITEMS of MENU])

(Manager.MENUITEMS
  [LAMBDA (MENU)                                             (* ; "Edited  9-Jul-87 14:06 by raf")

    (for ITEM in (fetch (MENU ITEMS)
                        MANAGER-FILE-MENU)
         collect
         (CAR ITEM])

(Manager.REMOVE.DUPLICATE.ADVICE
  [LAMBDA (FILE)                                             (* ; "Edited 20-Aug-87 13:45 by raf")

(* ;;; "Removes (some) duplicated advice when a source file is loaded.  A patch to the behavior of advice loading.  This is here mostly for the convenience of the Manager implementors, since its not fully general.")

    (for ADVICE in (FILECOMSLST FILE 'ADVICE)
         do
         (LET [(DEFINITIONS (GETDEF ADVICE 'ADVICE 'CURRENT]
              (bind (CHANGED ← NIL)
                    while
                    (AND (GREATERP (LENGTH DEFINITIONS)
                                1)
                         (EQUAL (CAR DEFINITIONS)
                                (CADR DEFINITIONS)))
                    do                                       (* ; 
                        "Note that this only checks duplications at the front of the list of advice.")

                    (pop DEFINITIONS)
                    (SETQ CHANGED T)
                    finally
                    (if CHANGED then (LET ((Manager.ACTIVEFLG NIL))
                                                             (* ; 
                                                 "Turn this off so we don't see the updates animate.")

                                          (PUTDEF ADVICE 'ADVICE DEFINITIONS)
                                          (UNMARKASCHANGED ADVICE 'ADVICE])

(Manager.RESETSUBITEMS
  [LAMBDA (FILE COMSTYPE)                                    (* ; "Edited 16-Aug-87 22:06 by raf")

(* ;;; "Rebuilds the subitems slide off menu for a given file if they've actually changed.")

    (AND FILE
         (PROG (ITEMS MENU.ITEMS SUBTYPES)
               (SETQ MENU.ITEMS (FASSOC FILE (fetch (MENU ITEMS)
                                                    of MANAGER-FILE-MENU)))
               (SETQ ITEMS (NTH MENU.ITEMS 4))
               (SETQ SUBTYPES (Manager.FILESUBTYPES FILE))
               (if [AND ITEMS (OR (NULL COMSTYPE)
                                  (if (FASSOC COMSTYPE (CDAR ITEMS))
                                      then
                                      (NULL (FMEMB COMSTYPE SUBTYPES))
                                      else
                                      (FMEMB COMSTYPE SUBTYPES]
                   then
                   (RPLACA ITEMS `(SUBITEMS %,@ (for TYPE in SUBTYPES collect
                                                     `(%, TYPE (%, FILE %,@ TYPE)
                                                          %,
                                                          (CONCAT "Creates a " TYPE 
                                                                 " submenu for the file " FILE])

(Manager.SORT.COMS
  [LAMBDA (A B)                                            (* ; "Edited 19-Jun-87 21:40 by andyiii")

(* ;;; 
"This allows PCL (Portable CommonLoops) method definitions to the display in a sorted fashion.")

(* ;;; "They are stored on the fileCOMS variable as:")

(* ;;; "(method-name (required-arg-type-specifiers))")

    (ALPHORDER (CONCAT A)
           (CONCAT B])

(Manager.SORTBYCOLUMN
  [LAMBDA (ITEMS)                                          (* ; "Edited 19-Jun-87 20:58 by andyiii")

    (PROG ((LNGTH (FLENGTH ITEMS))
           COLUMNCOUNT COLUMNLENGTH EXTRAITEMCOLUMNS RESULT)
          (if (NULL ITEMS)
              then
              (RETURN))
          (SORT ITEMS 'Manager.SORT.COMS)
          (SETQ COLUMNCOUNT (Manager.MENUCOLUMNS ITEMS))
          (SETQ COLUMNLENGTH (IQUOTIENT LNGTH COLUMNCOUNT))
          (SETQ EXTRAITEMCOLUMNS (IREMAINDER LNGTH COLUMNCOUNT))
          [SETQ RESULT (for I to COLUMNCOUNT collect (for J to (COND
                                                                  ((ILEQ I EXTRAITEMCOLUMNS)
                                                                   (ADD1 COLUMNLENGTH))
                                                                  (COLUMNLENGTH))
                                                          collect
                                                          (pop ITEMS]
          (RETURN (while (CAR RESULT)
                         join
                         (DREMOVE NIL (for LST on RESULT collect (PROG1 (CAAR LST)
                                                                        (RPLACA LST (CDAR LST])
)
(XCL:REINSTALL-ADVICE (QUOTE ADDFILE) :AROUND (QUOTE ((:LAST (PROG1 (LET ((Manager.ACTIVEFLG NIL)) *) (AND Manager.ACTIVEFLG (Manager.CHECKFILE FILE)))))))
(XCL:REINSTALL-ADVICE (QUOTE ADDTOFILES?) :AROUND (QUOTE ((:LAST (PROG1 (LET ((MANAGER-ADDTOFILES? T)) *) (AND Manager.ACTIVEFLG (Manager.ADDTOFILES?)))))))
(XCL:REINSTALL-ADVICE (QUOTE MAKEFILE) :AROUND (QUOTE ((:LAST (PROG1 (LET ((Manager.ACTIVEFLG NIL)) *) (AND Manager.ACTIVEFLG (Manager.MAKEFILE.ADV FILE OPTIONS)))))))
(XCL:REINSTALL-ADVICE (QUOTE MARKASCHANGED) :AROUND (QUOTE ((:LAST (PROG1 (LET ((Manager.ACTIVEFLG NIL)) *) (AND Manager.ACTIVEFLG (Manager.ALTERMARKING NAME TYPE (OR REASON T))))))))
(XCL:REINSTALL-ADVICE (QUOTE UNMARKASCHANGED) :AROUND (QUOTE ((:LAST (LET (!VALUE) (PROG1 (LET ((Manager.ACTIVEFLG NIL)) (SETQ !VALUE *)) (AND Manager.ACTIVEFLG !VALUE (Manager.ALTERMARKING NAME TYPE NIL))))))))
(XCL:REINSTALL-ADVICE (QUOTE UPDATEFILES) :AROUND (QUOTE ((:LAST (PROG1 (LET ((Manager.ACTIVEFLG NIL)) *) (AND Manager.ACTIVEFLG (Manager.MAINUPDATE T)))))))
(XCL:REINSTALL-ADVICE (QUOTE ADDTOCOMS) :AROUND (QUOTE ((:LAST (LET (!VALUE) (PROG1 (LET ((Manager.ACTIVEFLG NIL)) (SETQ !VALUE *)) (AND Manager.ACTIVEFLG (Manager.ADDADV !VALUE COMS NAME TYPE))))))))
(XCL:REINSTALL-ADVICE (QUOTE DELFROMCOMS) :AROUND (QUOTE ((:LAST (LET (!VALUE) (PROG1 (LET ((Manager.ACTIVEFLG NIL)) (SETQ !VALUE *)) (AND Manager.ACTIVEFLG (Manager.ADDADV !VALUE COMS NAME TYPE))))))))
(XCL:REINSTALL-ADVICE (QUOTE \ADDTOFILEBLOCK/ADDNEWCOM) :AROUND (QUOTE ((:LAST (PROG1 (LET ((Manager.ACTIVEFLG NIL)) *) (AND Manager.ACTIVEFLG (Manager.RESETSUBITEMS FILE TYPE)))))))
(XCL:REINSTALL-ADVICE (QUOTE LOAD) :AROUND (QUOTE ((:LAST (PROG1 (LET ((Manager.ACTIVEFLG NIL)) *) (if Manager.ACTIVEFLG then (Manager.REMOVE.DUPLICATE.ADVICE FILE) (Manager.CHECKFILE FILE)))))))
(XCL:REINSTALL-ADVICE (QUOTE LOADFNS) :AROUND (QUOTE ((:LAST (PROG1 (LET ((Manager.ACTIVEFLG NIL)) *) (if Manager.ACTIVEFLG then (Manager.REMOVE.DUPLICATE.ADVICE FILE) (Manager.CHECKFILE FILE)))))))
(XCL:REINSTALL-ADVICE (QUOTE (MARKASCHANGED :IN DEFAULT.EDITDEFA0001)) :AROUND (QUOTE ((:LAST (AND (AND (EQ NAME (QUOTE FILELST)) (EQ TYPE (QUOTE VARS))) *)))))
(READVISE ADDFILE ADDTOFILES? MAKEFILE MARKASCHANGED UNMARKASCHANGED UPDATEFILES ADDTOCOMS DELFROMCOMS \ADDTOFILEBLOCK/ADDNEWCOM LOAD LOADFNS (MARKASCHANGED :IN DEFAULT.EDITDEFA0001))
(DECLARE%: EVAL@COMPILE 
(PUTPROPS GETDATUM MACRO ((KEY) (CDR (FASSOC KEY Manager.DATASPACE))))
(PUTPROPS PUTDATUM MACRO ((KEY VALUE) (PUTASSOC KEY VALUE Manager.DATASPACE)))
(PUTPROPS Manager.TTYCOMMAND MACRO ((X . Y) (PROGN (ALLOW.BUTTON.EVENTS) X . Y)))
)

(PUTPROPS ADVICE MANAGER-DEFINITION-TYPE-COMMANDS (("ReAdvise" (QUOTE READVISE) "Enable all advice under this name") ("UnAdvise" (QUOTE UNADVISE) "Disable all advice under this name"))
)

(PUTPROPS FNS MANAGER-DEFINITION-TYPE-COMMANDS (("Break" (QUOTE BREAK) "Break this function") ("Trace" (QUOTE TRACE) "Trace this function") ("UNBreak" (QUOTE UNBREAK) "UnBreak this function") ("Compile" (QUOTE COMPILE) "Compile this function" (SUBITEMS ("Compile" (QUOTE COMPILE) "Compile this function") (DISASSEMBLE (QUOTE DISASSEMBLE) " Print the compiled code of the function"))) (" MasterScope " (QUOTE DESCRIBE) "Invoke MasterScope to DESCRIBE the function" (SUBITEMS (" Describe " (QUOTE DESCRIBE) "Invoke MasterScope to describe this function") ("Show Paths" (QUOTE SHOWPATHTO) "Invoke MasterScope to show who calls this function" (SUBITEMS ("To" (QUOTE SHOWPATHTO) "Invoke MasterScope to show who calls this function") (" From " (QUOTE SHOWPATHFROM) "Invoke MasterScope to show who is called by this function"))))) ("?=" (QUOTE ARGS) "The function's argument list"))
)

(PUTPROPS RECORDS MANAGER-DEFINITION-TYPE-COMMANDS (("Fields" (QUOTE FIELDS) "List the field names")))

(PUTPROPS VARS MANAGER-DEFINITION-TYPE-COMMANDS ((" MasterScope " (QUOTE DESCRIBE) "Who uses this?" (SUBITEMS ("Who uses?" (QUOTE DESCRIBE) "Who uses this?"))))
)

(PUTPROPS FUNCTIONS MANAGER-DEFINITION-TYPE-COMMANDS (("Break" (QUOTE BREAK) "Break this function") ("Trace" (QUOTE TRACE) "Trace this function") ("UNBreak" (QUOTE UNBREAK) "UnBreak this function") ("Compile" (QUOTE COMPILE) "Compile this function" (SUBITEMS ("Compile" (QUOTE COMPILE) "Compile this function") ("Disassemble" (QUOTE DISASSEMBLE) " Print the compiled code of the function"))) ("?=" (QUOTE ARGS) "The function's argument list"))
)

(ADDTOVAR BackgroundMenuCommands (File% Manager (MANAGER) "Starts the menu driven file manager"))
(LSUBST (QUOTE Manager) NIL BackgroundMenuCommands)
(* ; "remove old manager entry if it exists")
(SETQ BackgroundMenu NIL)
(* ; " cause the backGround menu to be rebuilt")
(MANAGER.RESET (CL:SYMBOL-VALUE (QUOTE Manager.ACTIVEFLG)))
(* ; "Shutdown any old manager windows and restart if we're already running.")
(if (STREQUAL MANAGER-ACTIVITY-WINDOW-TITLE (WINDOWPROP NIL (QUOTE TITLE))) then (* ; "If we're in the manager activity window, close it, since we dropped the pointer to it in MANAGER.RESET.") (CLOSEW NIL))

(PUTPROPS MANAGER MAKEFILE-ENVIRONMENT (:PACKAGE "INTERLISP" :READTABLE "INTERLISP"))

(PUTPROPS MANAGER FILETYPE :COMPILE-FILE)
(DECLARE%: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY COMPILERVARS 

(ADDTOVAR NLAMA )

(ADDTOVAR NLAML )

(ADDTOVAR LAMA )
)
(PUTPROPS MANAGER COPYRIGHT ("Xerox Corporation" 1986 1987 1900))
(DECLARE%: DONTCOPY
  (FILEMAP (NIL (31147 98107 (MANAGER 31157 . 31896) (MANAGER.RESET 31898 . 33493) (Manager.ADDADV 33495
 . 34673) (Manager.ADDTOFILES? 34675 . 34945) (Manager.ALTERMARKING 34947 . 36486) (Manager.DO.COMMAND
 36488 . 60000) (Manager.HIGHLIGHT 60002 . 60252) (Manager.PROMPT 60254 . 60568) (Manager.WINDOW 60570
 . 61195) (Manager.insurefilehighlights 61197 . 62144) (Manager.CHANGED? 62146 . 62706) (
Manager.CHECKFILE 62708 . 63789) (Manager.COLLECTCOMS 63791 . 65274) (Manager.COMS.WSF 65276 . 67716) 
(Manager.COMSOPEN 67718 . 72230) (Manager.COMSUPDATE 72232 . 73344) (Manager.HIGHLIGHTED 73346 . 73682
) (Manager.INSUREHIGHLIGHTS 73684 . 74248) (Manager.FILECHANGES 74250 . 74540) (
Manager.FILELSTCHANGED? 74542 . 74841) (Manager.FILESUBTYPES 74843 . 75469) (Manager.GET.ENVIRONMENT 
75471 . 78129) (Manager.GETFILE 78131 . 80432) (Manager.INTITLE? 80434 . 81096) (Manager.MAIN.WSF 
81098 . 83607) (Manager.MAINCLOSE 83609 . 84642) (Manager.MAINMENUITEMS 84644 . 85607) (
Manager.MAINOPEN 85609 . 90452) (Manager.MAINUPDATE 90454 . 91177) (Manager.MAKEFILE.ADV 91179 . 92216
) (Manager.MENUCOLUMNS 92218 . 93106) (Manager.MENUHASITEM 93108 . 93458) (Manager.MENUITEMS 93460 . 
93708) (Manager.REMOVE.DUPLICATE.ADVICE 93710 . 95133) (Manager.RESETSUBITEMS 95135 . 96442) (
Manager.SORT.COMS 96444 . 96859) (Manager.SORTBYCOLUMN 96861 . 98105)))))
STOP