(FILECREATED "20-Feb-87 22:46:48" {QV}<NOTECARDS>1.3K>NEXT>KIRKPATCH035.;9 7742   

      changes to:  (FNS NC.NewTextCardRegion NC.CreateLinkedTextNote NC.CreateLinkedTextInclusion 
			NC.CreateLinkedNewTextCard)

      previous date: "20-Feb-87 10:18:23" {QV}<NOTECARDS>1.3K>NEXT>KIRKPATCH035.;7)


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

(PRETTYCOMPRINT KIRKPATCH035COMS)

(RPAQQ KIRKPATCH035COMS ((* ;; 
"adds a new feature to NCTEXTCARD allowing user defineable special keys to create a new text card and a link to it with one of two user defineable link types and initial titles. It also allows assigning a special key to close a card. The initial settings are META asterisk key (META-SHIFT-8) creates a See link. META open paren (META SHIFT 9) creates an include link. META close paren (META SHIFT 0) closes a card.  NCP.NewTextCardRegion is available to be modified by the user to taste."
			      )
			   (* ;; "All of the following are new to NCTEXTCARD")
			   (* ;; "Text Note creation, link, and title accelerator")
			   (GLOBALVARS NC.CreateLinkedTextNoteChar NC.CreateLinkedTextNoteLinkType 
				       NC.CreateLinkedTextNoteTitle)
			   (INITVARS (NC.CreateLinkedTextNoteChar 298)
				     (NC.CreateLinkedTextNoteLinkType (QUOTE See))
				     (NC.CreateLinkedTextNoteTitle "*"))
			   (FNS NC.CreateLinkedTextNote)
			   (* ;; "Included text creation, link, and title accelerator")
			   (GLOBALVARS NC.CreateLinkedTextInclusionChar 
				       NC.CreateLinkedTextInclusionLinkType 
				       NC.CreateLinkedTextInclusionTitle)
			   (INITVARS (NC.CreateLinkedTextInclusionChar 296)
				     (NC.CreateLinkedTextInclusionLinkType (QUOTE Include))
				     (NC.CreateLinkedTextInclusionTitle ""))
			   (FNS NC.CreateLinkedTextInclusion)
			   (* ;; "close card  accelerator")
			   (GLOBALVARS NC.CloseTextCardChar)
			   (INITVARS (NC.CloseTextCardChar 297))
			   (FNS NC.CloseTextCard)
			   (* ;; "used by Text Note and text inclusion")
			   (FNS NC.CreateLinkedNewTextCard NCP.NewTextCardRegion NC.NewTextCardRegion)
			   (* ;; "setup TEDIT keys")
			   (P (TEDIT.SETFUNCTION NC.CreateLinkedTextNoteChar (QUOTE 
									  NC.CreateLinkedTextNote))
			      (TEDIT.SETFUNCTION NC.CreateLinkedTextInclusionChar (QUOTE 
								     NC.CreateLinkedTextInclusion))
			      (TEDIT.SETFUNCTION NC.CloseTextCardChar (QUOTE NC.CloseTextCard)))))



(* ;; 
"adds a new feature to NCTEXTCARD allowing user defineable special keys to create a new text card and a link to it with one of two user defineable link types and initial titles. It also allows assigning a special key to close a card. The initial settings are META asterisk key (META-SHIFT-8) creates a See link. META open paren (META SHIFT 9) creates an include link. META close paren (META SHIFT 0) closes a card.  NCP.NewTextCardRegion is available to be modified by the user to taste."
)




(* ;; "All of the following are new to NCTEXTCARD")




(* ;; "Text Note creation, link, and title accelerator")

(DECLARE: DOEVAL@COMPILE DONTCOPY

(GLOBALVARS NC.CreateLinkedTextNoteChar NC.CreateLinkedTextNoteLinkType NC.CreateLinkedTextNoteTitle)
)

(RPAQ? NC.CreateLinkedTextNoteChar 298)

(RPAQ? NC.CreateLinkedTextNoteLinkType (QUOTE See))

(RPAQ? NC.CreateLinkedTextNoteTitle "*")
(DEFINEQ

(NC.CreateLinkedTextNote
  (LAMBDA (text.stream textobj)                              (* kirk: "20-Feb-87 22:13")
    (ADD.PROCESS (LIST (FUNCTION NC.CreateLinkedNewTextCard)
			   text.stream textobj (KWOTE NC.CreateLinkedTextNoteLinkType)))))
)



(* ;; "Included text creation, link, and title accelerator")

(DECLARE: DOEVAL@COMPILE DONTCOPY

(GLOBALVARS NC.CreateLinkedTextInclusionChar NC.CreateLinkedTextInclusionLinkType 
	    NC.CreateLinkedTextInclusionTitle)
)

(RPAQ? NC.CreateLinkedTextInclusionChar 296)

(RPAQ? NC.CreateLinkedTextInclusionLinkType (QUOTE Include))

(RPAQ? NC.CreateLinkedTextInclusionTitle "")
(DEFINEQ

(NC.CreateLinkedTextInclusion
  (LAMBDA (text.stream textobj)                              (* kirk: "20-Feb-87 22:12")
    (ADD.PROCESS (LIST (FUNCTION NC.CreateLinkedNewTextCard)
			   text.stream textobj (KWOTE NC.CreateLinkedTextInclusionLinkType)))))
)



