(FILECREATED " 5-May-87 14:20:23" {QV}<NOTECARDS>1.3K>NEXT>KIRKPATCH036.;1 3486   

      changes to:  (VARS KIRKPATCH036COMS x)
		   (FNS NC.AskTraversalSpecs))


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

(PRETTYCOMPRINT KIRKPATCH036COMS)

(RPAQQ KIRKPATCH036COMS ((* * Fixes 561: cursor display bug that shows up in lyric.)
			   (* * REPLACES fn in NCDATABASE)
			   (FNS NC.AskTraversalSpecs)))
(* * Fixes 561: cursor display bug that shows up in lyric.)

(* * REPLACES fn in NCDATABASE)

(DEFINEQ

(NC.AskTraversalSpecs
  (LAMBDA (NoteFile OldLinkLabels OldDepth Don'tAskFlg InterestedWindow)
                                                             (* kirk: " 5-May-87 14:15")

          (* * Get a traversal specification from the user.)



          (* * kirk 7/29/86 changed to allow backlinks and position specs above source card)



          (* * rht 8/29/86: Fixed bug that was causing Depth spec to be ignored.)



          (* * rht 3/9/87: Now accepts InterestedWindow argument. Now takes NoteFile rather than SourceCard arg.)



          (* * rht 3/25/87: Now calls NC.CoerceToInterestedWindow.)



          (* * kirk 5/5/87: Removed failed attempt at putting up hourglass)


    (DECLARE (GLOBALVARS NC.TraversalSpecsStylesheet))
    (OR (OPENWP InterestedWindow)
	  (SETQ InterestedWindow (NC.CoerceToInterestedWindow NoteFile)))
    (PROG ((LinkLabels (NC.RetrieveLinkLabels NoteFile T))
	     Choices Position)
	    (OR OldLinkLabels (SETQ OldLinkLabels LinkLabels))
	    (if Don'tAskFlg
		then (RETURN (LIST OldLinkLabels OldDepth)))
	    (SETQ Position (AND (WINDOWP InterestedWindow)
				    (create POSITION
					    XCOORD ← (fetch (REGION LEFT) of (WINDOWPROP
									       InterestedWindow
									       (QUOTE REGION)))
					    YCOORD ← (fetch (REGION TOP) of (WINDOWREGION 
										 InterestedWindow)))))
	    (OR OldDepth (SETQ OldDepth 99999))          (* The stylesheet is in a global var.
							     We only need to provide its position, items, and 
							     selections.)
	    (STYLE.PROP NC.TraversalSpecsStylesheet (QUOTE POSITION)
			  Position)
	    (STYLE.PROP NC.TraversalSpecsStylesheet (QUOTE ITEMS)
			  (LIST (create MENU
					  ITEMS ← LinkLabels)
				  (create MENU
					  ITEMS ← (for Link in LinkLabels collect
									   (PACK* (QUOTE ←)
										    Link)))
				  (create MENU
					  ITEMS ←
					  (QUOTE (0 1 2 3 4 5 6 7 8 9 INF)))))
	    (STYLE.PROP NC.TraversalSpecsStylesheet (QUOTE SELECTIONS)
			  (LIST (for Label in OldLinkLabels when (NEQ (NTHCHAR Label 1)
									  (QUOTE ←))
				     collect Label)
				  (for Label in OldLinkLabels when (EQ (NTHCHAR Label 1)
									 (QUOTE ←))
				     collect Label)
				  (if (OR (NOT (FIXP OldDepth))
					    (IGREATERP OldDepth 9)
					    (ILESSP OldDepth 0))
				      then (QUOTE INF)
				    else OldDepth)))
	    (SETQ Choices (STYLESHEET NC.TraversalSpecsStylesheet))
	    (RETURN (COND
			(Choices (create TRAVERSALSPECS
					 LinkTypes ← (APPEND (CAR Choices)
							       (CADR Choices))
					 Depth ← (OR (FIXP (CADDR Choices))
						       MAX.FIXP)))
			(T NIL))))))
)
(PUTPROPS KIRKPATCH036 COPYRIGHT ("Xerox Corporation" 1987))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (538 3403 (NC.AskTraversalSpecs 548 . 3401)))))
STOP