(FILECREATED " 2-Feb-86 19:01:53" {DSK}<LISPFILES2>TELLEDITOR.LSP;2 6274 changes to: (VARS TELLEDITORCOMS)) (* Copyright (c) 1986 by Quintus Computer Systems, Inc. All rights reserved.) (PRETTYCOMPRINT TELLEDITORCOMS) (RPAQQ TELLEDITORCOMS ((VARS (QP.AT.TOP.LEVEL NIL) (QP.TERM.READING.MODE NIL) (QP.FIND.DEFINITION.SOURCE.FILES NIL)) (ADDVARS (GLOBALVARS QP.AT.TOP.LEVEL) (GLOBALVARS QP.TERM.READING.MODE) (GLOBALVARS QP.CURRENT.STREAM) (GLOBALVARS QP.FIND.DEFINITION.SOURCE.FILES)) (MACROS QP.CLEAR.FD.BUFFER QP.FD.FILE) (FNS QP.FILTER.MODE.LINE QP.LIBRARY QP.LIBRARY.PART.TWO QP.MAKE.TAB.STRING QP.NOT.SAFE.TO.LOAD.CODE QP.SEND.END.OF.FILE QP.SEND.PROLOG QP.TELL.EMACS QP.UPDATE.MODELINE))) (RPAQQ QP.AT.TOP.LEVEL NIL) (RPAQQ QP.TERM.READING.MODE NIL) (RPAQQ QP.FIND.DEFINITION.SOURCE.FILES NIL) (ADDTOVAR GLOBALVARS QP.AT.TOP.LEVEL) (ADDTOVAR GLOBALVARS QP.TERM.READING.MODE) (ADDTOVAR GLOBALVARS QP.CURRENT.STREAM) (ADDTOVAR GLOBALVARS QP.FIND.DEFINITION.SOURCE.FILES) (DECLARE: EVAL@COMPILE (PUTPROPS QP.CLEAR.FD.BUFFER MACRO (**MACROARG** (LET NIL (BQUOTE (PROGN (SETQ QP.FIND.DEFINITION.SOURCE.FILES NIL) ))))) (PUTPROPS QP.FD.FILE MACRO (**MACROARG** (LET ((DATA (CAR (NTH **MACROARG** 1)))) (BQUOTE (PROGN (SETQ QP.FIND.DEFINITION.SOURCE.FILES (APPEND QP.FIND.DEFINITION.SOURCE.FILES (LIST (\, DATA))))))))) ) (DEFINEQ (QP.FILTER.MODE.LINE (LAMBDA (INPUT) (LET ((ANS "") (ELEMENT NIL)) (if (LISTP INPUT) then (if (EQUAL (CADR INPUT) (QUOTE tab)) then (SETQ ANS (CONCAT ANS (QP.MAKE.TAB.STRING (CADDR INPUT)))) else (for ELEMENT in INPUT do (if (LISTP ELEMENT) then (SETQ ANS (CONCAT ANS (QP.MAKE.TAB.STRING (CADDR ELEMENT)))) else (SETQ ANS (CONCAT ANS ELEMENT))))) else (SETQ ANS (CONCAT ANS INPUT))) ANS))) (QP.LIBRARY (LAMBDA (STREAM) (if (QP.NOT.SAFE.TO.LOAD.CODE) then (TEDIT.PROMPTPRINT STREAM (CONCAT "cannot use the library facility " "unless Prolog is at top level prompt") T) else (SETQ QP.CURRENT.STREAM STREAM) (QP.SEND.PROLOG (CONCAT "find←library←package('" (TEDIT.GETINPUT (TEXTOBJ STREAM) "Library file: ") "')"))))) (QP.LIBRARY.PART.TWO (LAMBDA (FILENAME) (if (EQUAL FILENAME (QUOTE cannot% find% library% file,% check% facts% for% library←directory/1')) then (TEDIT.PROMPTPRINT QP.CURRENT.STREAM FILENAME T) else (LET ((WORKING.STREAM (GETPROP (FULLNAME FILENAME (QUOTE OLD)) (QUOTE STREAM)))) (if (NOT WORKING.STREAM) then (QUINTUS.TEDIT FILENAME) (SETQ WORKING.STREAM QP.CURRENT.TEXTSTREAM) (PUTPROP (FULLNAME FILENAME (QUOTE OLD)) (QUOTE STREAM) WORKING.STREAM) else (PROMPTPRINT (CONCAT " Revisiting: " FILENAME))) (TEDIT.NORMALIZECARET (TEXTOBJ WORKING.STREAM) (TEDIT.SETSEL WORKING.STREAM 1 1 (QUOTE LEFT))))))) (QP.MAKE.TAB.STRING (LAMBDA (N) (LET ((ANS "")) (for I from 1 to N do (SETQ ANS (CONCAT ANS " "))) ANS))) (QP.NOT.SAFE.TO.LOAD.CODE (LAMBDA NIL (if (AND QP.PROLOG.STREAM.HANDLE (TEXEC.EOTP (TEXTOBJ QP.PROLOG.STREAM.HANDLE))) then (LET ((MARK (\TEXTGETFILEPTR QP.PROLOG.STREAM.HANDLE)) (CHAR (\BACKBIN QP.PROLOG.STREAM.HANDLE)) (FLAG NIL)) (WHILE (OR (EQ CHAR (CHARCODE TAB)) (EQ CHAR (CHARCODE SP)) (EQ CHAR (CHARCODE EOL))) DO (SETQ CHAR (\BACKBIN QP.PROLOG.STREAM.HANDLE))) (if (EQ CHAR (CHARCODE -)) then (SETQ CHAR (\BACKBIN QP.PROLOG.STREAM.HANDLE)) (if (EQ CHAR (CHARCODE ?)) then (SETQ FLAG T))) (\SETUPGETCH MARK (TEXTOBJ QP.PROLOG.STREAM.HANDLE)) (\BIN QP.PROLOG.STREAM.HANDLE) (NOT FLAG)) else T))) (QP.SEND.END.OF.FILE (LAMBDA NIL (LET ((PROC (FIND.PROCESS QP.PROLOG.NAME))) (if PROC then (PROCESS.EVAL PROC (QUOTE (RETFROM (QUOTE READCCODE) 4))) (TTY.PROCESS PROC))))) (QP.SEND.PROLOG (LAMBDA (INPUT.STRING) (LET ((PROC (FIND.PROCESS QP.PROLOG.NAME))) (COND (PROC (SETQ QP.BUFFERED.HIDDEN.INPUT (CHCON (CONCAT INPUT.STRING "." (CHARACTER (CHARCODE EOL))))) (PROCESS.EVAL PROC (QUOTE (RETFROM (QUOTE READCCODE) 29))) (TTY.PROCESS PROC)) (T (TEDIT.PROMPTPRINT (EVAL (CADR (PROCESSPROP (THIS.PROCESS) (QUOTE FORM)))) "Prolog is not currently running" T)))))) (QP.TELL.EMACS (LAMBDA (MESSAGE DATA) (SELECTQ MESSAGE (top←level (SETQ QP.AT.TOP.LEVEL T)) (term←reading←mode (SETQ QP.TERM.READING.MODE T)) (done←loading (TEDIT.PROMPTPRINT QP.PROLOG.STREAM.HANDLE "done" T)) (update←modeline (QP.UPDATE.MODELINE DATA)) (clear←fd←buffer (QP.CLEAR.FD.BUFFER)) (fd←file (QP.FD.FILE DATA)) (find←definition (QP.FIND.DEFINITION.PART.TWO DATA)) (library (QP.LIBRARY.PART.TWO DATA)) (ERROR "TELL.EMACS message not defined" MESSAGE)))) (QP.UPDATE.MODELINE (LAMBDA (STRING.LIST) (LET ((MODELINE.STRING (CONCAT " Xerox Quintus Prolog" (QP.FILTER.MODE.LINE (CAR STRING.LIST)) (QP.FILTER.MODE.LINE (CADR STRING.LIST)) (QP.FILTER.MODE.LINE (CADDR STRING.LIST))))) (WINDOWPROP QP.PROLOG.WINDOW.HANDLE (QUOTE TITLE) MODELINE.STRING)))) ) (PUTPROPS TELLEDITOR.LSP COPYRIGHT ("Quintus Computer Systems, Inc" 1986)) (DECLARE: DONTCOPY (FILEMAP (NIL (1517 6177 (QP.FILTER.MODE.LINE 1527 . 2174) (QP.LIBRARY 2176 . 2606) ( QP.LIBRARY.PART.TWO 2608 . 3421) (QP.MAKE.TAB.STRING 3423 . 3576) (QP.NOT.SAFE.TO.LOAD.CODE 3578 . 4424) (QP.SEND.END.OF.FILE 4426 . 4672) (QP.SEND.PROLOG 4674 . 5204) (QP.TELL.EMACS 5206 . 5782) ( QP.UPDATE.MODELINE 5784 . 6175))))) STOP