(FILECREATED "15-Dec-85 13:03:39" {FLOPPY}EDITRECALL.;1 7590   

      changes to:  (FNS EDITRECALLPROMPT DFSELECT DVSELECT TEDSELECT DOTEDIT EDITRECALL 
			EDITRECALLMENU)
		   (VARS EDITRECALLCOMS)

      previous date: "15-Dec-85 12:07:37" {DSK}<USERFILES>LISPUSERS>EDITRECALL.;38)


(PRETTYCOMPRINT EDITRECALLCOMS)

(RPAQQ EDITRECALLCOMS ((* Improved interfaces to DF, DV, and TEDIT.)
		       (INITVARS (EDITEDFNS)
				 (EDITEDVARS)
				 (EDITEDFILES)
				 (TEDITWIN))
		       [INITVARS (EDITEDFNS)
				 (EDITEDVARS)
				 (EDITEDFILES)
				 (TEDITWIN)
				 (EDITEDMENUFONT (FONTCREATE (QUOTE HELVETICA)
							     10))
				 (TEDITWINREG (QUOTE (456 10 539 769]
		       (ADVISE EDITF EDITV EDITE)
		       (LISPXMACROS DSV DSF TED)
		       (VARS (BackgroundMenu))
		       (P (DREMOVE (ASSOC (QUOTE TEdit)
					  BackgroundMenuCommands)
				   BackgroundMenuCommands))
		       (APPENDVARS (BackgroundMenuCommands (TEdit (QUOTE (TEDSELECT))
								  "Edit selected file.")
							   (DV (QUOTE (DVSELECT))
							       "Edit selected variable.")
							   (DF (QUOTE (DFSELECT))
							       "Edit selected function.")))
		       (* * Supporting FNS)
		       (FNS DOTEDIT EDITRECALL EDITRECALLMENU EDITRECALLPROMPT DFSELECT DVSELECT 
			    TEDSELECT)
		       (* * Compiler)
		       (LOCALVARS . T)
		       (GLOBALVARS EDITEDFNS EDITEDVARS EDITEDFILES TEDITWIN TEDITWINREG 
				   EDITEDMENUFONT)))



(* Improved interfaces to DF, DV, and TEDIT.)


(RPAQ? EDITEDFNS )

(RPAQ? EDITEDVARS )

(RPAQ? EDITEDFILES )

(RPAQ? TEDITWIN )

(RPAQ? EDITEDFNS )

(RPAQ? EDITEDVARS )

(RPAQ? EDITEDFILES )

(RPAQ? TEDITWIN )

(RPAQ? EDITEDMENUFONT (FONTCREATE (QUOTE HELVETICA)
				  10))

(RPAQ? TEDITWINREG (QUOTE (456 10 539 769)))

(PUTPROPS EDITF READVICE [NIL (BEFORE NIL (AND (EQ T (CAR EDITFX))
					       (RPLACA EDITFX (CAR EDITEDFNS])

(PUTPROPS EDITV READVICE [NIL (BEFORE NIL (AND (EQ T (CAR EDITVX))
					       (RPLACA EDITVX (CAR EDITEDVARS])

(PUTPROPS EDITE READVICE [NIL (AFTER NIL (AND !VALUE (EDITRECALL ATM TYPE])
(READVISE EDITF EDITV EDITE)

(ADDTOVAR LISPXMACROS (DSV (DVSELECT (CAR LISPXLINE)))
		      (DSF (DFSELECT (CAR LISPXLINE)))
		      (TED (TEDSELECT (CAR LISPXLINE))))

(RPAQQ BackgroundMenu NIL)
(DREMOVE (ASSOC (QUOTE TEdit)
		BackgroundMenuCommands)
	 BackgroundMenuCommands)

(APPENDTOVAR BackgroundMenuCommands (TEdit (QUOTE (TEDSELECT))
					   "Edit selected file.")
				    (DV (QUOTE (DVSELECT))
					"Edit selected variable.")
				    (DF (QUOTE (DFSELECT))
					"Edit selected function."))
(* * Supporting FNS)

(DEFINEQ

(DOTEDIT
  [LAMBDA (FILE)                                             (* M.Model "15-Dec-85 12:05")
                                                             (* interface to TEDIT)
    (LET [(FILNAM (AND (NOT (ZEROP (NCHARS FILE)))
		       (MKATOM FILE]
      (COND
	([AND FILNAM (SETQ FILNAM (OR (INFILEP FILNAM)
				      (AND (NULL (FILENAMEFIELD FILNAM (QUOTE EXTENSION)))
					   (INFILEP (PACKFILENAME (QUOTE EXTENSION)
								  (QUOTE TED)
								  (QUOTE BODY)
								  FILNAM)))
				      (AND (EQ (QUOTE Y)
					       (RESETFORM (TTYDISPLAYSTREAM PROMPTWINDOW)
							  (CLRPROMPT)
							  (ASKUSER 15 (QUOTE Y)
								   (CONCAT "File " FILNAM 
							   " does not exist; want to create it? ")
								   NIL T)))
					   (CLOSEF (OPENFILE FILNAM (QUOTE OUTPUT]
	  [TEDIT FILNAM (COND
		   ((OPENWP TEDITWIN)
		     NIL)
		   ((WINDOWP TEDITWIN))
		   (T (SETQ TEDITWIN (CREATEW TEDITWINREG]
	  (SETQ FILNAM (PACKFILENAME (QUOTE VERSION)
				     NIL
				     (QUOTE HOST)
				     NIL
				     (QUOTE BODY)
				     FILNAM))
	  (EDITRECALL FILNAM (QUOTE TEDIT))
	  FILNAM])

(EDITRECALL
  [LAMBDA (ATM TYPE)                                         (* M.Model "28-Nov-85 10:59")
    (AND ATM (SELECTQ TYPE
		      [(FNS FN PROP NIL)                     (* TYPE = PROP for EDITFs of definitions stored as 
							     props.)
			(/SET (QUOTE EDITEDFNS)
			      (CONS ATM (/DREMOVE ATM EDITEDFNS]
		      [(VARS VAR T)
			(/SET (QUOTE EDITEDVARS)
			      (CONS ATM (/DREMOVE ATM EDITEDVARS]
		      [TEDIT (/SET (QUOTE EDITEDFILES)
				   (CONS ATM (/DREMOVE ATM EDITEDFILES]
		      NIL])

(EDITRECALLMENU
  [LAMBDA (TITLE ITEMS)                                      (* M.Model "26-Nov-85 22:40")
    (LET ((MENU (create MENU
			TITLE ← TITLE
			ITEMS ← ITEMS
			MENUFONT ← EDITEDMENUFONT)))
      MENU:MENU.MENUOFFSET←(create POSITION
				   XCOORD ← -1
				   YCOORD ←(IDIFFERENCE [IDIFFERENCE
							  MENU:MENU.IMAGEHEIGHT
							  (ITIMES (FONTPROP MENU:MENU.MENUFONT
									    (QUOTE HEIGHT]
							4))
      (RESETFORM (CURSOR T)
		 (MENU MENU])

(EDITRECALLPROMPT
  [LAMBDA (TYPE)                                             (* M.Model "15-Dec-85 11:39")
    (CLRPROMPT)
    (MKATOM (PROMPTFORWORD (SELECTQ TYPE
				    (FN "Name of function to edit (CR to abort): ")
				    (VAR "Name of variable to edit (CR to abort): ")
				    (FILE "Name of file to edit (CR to abort): ")
				    (SHOULDNT))
			   NIL NIL PROMPTWINDOW])

(DFSELECT
  [LAMBDA (.ARG.)                                            (* M.Model "15-Dec-85 11:43")
    (RESETFORM (TTYDISPLAYSTREAM \TopLevelTtyWindow)
	       (LET [(result (COND
			       ((FIXP .ARG.)
				 (OR (CAR (NTH EDITEDFNS .ARG.))
				     (ERROR 
				       "Function recall list does not contain that many entries."
					    .ARG.)))
			       ((LISTP .ARG.)
				 (EVAL .ARG.))
			       (.ARG.)
			       ((AND (LISTP EDITEDFNS)
				     (EDITRECALLMENU "Function?" EDITEDFNS)))
			       (T (EDITRECALLPROMPT (QUOTE FN]
		 (AND result (APPLY* (QUOTE DF)
				     result])

(DVSELECT
  [LAMBDA (.ARG.)                                            (* M.Model "15-Dec-85 11:46")
    (RESETFORM (TTYDISPLAYSTREAM \TopLevelTtyWindow)
	       (LET [(result (COND
			       ((FIXP .ARG.)
				 (OR (CAR (NTH EDITEDVARS .ARG.))
				     (ERROR 
				       "Variable recall list does not contain that many entries."
					    .ARG.)))
			       ((LISTP .ARG.)
				 (EVAL .ARG.))
			       (.ARG.)
			       ((AND (LISTP EDITEDVARS)
				     (EDITRECALLMENU "Variable?" EDITEDVARS)))
			       (T (EDITRECALLPROMPT (QUOTE VAR]
		 (AND result (APPLY* (QUOTE DV)
				     result])

(TEDSELECT
  [LAMBDA (.ARG.)                                            (* M.Model "15-Dec-85 11:54")
    (LET [(result (COND
		    ((FIXP .ARG.)
		      (OR (CAR (NTH EDITEDFILES .ARG.))
			  (ERROR "File recall list does not contain that many entries." .ARG.)))
		    ((LISTP .ARG.)
		      (EVAL .ARG.))
		    (.ARG.)
		    ((AND (LISTP EDITEDFILES)
			  (EDITRECALLMENU "File?" EDITEDFILES)))
		    (T (EDITRECALLPROMPT (QUOTE FILE]
      (AND result (APPLY* (QUOTE DOTEDIT)
			  result])
)
(* * Compiler)

(DECLARE: DOEVAL@COMPILE DONTCOPY

(LOCALVARS . T)
)
(DECLARE: DOEVAL@COMPILE DONTCOPY

(GLOBALVARS EDITEDFNS EDITEDVARS EDITEDFILES TEDITWIN TEDITWINREG EDITEDMENUFONT)
)
(DECLARE: DONTCOPY
  (FILEMAP (NIL (2646 7375 (DOTEDIT 2656 . 3940) (EDITRECALL 3942 . 4535) (EDITRECALLMENU 4537 . 5054) (
EDITRECALLPROMPT 5056 . 5465) (DFSELECT 5467 . 6134) (DVSELECT 6136 . 6807) (TEDSELECT 6809 . 7373))))
)
STOP