(* ;; "close card  accelerator")

(DECLARE: DOEVAL@COMPILE DONTCOPY

(GLOBALVARS NC.CloseTextCardChar)
)

(RPAQ? NC.CloseTextCardChar 297)
(DEFINEQ

(NC.CloseTextCard
  (LAMBDA (nothing textobj)                                  (* kirk: "17-Feb-87 22:32")
                                                             (* ;; "for use in TEDIT.SETFUNCTION call")
    (NCP.CloseCards (NC.CardFromWindow (CAR (fetch (TEXTOBJ \WINDOW) of TEXTOBJ)))
		      T)))
)



(* ;; "used by Text Note and text inclusion")

(DEFINEQ

(NC.CreateLinkedNewTextCard
  (LAMBDA (TEXT.STREAM TEXTOBJ LINKTYPE)                     (* kirk: "20-Feb-87 22:10")
    (LET ((LINKING.CARD (NC.CardFromWindow (CAR (fetch (TEXTOBJ \WINDOW) of TEXTOBJ))))
	  NEW.CARD TITLE)
         (SETQ TITLE (COND
	     ((EQ LINKTYPE NC.CreateLinkedTextInclusionLinkType)
	       NC.CreateLinkedTextInclusionTitle)
	     ((EQ LINKTYPE NC.CreateLinkedTextNoteLinkType)
	       NC.CreateLinkedTextNoteTitle)
	     (T NIL)))
         (SETQ NEW.CARD (NCP.CreateCard (QUOTE Text)
					    (NCP.CardNoteFile LINKING.CARD)
					    TITLE T))
         (NC.InsertLinkInText TEXT.STREAM LINKTYPE NEW.CARD LINKING.CARD)
         (NCP.OpenCard NEW.CARD (NCP.NewTextCardRegion LINKING.CARD LINKTYPE))
         (NC.AssignTitle NEW.CARD)                         (* ;; 
							     
"kludge to give tty back to linking card.  Unnecesary in Lyric?")
         (bind (PROCESS ← (WINDOWPROP (NCP.CardWindow NEW.CARD)
					(QUOTE PROCESS)))
	    first (TTY.PROCESS PROCESS) until (OR (NULL PROCESS)
						      (PROCESS.FINISHEDP PROCESS))
	    do (BLOCK))
         (TTY.PROCESS (WINDOWPROP (NCP.CardWindow LINKING.CARD)
				      (QUOTE PROCESS))))))

(NCP.NewTextCardRegion
  (LAMBDA (LINKING.CARD LINKTYPE)                            (* kirk: "17-Feb-87 21:56")
    (NC.NewTextCardRegion LINKING.CARD LINKTYPE)))

(NC.NewTextCardRegion
  (LAMBDA (LINKING.CARD LINKTYPE)                            (* kirk: "20-Feb-87 22:41")
    (LET ((REGION (WINDOWREGION (NCP.CardWindow LINKING.CARD))))
         (AND REGION (MAKEWITHINREGION (CREATEREGION (IPLUS (fetch (REGION LEFT)
								       of REGION)
								    (fetch (REGION WIDTH)
								       of REGION))
							   (COND
							     ((EQ LINKTYPE 
							     NC.CreateLinkedTextInclusionLinkType)
							       (IDIFFERENCE (fetch (REGION BOTTOM)
										 of REGION)
									      (fetch (REGION HEIGHT)
										 of REGION)))
							     ((EQ LINKTYPE 
								  NC.CreateLinkedTextNoteLinkType)
							       (IDIFFERENCE
								 (IPLUS (fetch (REGION BOTTOM)
									     of REGION)
									  (fetch (REGION HEIGHT)
									     of REGION))
								 (IPLUS (NC.FetchDefaultHeight
									    LINKING.CARD)
									  40)))
							     (T NIL))
							   (NC.FetchDefaultWidth LINKING.CARD)
							   (NC.FetchDefaultHeight LINKING.CARD))))))
)
)



(* ;; "setup TEDIT keys")

(TEDIT.SETFUNCTION NC.CreateLinkedTextNoteChar (QUOTE NC.CreateLinkedTextNote))
(TEDIT.SETFUNCTION NC.CreateLinkedTextInclusionChar (QUOTE NC.CreateLinkedTextInclusion))
(TEDIT.SETFUNCTION NC.CloseTextCardChar (QUOTE NC.CloseTextCard))
(PUTPROPS KIRKPATCH035 COPYRIGHT ("Xerox Corporation" 1987))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (3323 3603 (NC.CreateLinkedTextNote 3333 . 3601)) (3999 4289 (
NC.CreateLinkedTextInclusion 4009 . 4287)) (4440 4786 (NC.CloseTextCard 4450 . 4784)) (4841 7389 (
NC.CreateLinkedNewTextCard 4851 . 6142) (NCP.NewTextCardRegion 6144 . 6318) (NC.NewTextCardRegion 6320
 . 7387)))))
STOP