(FILECREATED " 3-Feb-86 12:32:36" {ERIS}<CUTTING>LISP>KOTO>DINFOEDIT.;7 28207 changes to: (VARS DINFOEDITCOMS) (FNS DINFO.UPDATE.HISTORY.DISPLAY DINFO.CHANGE.GRAPHS DINFO.DEFAULT.EDITFN) (MACROS DINFOGRAPHPROP) previous date: "26-Jan-86 16:50:14" {ERIS}<CUTTING>LISP>KOTO>DINFOEDIT.;5) (* Copyright (c) 1986 by Xerox Corporation. All rights reserved.) (PRETTYCOMPRINT DINFOEDITCOMS) (RPAQQ DINFOEDITCOMS ((FILES DINFO) (MACROS DINFOGRAPHPROP) (FNS DINFO.DUMMY.GRAPH DINFO.EDIT.MENU DINFOEDIT.CLOSEFN DINFO.MARKASCHANGED DINFO.UNMARKASCHANGED DINFO.FORCED.UPDATE DINFO.ISCHANGED DINFO.SAVE.GRAPH DINFO.FETCH.GRAPH DINFO.ADD.NODE DINFO.DELETE.NODE DINFO.EDIT.NODE DINFO.TEDIT DINFO.NODE.EDITOR DINFO.EDIT.NODE.WINDOW DINFO.DECODE.NODE.FM DINFO.SELECT.NEIGHBOR DINFO.READ/NODE) (FNS (* redefined DInfo functions) DINFO.CHOOSE.GRAPH DINFO.CHANGE.GRAPHS DINFO.INIT DINFO.DEFAULT.EDITFN DINFO.UPDATE.HISTORY.DISPLAY))) (FILESLOAD DINFO) (DECLARE: EVAL@COMPILE [PUTPROPS DINFOGRAPHPROP MACRO (ARGS (LET ((GRAPH (CAR ARGS)) (PROP (CADR ARGS))) (SELECTQ (LENGTH ARGS) (2 (BQUOTE (LISTGET (fetch (DINFOGRAPH USERDATA) of , GRAPH) , PROP))) [3 (BQUOTE (LET ((USERDATA (fetch (DINFOGRAPH USERDATA) of , GRAPH))) (if USERDATA then (LISTPUT USERDATA , PROP , (CADDR ARGS)) else (LET ((RESULT , (CADDR ARGS))) (replace (DINFOGRAPH USERDATA) of , GRAPH with (LIST , PROP RESULT)) RESULT] NIL] ) (DEFINEQ (DINFO.DUMMY.GRAPH [LAMBDA NIL (* drc: "26-Jan-86 15:06") (* * Create an empty, editable graph) (LET* [(DIR (DIRECTORYNAME T)) (GRAPH (create DINFOGRAPH NODELST ←(LIST (create DINFONODE ID ← 0)) TOPNODEID ← 0 EDITFN ←(FUNCTION DINFO.EDIT.MENU) DEFAULTHOST ←(FILENAMEFIELD DIR (QUOTE HOST)) DEFAULTDEVICE ←(FILENAMEFIELD DIR (QUOTE DEVICE)) DEFAULTDIR ←(FILENAMEFIELD DIR (QUOTE DIRECTORY] GRAPH]) (DINFO.EDIT.MENU [LAMBDA (GRAPH) (* drc: "26-Jan-86 15:33") (* * A MENUFN for DInfo graphs which enables graph editing) (RESETFORM (TTYDISPLAYSTREAM (GETPROMPTWINDOW DINFOW)) (CLEARW T) (LET [(TYPE (LET [(MENU (DINFOGRAPHPROP GRAPH (QUOTE DINFO.EDIT.MENU] [OR (type? MENU (DINFOGRAPHPROP GRAPH (QUOTE DINFO.EDIT.MENU))) (SETQ MENU (DINFOGRAPHPROP GRAPH (QUOTE DINFO.EDIT.MENU) (create MENU ITEMS ←(QUOTE (("Put Graph" (QUOTE PUT) "Save current graph to a file") ("Get Graph" (QUOTE GET) "Read a graph from a file and visit it") ("Add Child" (QUOTE ADD) "Add a child node to the current node") ("Delete Node" (QUOTE DELETE) "Delete a terminal node from the current graph") ("Edit Node" (QUOTE EDIT) "Edit a selected node with the node editor" (SUBITEMS ("This node" (QUOTE EDIT.THIS) "Start the node editor on the current node"))) ("TEdit" (QUOTE TEDIT) "Tedit the text of the current node"))) TITLE ← "DInfo Edit Menu " CENTERFLG ← T] (MENU MENU] (if TYPE then (PROCESSPROP (THIS.PROCESS) (QUOTE NAME) (CONCAT "DInfo " (L-CASE TYPE T))) (SELECTQ TYPE (PUT (DINFO.SAVE.GRAPH GRAPH)) (GET (DINFO.FETCH.GRAPH GRAPH)) (ADD (DINFO.ADD.NODE GRAPH)) (DELETE (DINFO.DELETE.NODE GRAPH)) (EDIT (DINFO.EDIT.NODE GRAPH)) (EDIT.THIS (DINFO.EDIT.NODE GRAPH T)) (TEDIT (DINFO.TEDIT GRAPH)) NIL]) (DINFOEDIT.CLOSEFN [LAMBDA (W) (* drc: "26-Jan-86 15:07") (LET [(GRAPH (WINDOWPROP W (QUOTE DINFOGRAPH] (if (LISTP GRAPH) then (if [AND (DINFO.ISCHANGED GRAPH) (NOT (MOUSECONFIRM "Graph has been changed" NIL ( GETPROMPTWINDOW W] then (QUOTE DON'T]) (DINFO.MARKASCHANGED [LAMBDA (GRAPH) (* drc: "24-Jan-86 00:48") (DINFOGRAPHPROP GRAPH (QUOTE GRAPH.CHANGED) T]) (DINFO.UNMARKASCHANGED [LAMBDA (GRAPH) (* drc: "26-Jan-86 15:54") (DINFOGRAPHPROP GRAPH (QUOTE GRAPH.CHANGED) NIL]) (DINFO.FORCED.UPDATE [LAMBDA (NODE) (* drc: "26-Jan-86 16:05") (replace (DINFOGRAPH CURRENTNODE) of GRAPH with NIL) (DINFO.UPDATE NODE]) (DINFO.ISCHANGED [LAMBDA (GRAPH) (* drc: "17-Jan-86 13:46") (AND GRAPH (DINFOGRAPHPROP GRAPH (QUOTE GRAPH.CHANGED]) (DINFO.SAVE.GRAPH [LAMBDA (GRAPH) (* drc: "26-Jan-86 15:35") (LET [(FILENAME (PROMPTFORWORD "Put: " [AND (fetch (DINFOGRAPH NAME) of GRAPH) (MKSTRING (PACKFILENAME (QUOTE HOST) (fetch (DINFOGRAPH DEFAULTHOST) of GRAPH) (QUOTE DIRECTORY) (fetch (DINFOGRAPH DEFAULTDIR) of GRAPH) (QUOTE NAME) (fetch (DINFOGRAPH NAME) of GRAPH) (QUOTE EXTENSION) (QUOTE DINFOGRAPH] NIL NIL NIL (QUOTE TTY] (if FILENAME then (PRINTOUT T " ...") (SETQ FILENAME (DINFO.WRITE.GRAPH GRAPH FILENAME)) (CLEARW T) (PRINTOUT T "Written: " FILENAME) (replace (DINFOGRAPH NAME) of GRAPH with (FILENAMEFIELD FILENAME (QUOTE NAME))) (replace (DINFOGRAPH DEFAULTHOST) of GRAPH with (FILENAMEFIELD FILENAME (QUOTE HOST))) (replace (DINFOGRAPH DEFAULTDIR) of GRAPH with (FILENAMEFIELD FILENAME (QUOTE DIRECTORY))) (WINDOWPROP DINFOW (QUOTE TITLE) (CONCAT (fetch (DINFOGRAPH NAME) of GRAPH) " DInfo Graph")) (DINFO.UNMARKASCHANGED GRAPH) FILENAME else (PRINTOUT T " Aborted") NIL]) (DINFO.FETCH.GRAPH [LAMBDA (GRAPH) (* drc: "26-Jan-86 15:56") (if (AND (DINFO.ISCHANGED GRAPH) (NOT (MOUSECONFIRM "Changes have been made." NIL T))) then (CLEARW T) (PRINTOUT T "Get Aborted.") else (LET [(FILENAME (INFILEP (PROMPTFORWORD "Get: " (AND (fetch (DINFOGRAPH NAME) of GRAPH) (PACKFILENAME (QUOTE HOST) (fetch (DINFOGRAPH DEFAULTHOST) of GRAPH) (QUOTE DIRECTORY) (fetch (DINFOGRAPH DEFAULTDIR) of GRAPH) (QUOTE NAME) (fetch (DINFOGRAPH NAME) of GRAPH) (QUOTE EXTENSION) (QUOTE DINFOGRAPH))) NIL NIL NIL (QUOTE TTY] (if FILENAME then (PRINTOUT T " ...") (DINFO.CHANGE.GRAPHS (DINFO.READ.GRAPH FILENAME)) (DINFO.UNMARKASCHANGED (DINFO.GETQ CURRENT.GRAPH)) else (PRINTOUT T " not found."]) (DINFO.ADD.NODE [LAMBDA (GRAPH) (* drc: "26-Jan-86 16:08") (LET* ((CURRENT.NODE (fetch (DINFOGRAPH CURRENTNODE) of GRAPH)) (NODELST (fetch (DINFOGRAPH NODELST) of GRAPH)) NEW.CHILD) (SETQ NEW.CHILD (DINFO.NODE.EDITOR (create DINFONODE ID ←(bind (I ← 1) until (NOT (FASSOC I NODELST)) do (SETQ I (ADD1 I)) finally (RETURN I)) PARENT ←(fetch (DINFONODE ID) of CURRENT.NODE)) GRAPH)) (CLEARW T) (if NEW.CHILD then (DINFO.FORCED.UPDATE CURRENT.NODE) (DINFO.MARKASCHANGED GRAPH) (PRINTOUT T "OK, child added") else (PRINTOUT T "Add Child aborted"]) (DINFO.DELETE.NODE [LAMBDA (GRAPH) (* drc: "26-Jan-86 16:08") (PROG* ((NODE (DINFO.READ/NODE GRAPH "to be deleted")) (NODELST (fetch (DINFOGRAPH NODELST) of GRAPH)) (PARENT (FASSOC (fetch (DINFONODE PARENT) of NODE) NODELST)) (PREVIOUSNODE (FASSOC (fetch (DINFONODE PREVIOUSNODE) of NODE) NODELST)) (NEXTNODE (FASSOC (fetch (DINFONODE NEXTNODE) of NODE) NODELST)) (CHILDREN (fetch (DINFONODE CHILDREN) of NODE))) (CLEARW T) (COND ((EQ (fetch (DINFONODE ID) of NODE) (fetch (DINFOGRAPH TOPNODEID) of GRAPH)) (PRINTOUT T "The top node cannot be deleted")) ((NULL CHILDREN) (OR (MOUSECONFIRM (CONCAT "Delete node " (fetch (DINFONODE LABEL) of NODE) " ?") NIL T) (RETURN (PRINTOUT T "Delete node aborted"))) (replace (DINFOGRAPH NODELST) of GRAPH with (DREMOVE NODE NODELST)) (replace (DINFONODE CHILDREN) of PARENT with (DREMOVE (fetch (DINFONODE ID) of NODE) (fetch (DINFONODE CHILDREN) PARENT))) (if (AND PREVIOUSNODE NEXTNODE) then (replace (DINFONODE NEXTNODE) of PREVIOUSNODE with (fetch (DINFONODE ID) of NEXTNODE)) (replace (DINFONODE PREVIOUSNODE) of NEXTNODE with (fetch (DINFONODE ID) of PREVIOUSNODE))) (DINFO.FORCED.UPDATE (if (EQ NODE (fetch (DINFOGRAPH CURRENTNODE) of GRAPH)) then (FASSOC (fetch (DINFONODE PARENT) of NODE) NODELST) else (fetch (DINFOGRAPH CURRENTNODE) of GRAPH))) (DINFO.MARKASCHANGED GRAPH) (CLEARW T) (PRINTOUT T "OK, node " (fetch (DINFONODE LABEL) of NODE) " deleted.")) (T (PRINTOUT T "Sorry, only terminal nodes can be deleted."]) (DINFO.EDIT.NODE [LAMBDA (GRAPH CURRENT.NODE?) (* drc: "26-Jan-86 16:09") (LET ((NEW.NODE (DINFO.NODE.EDITOR (if CURRENT.NODE? then (fetch (DINFOGRAPH CURRENTNODE) of GRAPH) elseif (NULL (CDR (fetch (DINFOGRAPH NODELST) of GRAPH))) then (CAR (fetch (DINFOGRAPH NODELST) of GRAPH)) else (DINFO.READ/NODE GRAPH "to edit")) GRAPH))) (CLEARW T) (COND (NEW.NODE (DINFO.FORCED.UPDATE (fetch (DINFOGRAPH CURRENTNODE) of GRAPH)) (DINFO.MARKASCHANGED GRAPH) (PRINTOUT T "OK, Node Edit completed")) (T (PRINTOUT T "Node Edit aborted"]) (DINFO.TEDIT [LAMBDA (GRAPH) (* drc: "26-Jan-86 16:09") (RESETLST (LET* ((NODE (fetch (DINFOGRAPH CURRENTNODE) of GRAPH)) (FILE (DINFO.GET.FILENAME GRAPH NODE)) (TEXTSTREAM (TEXTSTREAM DINFOW)) (TEXTOBJ (TEXTOBJ TEXTSTREAM))) (DETACHALLWINDOWS DINFOW) (WINDOWDELPROP DINFOW (QUOTE CLOSEFN) (QUOTE DINFOEDIT.CLOSEFN)) (TTY.PROCESS (THIS.PROCESS)) (TEDIT TEXTOBJ DINFOW T (QUOTE (READONLY NIL QUITFN NILL))) (SELECTQ [SETQ FILE (FULLNAME (fetch TXTFILE of (TEXTOBJ TEXTSTREAM] ((T NIL)) (PROGN [OR (MKATOM (fetch (DINFONODE LABEL) of NODE)) (replace (DINFONODE LABEL) of NODE with (FILENAMEFIELD FILE (QUOTE NAME] [replace (DINFONODE FILE) of NODE with (LET ((L (UNPACKFILENAME FILE))) (PACKFILENAME (QUOTE NAME) (LISTGET L (QUOTE NAME)) (QUOTE EXTENSION) (LISTGET L (QUOTE EXTENSION)) (QUOTE HOST) (if (EQ (LISTGET L (QUOTE HOST)) (fetch (DINFOGRAPH DEFAULTHOST) of GRAPH)) then NIL else (LISTGET L (QUOTE HOST))) (QUOTE DEVICE) (if (EQ (LISTGET L (QUOTE DEVICE)) (fetch (DINFOGRAPH DEFAULTDEVICE) of GRAPH)) then NIL else (LISTGET L (QUOTE DEVICE))) (QUOTE DIRECTORY) (if (EQ (LISTGET L (QUOTE DIRECTORY)) (fetch (DINFOGRAPH DEFAULTDIR) of GRAPH)) then NIL else (LISTGET L (QUOTE DIRECTORY] (DINFO.MARKASCHANGED GRAPH))) (DETACHALLWINDOWS DINFOW) (ATTACHWINDOW (WINDOWPROP DINFOW (QUOTE FMENU.WINDOW)) DINFOW) (WINDOWADDPROP DINFOW (QUOTE CLOSEFN) (QUOTE DINFOEDIT.CLOSEFN) T) (DINFO.FORCED.UPDATE (fetch (DINFOGRAPH CURRENTNODE) of GRAPH]) (DINFO.NODE.EDITOR [LAMBDA (NODE GRAPH) (* drc: "16-Dec-85 13:57") (LET* ((NODELST (fetch (DINFOGRAPH NODELST) of GRAPH)) (WINDOW (DINFO.EDIT.NODE.WINDOW NODE NODELST)) NEW.NODE) (WINDOWPROP WINDOW (QUOTE DINFOGRAPH) GRAPH) (WINDOWPROP WINDOW (QUOTE EVENT) (CREATE.EVENT (QUOTE DINFO.NODE.EDITOR))) [WINDOWPROP WINDOW (QUOTE CLOSEFN) (FUNCTION (LAMBDA (W) (NOTIFY.EVENT (WINDOWPROP W (QUOTE EVENT] (RESETSAVE NIL (LIST (QUOTE CLOSEW) WINDOW)) (MOVEW WINDOW (GETBOXPOSITION (WINDOWPROP WINDOW (QUOTE WIDTH)) (WINDOWPROP WINDOW (QUOTE HEIGHT)) NIL NIL NIL "Position DInfo Node Editor window")) (WINDOWPROP WINDOW (QUOTE TITLE) (CONCAT "Edit of DInfo node " (fetch (DINFONODE ID) of NODE))) (AWAIT.EVENT (WINDOWPROP WINDOW (QUOTE EVENT))) (if (WINDOWPROP WINDOW (QUOTE SAVE.CHANGES)) then (LET* ((NEW.NODE (DINFO.DECODE.NODE.FM WINDOW NODE)) (PARENT (FASSOC (fetch (DINFONODE PARENT) of NEW.NODE) NODELST))) (* add into nodelst) (replace (DINFOGRAPH NODELST) of GRAPH with (ATTACH NEW.NODE (DREMOVE NODE NODELST) )) (if (EQ (fetch (DINFONODE ID) of NEW.NODE) (fetch (DINFONODE ID) of (fetch (DINFOGRAPH CURRENTNODE) of GRAPH))) then (replace (DINFOGRAPH CURRENTNODE) of GRAPH with NEW.NODE)) [AND PARENT (replace (DINFONODE CHILDREN) of PARENT with (LET ((ID (fetch (DINFONODE ID) of NEW.NODE)) (NEXT (fetch (DINFONODE NEXTNODE) of NEW.NODE)) (SIBLINGS (fetch (DINFONODE CHILDREN) of PARENT))) (if (MEMB NEXT SIBLINGS) then (LSUBST (LIST NEXT ID) NEXT (DREMOVE ID SIBLINGS)) else (ATTACH ID (DREMOVE ID SIBLINGS] (AND (fetch (DINFONODE PREVIOUSNODE) of NEW.NODE) (replace (DINFONODE NEXTNODE) of (FASSOC (fetch (DINFONODE PREVIOUSNODE) of NEW.NODE) NODELST) with (fetch (DINFONODE ID) of NEW.NODE))) (AND (fetch (DINFONODE NEXTNODE) of NEW.NODE) (replace (DINFONODE PREVIOUSNODE) of (FASSOC (fetch (DINFONODE NEXTNODE) of NEW.NODE) NODELST) with (fetch (DINFONODE ID) of NEW.NODE))) NEW.NODE]) (DINFO.EDIT.NODE.WINDOW [LAMBDA (NODE NODELST) (* drc: "26-Jan-86 15:14") (FM.FORMATMENU (BQUOTE (((LABEL Exit! FONT (HELVETICA 10 BOLD) SELECTEDFN [LAMBDA (ITEM WINDOW) (WINDOWPROP WINDOW (QUOTE SAVE.CHANGES) T) (CLOSEW WINDOW] MESSAGE "Exit DInfo Node editor, saving changes") (LABEL Abort! FONT (HELVETICA 10 BOLD) SELECTEDFN [LAMBDA (ITEM WINDOW) (CLOSEW WINDOW] MESSAGE "Abort DInfo Node editor, changes will be forgotten")) NIL [(LABEL ID: TYPE TITLE FONT (HELVETICA 10)) (ID ID TYPE TITLE FONT (HELVETICA 10) LABEL , (MKSTRING (fetch (DINFONODE ID) of NODE] [(LABEL Label: TYPE EDITSTART ITEMS (LABEL) FONT (HELVETICA 10)) (ID LABEL TYPE EDIT FONT (HELVETICA 10 BOLD) LABEL , (MKSTRING (fetch (DINFONODE LABEL) of NODE] [(LABEL File: TYPE EDITSTART ITEMS (FILE) FONT (HELVETICA 10)) (ID FILE TYPE EDIT FONT (HELVETICA 10 BOLD) LABEL , (MKSTRING (fetch (DINFONODE FILE) of NODE] [(LABEL "Parent:" TYPE TITLE FONT (HELVETICA 10)) (ID PARENT TYPE TITLE FONT (HELVETICA 10) LABEL , (MKSTRING (fetch (DINFONODE LABEL) of (FASSOC (fetch (DINFONODE PARENT) of NODE) NODELST] ((LABEL "Previous Node:" TYPE TITLE FONT (HELVETICA 10)) (ID PREVIOUSNODE FONT (HELVETICA 10 BOLD) LABEL , (MKSTRING (fetch (DINFONODE LABEL) of (FASSOC (fetch (DINFONODE PREVIOUSNODE) of NODE) NODELST))) NODEID , (fetch (DINFONODE PREVIOUSNODE) of NODE) SELECTEDFN DINFO.SELECT.NEIGHBOR MESSAGE "Select a node to be the Previous Node")) ((LABEL "Next Node:" TYPE TITLE FONT (HELVETICA 10)) (ID NEXTNODE FONT (HELVETICA 10 BOLD) LABEL , (MKSTRING (fetch (DINFONODE LABEL) of (FASSOC (fetch (DINFONODE NEXTNODE) of NODE) NODELST))) NODEID , (fetch (DINFONODE NEXTNODE) of NODE) SELECTEDFN DINFO.SELECT.NEIGHBOR MESSAGE "Select a node to be the Next Node"]) (DINFO.DECODE.NODE.FM [LAMBDA (FM.WINDOW OLD.NODE) (* drc: "10-Nov-85 15:49") (LET ((STATE (FM.READSTATE FM.WINDOW))) (create DINFONODE ID ←(fetch (DINFONODE ID) of OLD.NODE) PARENT ←(fetch (DINFONODE PARENT) of OLD.NODE) CHILDREN ←(fetch (DINFONODE CHILDREN) of OLD.NODE) LABEL ←(LISTGET STATE (QUOTE LABEL)) FILE ←(MKATOM (LISTGET STATE (QUOTE FILE))) NEXTNODE ←(FM.ITEMPROP (FM.ITEMFROMID FM.WINDOW (QUOTE NEXTNODE)) (QUOTE NODEID)) PREVIOUSNODE ←(FM.ITEMPROP (FM.ITEMFROMID FM.WINDOW (QUOTE PREVIOUSNODE)) (QUOTE NODEID]) (DINFO.SELECT.NEIGHBOR [LAMBDA (ITEM FM.WINDOW) (* drc: "16-Dec-85 14:19") (LET [(NODE (DINFO.READ/NODE (WINDOWPROP FM.WINDOW (QUOTE DINFOGRAPH)) (SELECTQ (FM.ITEMPROP ITEM (QUOTE ID)) (NEXTNODE "to be Next Node") (PREVIOUSNODE "to be Previous Node") (SHOULDNT] (FM.ITEMPROP ITEM (QUOTE NODEID) (fetch (DINFONODE ID) of NODE)) (FM.CHANGELABEL ITEM FM.WINDOW (fetch (DINFONODE LABEL) of NODE]) (DINFO.READ/NODE [LAMBDA (GRAPH BLURB) (* drc: "26-Jan-86 15:39") (RESETLST (RESETSAVE (TTYDISPLAYSTREAM (GETPROMPTWINDOW DINFOW))) (RESETSAVE (TTY.PROCESS (THIS.PROCESS))) (CLEARW T) (PRINTOUT T "Select node in DInfo Graph window ") (AND BLURB (PRINTOUT T BLURB)) (RESETSAVE (CURSOR CROSSHAIRS)) (LET* ((FMENUW (WINDOWPROP DINFOW (QUOTE FMENU.WINDOW))) (FM.ITEM (FM.ITEMFROMID FMENUW (QUOTE GRAPH))) GRAPHW) (OR (FM.ITEMPROP FM.ITEM (QUOTE STATE)) (PROGN (FM.CHANGESTATE FM.ITEM FMENUW) (DINFO.TOGGLE.GRAPH FM.ITEM FMENUW))) [TOTOPW (SETQ GRAPHW (WINDOWPROP DINFOW (QUOTE GRAPH.WINDOW] (RESETSAVE (INTERRUPTABLE T)) (PROG1 (fetch (GRAPHNODE NODEID) of (READ/NODE (fetch (GRAPH GRAPHNODES) of (WINDOWPROP GRAPHW (QUOTE GRAPH))) GRAPHW)) (TERPRI T]) ) (DEFINEQ (DINFO.CHOOSE.GRAPH [LAMBDA NIL (* drc: "26-Jan-86 16:20") (LET ([GRAPH.FILE (MENU (create MENU TITLE ← "Select Graph " CENTERFLG ← T ITEMS ←(APPEND (UNION (for FILENAME in (DINFO.GETQ GRAPH.FILES) collect (FILENAMEFIELD FILENAME (QUOTE NAME))) (for GRAPH in (DINFO.GETQ CACHED.GRAPHS) collect (fetch (DINFOGRAPH NAME) of GRAPH))) (QUOTE ((">> Empty Graph <<" ( DINFO.DUMMY.GRAPH) "Start DInfo on an Empty editable graph"] GRAPH.NAME GRAPH) (COND ((NULL GRAPH.FILE)) ((LISTP GRAPH.FILE) (DINFO.CHANGE.GRAPHS GRAPH.FILE)) ((EQ (SETQ GRAPH.NAME (FILENAMEFIELD GRAPH.FILE (QUOTE NAME))) (fetch (DINFOGRAPH NAME) of (DINFO.GETQ CURRENT.GRAPH))) (CLEARW (GETPROMPTWINDOW DINFOW)) (PRINTOUT (GETPROMPTWINDOW DINFOW) "Already using " GRAPH.NAME " graph.")) ([SETQ GRAPH (ASSOC GRAPH.NAME (WINDOWPROP DINFOW (QUOTE CACHED.GRAPHS] (DINFO.CHANGE.GRAPHS GRAPH)) (T (DINFO.CHANGE.GRAPHS (DINFO.READ.GRAPH (for X in (DINFO.GETQ GRAPH.FILES) thereis (EQ (FILENAMEFIELD X (QUOTE NAME)) GRAPH.FILE]) (DINFO.CHANGE.GRAPHS [LAMBDA (GRAPH) (* drc: " 3-Feb-86 12:17") (LET ((CURRENT (DINFO.GETQ CURRENT.GRAPH))) (if [AND (LISTP CURRENT) (fetch (DINFOGRAPH NAME) of CURRENT) (NOT (FASSOC (fetch (DINFOGRAPH NAME) of CURRENT) (DINFO.GETQ CACHED.GRAPHS] then (WINDOWADDPROP DINFOW (QUOTE CACHED.GRAPHS) CURRENT)) (if (OR (NLISTP CURRENT) (NOT (DINFO.ISCHANGED CURRENT)) (MOUSECONFIRM "Graph has been changed" "" (GETPROMPTWINDOW DINFOW))) then (DINFO.SETQ CURRENT.GRAPH GRAPH) [FM.CHANGELABEL (FM.ITEMFROMID (DINFO.GETQ FMENU.WINDOW) (QUOTE TOP)) (DINFO.GETQ FMENU.WINDOW) (fetch (DINFONODE LABEL) of (FASSOC (fetch (DINFOGRAPH TOPNODEID) of GRAPH) (fetch (DINFOGRAPH NODELST) of GRAPH] (FM.CHANGELABEL (FM.ITEMFROMID (DINFO.GETQ FMENU.WINDOW) (QUOTE GRAPH!)) (DINFO.GETQ FMENU.WINDOW) (fetch (DINFOGRAPH NAME) of GRAPH)) (DINFO.FORCED.UPDATE (FASSOC (fetch (DINFOGRAPH TOPNODEID) of GRAPH) (fetch (DINFOGRAPH NODELST) of GRAPH]) (DINFO.INIT [LAMBDA NIL (* drc: " 3-Feb-86 12:09") (* Assumes that we are starting DINFO afresh.) (* Set up DINFOW) (SETQ DINFOW (\IRM.GET.IRMWINDOW T)) (WINDOWPROP DINFOW (QUOTE TITLE) "DInfo") (DETACHALLWINDOWS DINFOW) (GETPROMPTWINDOW DINFOW) (DINFO.ADD.FMENU) (OBTAIN.MONITORLOCK (DINFO.SETQ MONITORLOCK (CREATE.MONITORLOCK))) (* Add TEdit functions) (OPENTEXTSTREAM NIL DINFOW NIL NIL (QUOTE (NOTITLE T))) (* Save old def of \IRM.DISPLAY.REF in case DInfo is reset.) (MOVD? (QUOTE \IRM.DISPLAY.REF) (QUOTE \IRM.DISPLAY.REF.SAVE)) (MOVD (QUOTE DINFO.DISPLAY.REF) (QUOTE \IRM.DISPLAY.REF)) (WINDOWPROP (GETPROMPTWINDOW DINFOW) (QUOTE CLOSEFN) NIL) (WINDOWADDPROP DINFOW (QUOTE CLOSEFN) (QUOTE DINFO.QUIT)) (WINDOWADDPROP DINFOW (QUOTE SHRINKFN) (QUOTE DINFO.QUIT)) (WINDOWADDPROP DINFOW (QUOTE EXPANDFN) (QUOTE DINFO)) (WINDOWADDPROP DINFOW (QUOTE RESHAPEFN) (FUNCTION REPOSITIONATTACHEDWINDOWS)) [DINFO.SETQ GRAPH.FILES (if DINFO.INIT.FILE.NAME then (CDR (READFILE DINFO.INIT.FILE.NAME)) else (LIST (PACKFILENAME (QUOTE DIRECTORY) IRM.HOST&DIR (QUOTE NAME) (QUOTE IRM) (QUOTE EXTENSION) (QUOTE DINFOGRAPH] (DINFO.CHOOSE.GRAPH]) (DINFO.DEFAULT.EDITFN [LAMBDA (GRAPH) (* drc: " 3-Feb-86 12:18") (RESETFORM (TTYDISPLAYSTREAM (GETPROMPTWINDOW DINFOW)) (CLEARW T) (PRINTOUT T "The " (fetch (DINFOGRAPH NAME) of GRAPH) " DInfo graph is not editable."]) (DINFO.UPDATE.HISTORY.DISPLAY [LAMBDA (NODE SEL) (* drc: " 3-Feb-86 12:30") (LET* ((OLDWINDOW (DINFO.GETQ HISTORY.MENU.WINDOW)) (NEWITEM (if SEL then (LIST (CAR SEL) (BQUOTE (DINFO.UPDATE (QUOTE , NODE) (QUOTE , SEL))) "Will lookup this term in IRM") else (LIST (fetch (DINFONODE LABEL) of NODE) (BQUOTE (DINFO.UPDATE (QUOTE , NODE))) "Will visit this node"))) (GRAPH (DINFO.GETQ CURRENT.GRAPH)) [ITEMS (DINFOGRAPHPROP GRAPH (QUOTE HISTORY.ITEMS) (if NEWITEM then (CONS NEWITEM (for ITEM in (DINFOGRAPHPROP GRAPH (QUOTE HISTORY.ITEMS)) as I from 2 to DINFO.HISTORY.LENGTH collect ITEM)) else (DINFOGRAPHPROP GRAPH (QUOTE HISTORY.ITEMS] (MENU (create MENU TITLE ← "History" CENTERFLG ← T MENUCOLUMNS ← 1 ITEMS ← ITEMS))) (AND OLDWINDOW (PROGN (DETACHWINDOW OLDWINDOW) (CLOSEW OLDWINDOW))) (AND ITEMS (WINDOWPROP (DINFO.SETQ HISTORY.MENU.WINDOW (ATTACHMENU MENU DINFOW (QUOTE LEFT) (QUOTE TOP))) (QUOTE REJECTMAINCOMS) (QUOTE (SHAPEW]) ) (PUTPROPS DINFOEDIT COPYRIGHT ("Xerox Corporation" 1986)) (DECLARE: DONTCOPY (FILEMAP (NIL (1613 21643 (DINFO.DUMMY.GRAPH 1623 . 2210) (DINFO.EDIT.MENU 2212 . 4155) ( DINFOEDIT.CLOSEFN 4157 . 4554) (DINFO.MARKASCHANGED 4556 . 4734) (DINFO.UNMARKASCHANGED 4736 . 4918) ( DINFO.FORCED.UPDATE 4920 . 5134) (DINFO.ISCHANGED 5136 . 5316) (DINFO.SAVE.GRAPH 5318 . 6855) ( DINFO.FETCH.GRAPH 6857 . 7991) (DINFO.ADD.NODE 7993 . 8824) (DINFO.DELETE.NODE 8826 . 10945) ( DINFO.EDIT.NODE 10947 . 11712) (DINFO.TEDIT 11714 . 14083) (DINFO.NODE.EDITOR 14085 . 16954) ( DINFO.EDIT.NODE.WINDOW 16956 . 19278) (DINFO.DECODE.NODE.FM 19280 . 19992) (DINFO.SELECT.NEIGHBOR 19994 . 20551) (DINFO.READ/NODE 20553 . 21641)) (21644 28127 (DINFO.CHOOSE.GRAPH 21654 . 23158) ( DINFO.CHANGE.GRAPHS 23160 . 24550) (DINFO.INIT 24552 . 26385) (DINFO.DEFAULT.EDITFN 26387 . 26698) ( DINFO.UPDATE.HISTORY.DISPLAY 26700 . 28125))))) STOP