(FILECREATED "22-Sep-86 17:26:16" {QV}<NOTECARDS>1.3K>NEXT>KIRKPATCH029.;1 4270 changes to: (VARS KIRKPATCH029COMS y)) (* Copyright (c) 1986 by Xerox Corporation. All rights reserved.) (PRETTYCOMPRINT KIRKPATCH029COMS) (RPAQQ KIRKPATCH029COMS ((* * fixes backlinks in NCLINKINDEXCARD) (FNS NC.AppendLinkIndexEntry))) (* * fixes backlinks in NCLINKINDEXCARD) (DEFINEQ (NC.AppendLinkIndexEntry (LAMBDA (TextStream IndexCard WinnerList LinkLabels BackLinksP) (* kirk: "22-Sep-86 17:21") (* * 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.) (* * kirk 12/9/85: Changed calls to NC.AppendLinkToText to be NCP.LocalGlobalLink. for backlinks) (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 " ") (NCP.LocalGlobalLink NC.LinkIndexBackPtrLinkLabel IndexCard DestCard (create LINKDISPLAYMODE ATTACHBITMAPFLG ← T)))) (NC.AppendStringToStream TextStream (CONCAT (CHARACTER 13))))))) ) (PUTPROPS KIRKPATCH029 COPYRIGHT ("Xerox Corporation" 1986)) (DECLARE: DONTCOPY (FILEMAP (NIL (395 4187 (NC.AppendLinkIndexEntry 405 . 4185))))) STOP