(FILECREATED " 4-Dec-86 16:25:33" {QV}<NOTECARDS>1.3K>NEXT>PMIPATCH007.;1 8165   

      changes to:  (VARS PMIPATCH007COMS))


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

(PRETTYCOMPRINT PMIPATCH007COMS)

(RPAQQ PMIPATCH007COMS ((* * Fixes bug # 146: NoteFile Delete should delete NoteFile name from menu 
			     of known files.)
			  (* * Fixes bug # 288: Delete NoteFile should close the NoteFile's menu 
			     window.)
			  (* * Change to NCDATABASE)
			  (FNS NC.NoteFileFromFileName)
			  (* * Also fixes unreported problem with selecting Delete NoteFile, and then 
			     choosing "Other NoteFile" for the NoteFile to delete. It was breaking 
			     because the wrong args were being passed to NC.ListOfNoteFilesMenu for 
			     Delete and Rename operations.)
			  (* * Change to NCINTERFACE)
			  (FNS NC.DoNoteFileOp)))
(* * Fixes bug # 146: NoteFile Delete should delete NoteFile name from menu of known files.)

(* * Fixes bug # 288: Delete NoteFile should close the NoteFile's menu window.)

(* * Change to NCDATABASE)

(DEFINEQ

(NC.NoteFileFromFileName
  (LAMBDA (FileName)                                         (* pmi: " 4-Dec-86 15:17")

          (* * Return the notefile object for the given file name or NIL if none. Done by checking notefiles hash array.)



          (* * rht 5/6/86: Now doesn't just return the first notefile object having the desired name.
	  Tries to return one that's open if there are any.)



          (* * pmi 12/4/86: Probably not the best fix, but changed FullFileName to be (OR (FULLNAME FileName) FileName), 
	  since by the time we get here when deleting a file, the file is already gone and FULLNAME returns NIL)


    (LET* ((FullFileName (OR (FULLNAME FileName)
			       FileName))
	   (NoteFiles (for NoteFile in (NC.ListOfNoteFiles) when (EQ FullFileName
									       (fetch (NoteFile
											  
										     FullFileName)
										  of NoteFile))
			 collect NoteFile)))
          (OR (for NoteFile in NoteFiles when (LET ((Stream (fetch (NoteFile Stream)
								       of NoteFile)))
						           (AND (STREAMP Stream)
								  (OPENP Stream)))
		   do (RETURN NoteFile))
		(CAR NoteFiles)))))
)
(* * Also fixes unreported problem with selecting Delete NoteFile, and then choosing 
"Other NoteFile" for the NoteFile to delete. It was breaking because the wrong args were being 
passed to NC.ListOfNoteFilesMenu for Delete and Rename operations.)

(* * Change to NCINTERFACE)

(DEFINEQ

(NC.DoNoteFileOp
  (LAMBDA (Op)                                               (* pmi: " 4-Dec-86 14:22")

          (* * Do a NoteFile op chosen from NC icon menu)



          (* * rht 7/2/86: Now calls NC.AbortSession with NC.NoteCardsIconWindow arg.)



          (* * rht 7/5/86: Added Read-only% Open entry.)



          (* * rht 7/17/86: Now calls NC.InspectAndRepairNoteFile instead of NC.ScavengerPhase1.)



          (* * pmi 12/4/86: Added NC.NoteCardsIconWindow argument to calls to NC.ListOfNoteFilesMenu for "Delete" and 
"Rename" operations)


    (SELECTQ Op
	       (Open% NoteFile (LET ((NoteFile (NC.ListOfNoteFilesMenu T NIL NC.NoteCardsIconWindow
									 (QUOTE Open% NoteFile))))
				    (if (NULL NoteFile)
					then NIL
				      else (if (EQ NoteFile (QUOTE NEW))
						 then (SETQ NoteFile NIL))
					     (NC.OpenDatabaseFile NoteFile NIL NIL NIL NIL NIL NIL 
								    NIL NIL NIL 
								    NC.NoteCardsIconWindow))))
	       (Read-only% Open (LET ((NoteFile (NC.ListOfNoteFilesMenu T NIL 
									  NC.NoteCardsIconWindow
									  (QUOTE Open% NoteFile))))
				     (if (NULL NoteFile)
					 then NIL
				       else (if (EQ NoteFile (QUOTE NEW))
						  then (SETQ NoteFile NIL))
					      (NC.OpenDatabaseFile NoteFile (QUOTE INPUT)
								     NIL NIL NIL NIL NIL NIL NIL NIL 
								     NC.NoteCardsIconWindow))))
	       (Checkpoint% NoteFile (LET ((NoteFile (NC.ListOfNoteFilesMenu NIL T 
									   NC.NoteCardsIconWindow
									       (QUOTE 
									     Checkpoint% NoteFile))))
				          (if NoteFile
					      then (NC.CheckpointDatabase NoteFile NIL NIL NIL 
									      NIL 
									   NC.NoteCardsIconWindow))))
	       (Close% NoteFile (LET ((NoteFile (NC.ListOfNoteFilesMenu NIL T 
									  NC.NoteCardsIconWindow
									  (QUOTE Close% NoteFile))))
				     (if NoteFile
					 then (NC.CloseDatabaseFile NoteFile 
									NC.NoteCardsIconWindow))))
	       (Abort% NoteFile (LET ((NoteFile (NC.ListOfNoteFilesMenu NIL T 
									  NC.NoteCardsIconWindow
									  (QUOTE Abort% NoteFile))))
				     (if NoteFile
					 then (NC.AbortSession NoteFile NC.NoteCardsIconWindow))))
	       (Compact% NoteFile (LET ((NoteFile (NC.ListOfNoteFilesMenu T NIL 
									   NC.NoteCardsIconWindow
									    (QUOTE 
										Compact% NoteFile))))
				       (if (NULL NoteFile)
					   then NIL
					 else (if (EQ NoteFile (QUOTE NEW))
						    then (SETQ NoteFile NIL))
						(NC.CompactNoteFile NoteFile NIL NIL 
								      NC.NoteCardsIconWindow))))
	       (Compact% In% Place (LET ((NoteFile (NC.ListOfNoteFilesMenu T NIL 
									   NC.NoteCardsIconWindow
									     (QUOTE 
										Compact% NoteFile))))
				        (if (NULL NoteFile)
					    then NIL
					  else (if (EQ NoteFile (QUOTE NEW))
						     then (SETQ NoteFile NIL))
						 (NC.CompactNoteFile NoteFile NIL T 
								       NC.NoteCardsIconWindow))))
	       (Inspect&Repair% NoteFile (LET ((NoteFile (NC.ListOfNoteFilesMenu T NIL 
									   NC.NoteCardsIconWindow
										   (QUOTE 
									 Inspect&Repair% NoteFile))))
					      (if (NULL NoteFile)
						  then NIL
						else (if (EQ NoteFile (QUOTE NEW))
							   then (SETQ NoteFile NIL))
						       (NC.InspectAndRepairNoteFile NoteFile NIL 
									   NC.NoteCardsIconWindow))))
	       (Read% Substances (LET ((NoteFile (NC.ListOfNoteFilesMenu T NIL 
									   NC.NoteCardsIconWindow
									   (QUOTE 
									 Inspect&Repair% NoteFile))))
				      (if (NULL NoteFile)
					  then NIL
					else (if (EQ NoteFile (QUOTE NEW))
						   then (SETQ NoteFile NIL))
					       (NC.InspectAndRepairNoteFile NoteFile T 
									   NC.NoteCardsIconWindow))))
	       (Copy% NoteFile (LET ((NoteFile (NC.ListOfNoteFilesMenu T (QUOTE CLOSED)
									 NC.NoteCardsIconWindow
									 (QUOTE Copy% NoteFile))))
				    (if (NULL NoteFile)
					then NIL
				      else (if (EQ NoteFile (QUOTE NEW))
						 then (SETQ NoteFile NIL))
					     (NC.CopyNoteFile NoteFile NIL NC.NoteCardsIconWindow)))
			       )
	       (Rename% NoteFile (LET ((NoteFile (NC.ListOfNoteFilesMenu T (QUOTE CLOSED)
									   NC.NoteCardsIconWindow
									   (QUOTE Rename% NoteFile))
						 ))
				      (if (NULL NoteFile)
					  then NIL
					else (if (EQ NoteFile (QUOTE NEW))
						   then (SETQ NoteFile NIL))
					       (NC.RenameNoteFile NoteFile NIL 
								    NC.NoteCardsIconWindow))))
	       (Delete% NoteFile (LET ((NoteFile (NC.ListOfNoteFilesMenu T (QUOTE CLOSED)
									   NC.NoteCardsIconWindow
									   (QUOTE Delete% NoteFile))
						 ))
				      (if (NULL NoteFile)
					  then NIL
					else (if (EQ NoteFile (QUOTE NEW))
						   then (SETQ NoteFile NIL))
					       (NC.DeleteDatabaseFile NoteFile 
									NC.NoteCardsIconWindow))))
	       (Create% NoteFile (NC.CreateDatabaseFile NIL NIL NIL NIL NIL NIL 
							  NC.NoteCardsIconWindow))
	       NIL)))
)
(PUTPROPS PMIPATCH007 COPYRIGHT ("Xerox Corporation" 1986))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (1086 2342 (NC.NoteFileFromFileName 1096 . 2340)) (2633 8083 (NC.DoNoteFileOp 2643 . 
8081)))))
STOP