(FILECREATED " 9-Dec-85 16:15:44" {QV}<NOTECARDS>1.3K>RHTPATCH015.;1 7285 changes to: (VARS RHTPATCH015COMS)) (* Copyright (c) 1985 by Xerox Corporation. All rights reserved.) (PRETTYCOMPRINT RHTPATCH015COMS) (RPAQQ RHTPATCH015COMS ((* * Function redefined from NCLINKINDEXCARD) (FNS NC.AppendLinkIndexEntry) (* * Function redefined from NCPROGINT) (FNS NCP.GetLinkTypes) (* * Function redefined from NCLINKS) (FNS NC.CachedDelFromLink))) (* * Function redefined from NCLINKINDEXCARD) (DEFINEQ (NC.AppendLinkIndexEntry (LAMBDA (TextStream IndexCard WinnerList LinkLabels BackLinksP) (* rht: " 9-Dec-85 15:42") (* * Build a link index entry consisting of all instances of links from or to ID with a label in LinkLabels. Append these to the end of Stream.) (* * fgh 11/17/85 Updated to handle Card objects. Also changed how information is passed down from calling functions. All info about relevant cards is now passed in the WinnerList arg.) (* * rht 12/9/85: Changed calls to NC.AppendLinkToText to be NCP.LocalGlobalLink.) (LET ((Title (CAR WinnerList)) (Card (CADR WinnerList)) (ToLinks (CAR (CADDR WinnerList))) (FromLinks (CADR (CADDR WinnerList))) (SortArg (FUNCTION NC.LinkIndexCompareFn)) FromLinkPairs ToLinkPairs) (* * Find all winning links.) (SETQ ToLinkPairs (SORT (for Link in ToLinks bind Label when (SETQ Label (NC.LinkLabelP Link LinkLabels) ) collect (CONS Label Link)) SortArg)) (SETQ FromLinkPairs (SORT (for Link in FromLinks bind Label when (SETQ Label (NC.ReverseLinkLabelP Link LinkLabels)) collect (CONS Label Link)) SortArg)) (* * Print the title of ID if there were any wins.) (COND ((OR ToLinkPairs FromLinkPairs) (NC.AppendStringToStream TextStream Title) (COND (BackLinksP (NC.AppendStringToStream TextStream " ") (NCP.LocalGlobalLink NC.LinkIndexBackPtrLinkLabel IndexCard Card NIL (QUOTE Icon)))) (NC.AppendStringToStream TextStream (CONCAT (CHARACTER 13))))) (* * Print the winning links from the ID card.) (for LinkPair in ToLinkPairs bind OldLabel Label DestCard do (SETQ Label (CAR LinkPair)) (SETQ DestCard (fetch (Link DestinationCard) of (CDR LinkPair))) (COND ((NEQ OldLabel Label) (NC.AppendStringToStream TextStream (CONCAT " <" Label "> TO" (CHARACTER 13))) (SETQ OldLabel Label))) (NC.AppendStringToStream TextStream " ") (NC.AppendStringToStream TextStream (NC.RetrieveTitle DestCard)) (COND (BackLinksP (NC.AppendStringToStream TextStream " ") (NCP.LocalGlobalLink NC.LinkIndexBackPtrLinkLabel IndexCard DestCard NIL (create LINKDISPLAYMODE ATTACHBITMAPFLG ← T)))) (NC.AppendStringToStream TextStream (CONCAT (CHARACTER 13)))) (for LinkPair in FromLinkPairs bind OldLabel Label DestCard do (SETQ Label (CAR LinkPair)) (SETQ DestCard (fetch (Link SourceCard) of (CDR LinkPair))) (COND ((NEQ OldLabel Label) (NC.AppendStringToStream TextStream (CONCAT " <" Label "> FROM" (CHARACTER 13))) (SETQ OldLabel Label))) (NC.AppendStringToStream TextStream " ") (NC.AppendStringToStream TextStream (NC.RetrieveTitle DestCard)) (COND (BackLinksP (NC.AppendStringToStream TextStream " ") (NC.AppendLinkToText IndexCard DestCard NC.LinkIndexBackPtrLinkLabel (create LINKDISPLAYMODE ATTACHBITMAPFLG ← T)))) (NC.AppendStringToStream TextStream (CONCAT (CHARACTER 13))))))) ) (* * Function redefined from NCPROGINT) (DEFINEQ (NCP.GetLinkTypes (LAMBDA (NoteFile) (* rht: " 9-Dec-85 15:37") (* * Return all link labels including system ones.) (* * rht 11/17/85: Updated to handle new card and notefile objects.) (NC.RetrieveLinkLabels NoteFile T))) ) (* * Function redefined from NCLINKS) (DEFINEQ (NC.CachedDelFromLink (LAMBDA (Link DestinationCard NoOrphanHookFlg) (* rht: " 9-Dec-85 15:52") (* * Delete a FromLink from its destination card Hook card to orphan if this is the last link.) (* * rht 11/15/84: Changed decision as to when to orphanize a card. Now must have deleted its last link (not just last subbox or filedcard link). Also checks that link doesn't point from card to itself.) (* * rht 12/1/84: Now doesn't do any work unless DestinationCard is valid, i.e. not DELETED or FREE.) (* * kirk: 13Nov85: copied out of NC.DelFromLink and changed to use NoteFile instead of DatabaseStream) (* * kirk 14Nov85: deleted use of LinkID) (* * rht 12/9/85: Changed Global var NC.TopLevelCards to call on the NC.FetchTopLevelCards fn.) (NC.SetFromLinks DestinationCard (DREMOVE (for OldLink in (NC.FetchFromLinks DestinationCard) thereis (AND (NC.SameLinkP Link OldLink) OldLink)) (NC.FetchFromLinks DestinationCard))) (NC.SetLinksDirtyFlg DestinationCard T) (AND (NULL NoOrphanHookFlg) (NOT (FMEMB DestinationCard (NC.FetchTopLevelCards (fetch (Card NoteFile) of DestinationCard)))) (NOT (NC.SameCardP (fetch (Link SourceCard) of Link) DestinationCard)) (NULL (NC.FetchNewCardFlg DestinationCard)) (NOT (NC.SameCardP (fetch (Link SourceCard) of Link) NC.OrphanID)) (COND ((OR (NULL (NC.FetchFromLinks DestinationCard)) (for Link in (NC.FetchFromLinks DestinationCard) always (NC.SameCardP (fetch (Link SourceCard) of Link) DestinationCard))) (NC.PrintMsg NIL T "You have just removed the last link to " (NC.RetrieveTitle DestinationCard) "." (CHARACTER 13) "It is being filed in the Orphan FileBox.") (NC.HookToOrphanCard DestinationCard)) ((for Link in (NC.FetchFromLinks DestinationCard) never (FMEMB (fetch (Link Label) of Link) (QUOTE (SubBox FiledCard)))) (NC.PrintMsg NIL T "You have just unfiled " (NC.RetrieveTitle DestinationCard) " from its last filebox." (CHARACTER 13) "It is being filed in the Orphan FileBox.") (NC.HookToOrphanCard DestinationCard)))) Link)) ) (PUTPROPS RHTPATCH015 COPYRIGHT ("Xerox Corporation" 1985)) (DECLARE: DONTCOPY (FILEMAP (NIL (541 4208 (NC.AppendLinkIndexEntry 551 . 4206)) (4255 4580 (NCP.GetLinkTypes 4265 . 4578 )) (4625 7203 (NC.CachedDelFromLink 4635 . 7201))))) STOP