(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP")
(FILECREATED "22-Feb-88 16:07:27" {QV}<NOTECARDS>1.3LNEXT>PMIPATCH091.;1 9967   

      changes to%:  (VARS PMIPATCH091COMS))


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

(PRETTYCOMPRINT PMIPATCH091COMS)

(RPAQQ PMIPATCH091COMS (
          
          (* ;; "pmi 2/22/88: This patch simply recompiles NC.MakeDocument to rid it of a call to obsolete NAMED-RESETRESTORE. ")

                        (DECLARE%: DONTCOPY (PROPS (PMIPATCH091 MAKEFILE-ENVIRONMENT)
                                                   (PMIPATCH091 FILETYPE)))
                        [DECLARE%: FIRST (P (NC.LoadFileFromDirectories 'NCDOCUMENTCARD]
                        
          
          (* ;; "Recompiled in NCDOCUMENTCARD")

                        (FNS NC.MakeDocument)))



(* ;; 
"pmi 2/22/88: This patch simply recompiles NC.MakeDocument to rid it of a call to obsolete NAMED-RESETRESTORE. "
)

(DECLARE%: DONTCOPY 

(PUTPROPS PMIPATCH091 MAKEFILE-ENVIRONMENT (:PACKAGE "INTERLISP" :READTABLE "INTERLISP"))

(PUTPROPS PMIPATCH091 FILETYPE :BCOMPL)
)
(DECLARE%: FIRST 
(NC.LoadFileFromDirectories 'NCDOCUMENTCARD)
)



(* ;; "Recompiled in NCDOCUMENTCARD")

(DEFINEQ

(NC.MakeDocument
  [LAMBDA (Card Title NoDisplayFlg CardIdentifier)           (* rht%: " 4-Jun-87 12:14")
          
          (* * Called from a filebox's title bar. Makes a document by smashing all the 
          descendant cards's text together. Ask user if wants numbered section headings 
          and titles. The former are made from FileBox titles, the latter from notecard 
          titles. Delete embedded links at the end if the user desires.)
          
          (* * rht 10/22/84%: Hacked to be callable from Programmer's interface.)
          
          (* * rht 11/17/84%: Checks for cancel when choosing rootID and also when 
          setting parameters.)
          
          (* * rht 8/25/85%: Now dumps sketch and graph cards as well as text cards.)
          
          (* * rht 9/16/85%: Now handles cr's around titles using para leading.)
          
          (* * fgh |11/178/85| Updated to handle Card and NoteFile objects.)
          
          (* * kirk 27Jun86 Moved NC.RetrieveTitle call so does not break when user 
          Cancels)
          
          (* * rht 7/31/86%: Now checks for card types having ExportSubstanceFn prop.)
          
          (* * kirk |8/22/86| Fix of free use of NoteFile var)
          
          (* * rht 10/15/86%: Integrated markM's changes and fixed box numbering.)
          
          (* * rht 11/17/86%: Now calls NC.ApplySupersFn rather than NC.MakeNoteCard.)
          
          (* * 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 |3/16/87| NC.DeleteNoteCards -> NC.DeleteNoteCard)
          
          (* * rg |3/18/87| added NC.CardSelectionOperation wrapper.
          Still needs ProtectedCardOperation wrapper!)
          
          (* * rg |4/2/87| changed NC.CardSelectionOperation to NCP.WithLockedCards)
          
          (* * rht 4/17/87%: No longer bugs user for confirm of delete when cancel'ing.)
          
          (* * rht 6/4/87%: Now stashes on doc card a prop list of destination notefiles 
          of cross-file links encountered during creation of contents.)

    (NCP.WithLockedCards (PROG (RootCard RootTitle DocWindow DocCard DocWindowOrCard DocStream 
                                      HeadingsFromFileboxes TitlesFromNoteCards BuildBackLinks 
                                      CopyEmbeddedLinks ExpandEmbeddedLinks InspectWin 
                                      RootSubstanceType)
                               (OR NoDisplayFlg (SPAWN.MOUSE))
                               (SETQ DocWindowOrCard (NC.ApplySupersFn MakeFn Card "Document" 
                                                            NoDisplayFlg))
                               (if NoDisplayFlg
                                   then (SETQ DocWindow NIL)
                                        (SETQ DocCard DocWindowOrCard)
                                 else (SETQ DocWindow DocWindowOrCard)
                                      (SETQ DocCard (NC.CoerceToCard DocWindow)))
          
          (* NC.MakeNoteCard either returned an Card or a window depending on 
          NoDisplayFlg.)

                               (SETQ RootCard (OR (NC.CoerceToCard CardIdentifier)
                                                  (NC.SelectNoteCards T NIL NC.SelectingCardMenu 
                                                         DocWindow 
                      "Please shift-select the Note Card or File Box the document should start from."
                                                         )))
                               (if (NOT RootCard)
                                   then (NC.DeleteNoteCard Card NIL T)
                                        (RETURN NIL))
                               (SETQ RootTitle (NC.RetrieveTitle RootCard))
                               (NC.SetTitle DocCard (CONCAT "Document from %"" RootTitle "%""))
                               (AND DocWindow (WINDOWPROP DocWindow 'TITLE (NC.RetrieveTitle DocCard)
                                                     ))
                               (SETQ DocStream (NC.FetchSubstance DocCard))
          
          (* * Get MakeDocument parameters from user via inspector window.)

                               (if (NOT NoDisplayFlg)
                                   then (SETQ InspectWin (NC.BuildMakeDocInspector DocWindow))
                                        (TOTOPW InspectWin)
                                        (for while (OPENWP InspectWin) do (BLOCK)))
                               (if (EQ (GETPROP 'NC.MakeDocParameters '--DONE--)
                                       'QUIT)
                                   then (PUTPROP 'NC.MakeDocParameters '--DONE-- '--CANCEL--)
                                        (NC.DeleteNoteCard Card NIL T)
                                        (RETURN NIL))
                               (SETQ HeadingsFromFileboxes (GETPROP 'NC.MakeDocParameters
                                                                  'HeadingsFromFileboxes))
                               (SETQ TitlesFromNoteCards (GETPROP 'NC.MakeDocParameters '
                                                                TitlesFromNoteCards))
                               (SETQ BuildBackLinks (GETPROP 'NC.MakeDocParameters 'BuildBackLinks))
                               (SETQ CopyEmbeddedLinks (GETPROP 'NC.MakeDocParameters '
                                                              CopyEmbeddedLinks))
                               (SETQ ExpandEmbeddedLinks (GETPROP 'NC.MakeDocParameters '
                                                                ExpandEmbeddedLinks))
          
          (* * Call recursive routine to dump filebox.)

                               (RESETLST (RESETSAVE (CURSOR WAITINGCURSOR))
                                      (NC.PrintMsg DocWindow NIL 
                                             "Collecting text from descendant cards ... ")
          
          (* * Clean up the SeenBefore markers placed on the cards and boxes just copied.)

                                      [RESETSAVE NIL '(PROGN (for Card
                                                                in (NC.FetchUserDataProp DocCard
                                                                          'SeenCards)
                                                                do (NC.SetUserDataProp Card
                                                                          'SeenBefore NIL))
                                                             (NC.SetUserDataProp DocCard 'SeenCards 
                                                                    NIL]
                                                             (* Clean up the 
                                                             CrossFileLinkModePropList hung off the 
                                                             Doccard.)
                                      [RESETSAVE NIL '(PROGN (NC.SetUserDataProp DocCard '
                                                                    CrossFileLinkModePropList NIL]
          
          (* * Unbelievably kludgy hack to get around Intermezzo TEdit bug.
          Just insert and delete a CR.)

                                      (TEDIT.INSERT DocStream NC.CRString 1)
                                      (TEDIT.DELETE DocStream 1 1)
                                      (NC.SetUserDataProp DocCard 'CrossFileLinkModePropList
                                             (LIST (fetch (Card NoteFile) of DocCard)
                                                   NIL))
                                      (NC.DumpCardToDoc RootCard DocCard DocStream 0 0 
                                             HeadingsFromFileboxes TitlesFromNoteCards BuildBackLinks 
                                             CopyEmbeddedLinks ExpandEmbeddedLinks)
                                      (NC.PrintMsg DocWindow NIL "Done!"))
                               (COND
                                  ((NOT NoDisplayFlg)
                                   (BLOCK 250)
                                   (NC.ClearMsg DocWindow T)))
                               (RETURN DocWindowOrCard])
)
(PUTPROPS PMIPATCH091 COPYRIGHT ("Xerox Corporation" 1988))
(DECLARE%: DONTCOPY
  (FILEMAP (NIL (1270 9884 (NC.MakeDocument 1280 . 9882)))))
STOP