(DEFINE-FILE-INFO PACKAGE "IL" READTABLE "INTERLISP" BASE 10)
(FILECREATED "20-Jan-88 12:03:58" {QV}<NOTECARDS>1.3LNEXT>RGPATCH076.;2 5763   

      changes to%:  (VARS RGPATCH076COMS)
                    (FNS SIMPLE-FILENAME NC.CardTypeLoader NC.LoadFileFromDirectories)

      previous date%: "20-Jan-88 12:03:12" {QV}<NOTECARDS>1.3LNEXT>RGPATCH076.;1)


(* "
Copyright (c) 1988 by Xerox Corporation.  All rights reserved.
")

(PRETTYCOMPRINT RGPATCH076COMS)

(RPAQQ RGPATCH076COMS ((FNS SIMPLE-FILENAME SIMPLE-LOADEDFILELST NC.CardTypeLoader 
                            NC.LoadFileFromDirectories)))
(DEFINEQ

(SIMPLE-FILENAME
  [LAMBDA (file)                                      (* ; "Edited 20-Jan-88 11:22 by Randy.Gobbel")

    (LET [(ext (FILENAMEFIELD file 'EXTENSION]
         (PACKFILENAME 'NAME (FILENAMEFIELD file 'NAME)
                'EXTENSION
                (if (NOT (FMEMB ext *COMPILED-EXTENSIONS*))
                    then ext])

(SIMPLE-LOADEDFILELST
  [LAMBDA NIL                                         (* ; "Edited 20-Jan-88 11:23 by Randy.Gobbel")

    (for file in LOADEDFILELST collect (SIMPLE-FILENAME file])

(NC.CardTypeLoader
  [LAMBDA (TypeName FileSuggestion QuietFlg)          (* ; "Edited 20-Jan-88 11:33 by Randy.Gobbel")

(* ;;; "Load card type TypeName using FileSuggestion as the first place to look.  Otherwise look in the directories specified by NoteCardsDirectories.")

(* ;;; "fgh 2/3/86 First written.")

(* ;;; "kirk 1Jul86 Added new process.")

(* ;;; "kirk 15Jul86 Removed new process and added FGH's RESETLST to close stream.")

(* ;;; "fgh 7/16/86 Added PRINTOUT to inform user before find file begins.")

(* ;;; "kirk 8/7/86 Added QuietFlg.  Will not stop LOAD messages though.")

(* ;;; "kirk 19/8/86 Added set QuietFlg T in OPENWP check")

(* ;;; "fgh 8/26/86 Changed LOAD?  to a LOAD.  If we are at this point there must bve some reason we need to reload the file even if its alreadt been loaded.")

(* ;;; "rht&rg&pmi 10/21/86: Changed LOAD to FILESLOAD.")

(* ;;; "rht 4/17/87: Now smashes PAGEFULLFN of tty window so that it'll scroll automatically.")

(* ;;; "rg 1/20/88 rewritten to call NC.LoadFileFromDirectories, eliminating lots of identical code")

    (NC.LoadFileFromDirectories FileSuggestion NIL QuietFlg TypeName])

(NC.LoadFileFromDirectories
  [LAMBDA (FileName Directories QuietFlg TypeName)    (* ; "Edited 20-Jan-88 11:33 by Randy.Gobbel")
          
          (* ;; "Try to load FileName from Directories.  The latter can be a list in which case the elements should be directory paths.  It can be an atom in which case it should be a DIRECTORIES var.  Or it can be NIL in which case it defaults to the litatom NOTECARDSDIRECTORIES.")
          
          (* ;; "fgh 6/3/86 Now closes tty window after ts done.")
          
          (* ;; "rht 10/31/86: Changed 'DIRECTORIES' to 'Directories'")
          
          (* ;; "rht 4/17/87: Now smashes PAGEFULLFN of tty window so that it'll scroll automatically.  Also prints a message to the tty window.")
          
          (* ;; "rg 7/9/87 now uses NC.FindFile")
          
          (* ;; "rg 7/21/87 now looks at QuietFlg before doing PRINTOUT.  Note: there may still be some instances where files will not be loaded, even though a message is printed, but it's too difficult to predict for all cases whether LOAD?  will actually do a LOAD.  Membership in LOADEDFILELST is used as a 99 correct hint")
          
          (* ;; "rg 9/4/87 now pushes file name onto NC.LoadedFiles for use by NC.PostGreet")
          
          (* ;; "rg 1/15/88 now checks rootified version of LOADEDFILELST, won't load any file that it finds there.  Net effect is that this fn will NEVER load a file that has been loaded in ANY version previously.  No longer calls NC.FixFileDates.")

    (DECLARE (GLOBALVARS NC.LoadedFiles))
    (RESETLST [RESETSAVE NIL (if (OPENWP (WFROMDS (TTYDISPLAYSTREAM)
                                                T))
                                 then (SETQ QuietFlg T)
                                      '(NILL)
                               else `(CLOSEW ,(WFROMDS (TTYDISPLAYSTREAM]
           [RESETSAVE NIL (if QuietFlg
                              then '(NILL)
                            else `(WINDOWPROP ,(WFROMDS (TTYDISPLAYSTREAM)) 'PAGEFULLFN
                                         ,(WINDOWPROP (WFROMDS (TTYDISPLAYSTREAM))
                                                 'PAGEFULLFN
                                                 'NILL]
           (LET [(Window (WFROMDS (TTYDISPLAYSTREAM)))
                 (FullName (NC.FindFile FileName TypeName TypeName NIL (OR (GETPROP FileName
                                                                                  'Directories)
                                                                           Directories]
                (if [AND FullName (NOT (FMEMB (SIMPLE-FILENAME FileName)
                                              (SIMPLE-LOADEDFILELST]
                    then (if (NOT QuietFlg)
                             then (CLEARW Window)
                                  (FLASHWINDOW Window)
                                  (if TypeName
                                      then (PRINTOUT Window "Card type " TypeName " not loaded." T))
                                  (PRINTOUT Window "Attempting to autoload " FileName T))
                         (APPLY* (FUNCTION FILESLOAD)
                                '(SYSLOAD) FullName)
                         (pushnew NC.LoadedFiles (FILENAMEFIELD FileName 'NAME])
)
(PUTPROPS RGPATCH076 COPYRIGHT ("Xerox Corporation" 1988))
(DECLARE%: DONTCOPY
  (FILEMAP (NIL (617 5681 (SIMPLE-FILENAME 627 . 978) (SIMPLE-LOADEDFILELST 980 . 1186) (
NC.CardTypeLoader 1188 . 2341) (NC.LoadFileFromDirectories 2343 . 5679)))))
STOP