(FILECREATED "19-Feb-87 17:57:06" {QV}<NOTECARDS>1.3K>NEXT>RGPATCH014.;4 5276   

      changes to:  (VARS RGPATCH014COMS)
		   (FNS NC.HookToOrphanCard NC.MakeFilingLinks)

      previous date: "19-Feb-87 16:52:46" {QV}<NOTECARDS>1.3K>NEXT>RGPATCH014.;1)


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

(PRETTYCOMPRINT RGPATCH014COMS)

(RPAQQ RGPATCH014COMS ((* * RG 2/19/87 Fixed yet another place that needed to return a value, but 
			    didn't)
			 (* * Changes to NCLINKS)
			 (FNS NC.HookToOrphanCard NC.MakeFilingLinks)))
(* * RG 2/19/87 Fixed yet another place that needed to return a value, but didn't)

(* * Changes to NCLINKS)

(DEFINEQ

(NC.HookToOrphanCard
  [LAMBDA (Card OrphansCard)                                 (* Randy.Gobbel "19-Feb-87 16:57")
                                                             (* The last reference to the card has just been 
							     deleted. Hook this card to the orphan card so it 
							     doesn't get lost forever)

          (* * kirk: 14Nov85: deleted use of DatabaseStream and changed EQs to NC.Same*Ps)



          (* * kef 7/29/86: Took out the calls to NC.PutMainCardData, NC.PutLinks, and NC.DeactivateCard after 
	  NC.MakeFilingLink. The reason is that this is done within NC.InsertLinkBeforeMarker or NC.InsertLinkInOrdering, 
	  which are called by NC.MakeFilingLink. Therefore, don't do this twice.)



          (* * rg 2/19/87 Return parent as value)


    (DECLARE (GLOBALVARS NC.FiledCardLinkLabel NC.SubBoxLinkLabel))
    (LET ((NoteFile (fetch (Card NoteFile) of Card)))
         (OR OrphansCard (SETQ OrphansCard (fetch (NoteFile OrphansCard) of NoteFile)))
         (COND
	   ((NC.ActiveCardP OrphansCard)
	     (COND
	       ((NC.MakeFilingLink OrphansCard Card (if (NC.FileBoxP Card T)
							  then NC.SubBoxLinkLabel
							else NC.FiledCardLinkLabel))
		 OrphansCard)))
	   (T (WITH.MONITOR (NC.FetchMonitor NoteFile)
			    (NC.GetNoteCard OrphansCard)   (* These no longer needed expressions used to go after
							     the NC.MakeFilingLink below: 
							     (NC.PutMainCardData OrphansCard) 
							     (NC.PutLinks OrphansCard) (NC.DeactivateCard 
							     OrphansCard))
			    (COND
			      ((NC.MakeFilingLink OrphansCard Card (if (NC.FileBoxP Card T)
									 then NC.SubBoxLinkLabel
								       else NC.FiledCardLinkLabel))
				OrphansCard])

(NC.MakeFilingLinks
  [LAMBDA (Card Msg)                                         (* Randy.Gobbel "19-Feb-87 16:55")
                                                             (* Hooks card specified by Card to all of the current 
							     contents cards by a Contents link)

          (* * rht 8/1/84: Changed the NC.PrintMsg2 call for "No FileBox has been specified." to use NIL as second arg rather
	  than T. This prevents erasure of previous error messages.)



          (* * rht 12/8/84: Massive rewrite. Now calls NC.MakeChildLink. And always orphanizes if no parent specified.
	  This is because it's currently called only by NC.InsureProperFiling.)



          (* * rht 6/25/85: Now returns NewParents and checks if CANCELLED comes back from NC.SelectNoteCards so can abort 
	  the calling operation.)



          (* * Fgh 11/15/85 Adapted from and intended to replace NC.MakeContentsHooks)



          (* * fgh 8/6/86 Updated to use NC.AttachPromptWindow and added Msg arg)



          (* * pmi 12/5/86: Modified message to NC.SelectNoteCards to mention SHIFT-selection.)



          (* * pmi 12/12/86: Removed obsolete ReturnLinksFlg argument in call to NC.SelectNoteCards.)



          (* * rg 2/19/87 Make sure NewParents always has the real value)


    (DECLARE (GLOBALVARS NC.SelectingContentsMenu))
    (PROG (OneHook (Window (NC.FetchWindow Card))
		     NewParents)
	    (SETQ NewParents (NC.SelectNoteCards NIL (FUNCTION NC.FileBoxP)
						     NC.SelectingContentsMenu Card
						     (CONCAT (OR Msg "")
							       
					    "Please shift-select the Boxes to file this card in."
							       (CHARACTER 13)
							       
				       "'Done' with no selections files it in the ToBeFiled box.")
						     T))
	    [COND
	      ([NOT (OR (EQ NewParents (QUOTE CANCELLED))
			    (AND NewParents (for ParentCard in NewParents bind OneHook
						 when (NC.MakeChildLink Card ParentCard Window)
						 do (SETQ OneHook T) finally (RETURN OneHook]
		(NC.PrintMsg Window NIL "No FileBox has been specified." (CHARACTER 13)
			       "This card will be filed in the ToBeFiled Box."
			       (CHARACTER 13))
		[SETQ NewParents (NC.HookToOrphanCard Card (fetch (NoteFile ToBeFiledCard)
								  of (fetch (Card NoteFile)
									  of Card]
		(COND
		  ((NC.AttachPromptWindow Window NIL NIL NIL T)
		    (SPAWN.MOUSE)
		    (DISMISS 2000)
		    (NC.ClearMsg Window T]
	    (RETURN NewParents])
)
(PUTPROPS RGPATCH014 COPYRIGHT ("Xerox Corporation" 1987))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (682 5195 (NC.HookToOrphanCard 692 . 2548) (NC.MakeFilingLinks 2550 . 5193)))))
STOP