(FILECREATED " 8-Feb-86 16:08:23" {DSK}<LISPFILES2>IMPROVEDDCOMS>TEXECFIXES.;1 7521 changes to: (MACROS \RAISECHAR \LINEBUFBOUT) (VARS TEXECFIXESCOMS RATOM/RSTRING.FT READ.FT READC.FT) (FNS TEXEC.FILLBUFFER.FIX)) (* Copyright (c) 1986 by Quintus Computer Systems, Inc. All rights reserved.) (PRETTYCOMPRINT TEXECFIXESCOMS) (RPAQQ TEXECFIXESCOMS ((SCCS) (FNS TEXEC.FILLBUFFER.FIX) (INITRECORDS TEDITCARET) (CONSTANTS RATOM/RSTRING.FT READ.FT READC.FT) (MACROS \RAISECHAR \LINEBUFBOUT) (P (MOVD (QUOTE TEXEC.FILLBUFFER.FIX) (QUOTE TEXEC.FILLBUFFER)) (UNMARKASCHANGED (QUOTE TEXEC.FILLBUFFER) (QUOTE FNS)) ))) (* %%G% %%W% ) (DEFINEQ (TEXEC.FILLBUFFER.FIX (LAMBDA (FILLTYPE) (* edited: "17-Nov-85 16:37") (* While filling the line, the current file pointer is the end of the line. When the line is closed, this is made the eof. - #CURRENTRDTBL# is used for syntactic delimiters and paren counting on READ and RATOM calls but isn't referenced (or bound) for READC) (DECLARE (USEDFREE #CURRENTRDTBL# \PRIMTERMTABLE FLG \TERM.OFD) (SPECVARS RSNX TCLASS RTBLSA RAISEDCHAR FILLTYPE RAISEDCHAR PEEKEDECHOED C)) (\RESETLINE) (* * If ERROR or RESET, move STARTINGEOF to end of text (TEXTLEN)) (RESETLST (RESETSAVE NIL (LIST (FUNCTION (LAMBDA NIL (COND (RESETSTATE (* Point to end of text and clearout linebuffer on RESET or ERROR) (PROG* ((TEXOBJ (fetch (TEXTSTREAM TEXTOBJ) of \TERM.OFD)) (SEL (fetch SEL of TEXOBJ))) (TEXTPROP TEXOBJ (QUOTE STARTINGEOF) (fetch TEXTLEN of TEXOBJ)) (replace (STREAM REVALIDATEFLG) of \LINEBUF.OFD) (\RESETTERMINAL) (\SHOWSEL SEL) ( replace CH# of SEL with (ADD1 (fetch TEXTLEN of TEXOBJ))) (replace CHLIM of SEL with (ADD1 (fetch TEXTLEN of TEXOBJ))) (replace POINT of SEL with (QUOTE LEFT)) (replace DCH of SEL with 0) (replace SET of SEL with T) (\FIXSEL SEL TEXOBJ)))))))) (PROG* ((RTBLSA (AND (NEQ FILLTYPE READC.FT) (fetch READSA of #CURRENTRDTBL#))) (CONTROLTON (fetch CONTROLFLG of \PRIMTERMTABLE)) (TEXOBJ (fetch (TEXTSTREAM TEXTOBJ) of \TERM.OFD)) (SEL (fetch SEL of TEXOBJ)) (WINDOW (fetch \WINDOW of TEXOBJ)) (LINES (fetch LINES of TEXOBJ)) RSNX TCLASS C RAISEDCHAR PEEKEDECHOED TTYWINDOW FN TCH INSCH# CHNO ADDEDEOL) (* * STARTINGEOF is the beginning of the current text being entered which gets returned to READ so that \TEXEC.TEXTBOUT knows where to output any text including ↑T) (* * TCLASS is terminal syntax class, RSNX is read-table code) (TEXTPROP TEXOBJ (QUOTE STARTINGEOF) (fetch TEXTLEN of TEXOBJ)) (* Keep STARTINGEOF in sync) (COND ((SETQ C (fetch (LINEBUFFER PEEKEDCHAR) of \LINEBUF.OFD)) (* Account for peeked character) (SETQ C (IABS C)) (* The peeked char may be negative because it was BIN'ed earlier. Make sure it is positive.) (replace (LINEBUFFER PEEKEDCHAR) of \LINEBUF.OFD with NIL) (SETQ PEEKEDECHOED T) (SETQ RAISEDCHAR (\RAISECHAR C)) (COND ((EQ FILLTYPE READ.FT) (TEXTPROP TEXOBJ (QUOTE STARTINGEOF) (SUB1 (TEXTPROP TEXOBJ (QUOTE STARTINGEOF)))))) (* Backup one in textstream to start the input before the peeked and echoed character if doing a READ))) (COND ((AND CONTROLTON (EQ FILLTYPE READC.FT)) (TEXEC.INSERTCHAR TEXOBJ C) (* Read single char and check for echoing) (GO EXIT))) (* If in CONTROL T mode and reading a single char) (COND (C (GO NEXTTCLASS))) NEXT (SETQ C (TEXEC.GETKEY TEXOBJ)) (* read next character from keyboard) NEXTTCLASS (SETQ TCLASS (fetch TERMCLASS of (\SYNCODE \PRIMTERMSA (SETQ RAISEDCHAR (\RAISECHAR C))))) REDO (* (while (OR TEDIT.SELPENDING (fetch EDITOPACTIVE of TEXOBJ)) do (* Don't do anything while he's selecting or one of the lock-out ops is active.) (BLOCK))) (* (replace EDITOPACTIVE of TEXOBJ with T)) (TEXEC.FILLBUFFER.CHSELPENDING TEXOBJ) (* Check for SHIFT/COPY/MOVE active) (* * Handle Terminal Class characters) (SELECTQ ( TEXEC.FILLBUFFER.TCLASS TEXOBJ SEL) (NEXT (GO NEXT)) (EXIT (GO EXIT)) NIL) (* * Here if it isn't a terminal class.) (COND (PEEKEDECHOED (SETQ PEEKEDECHOED NIL)) (T (TEXEC.INSERTCHAR TEXOBJ C))) (AND ( EQ FILLTYPE READC.FT) (GO NEXT)) (COND ((EQ ESCAPE.RC (SETQ RSNX (\SYNCODE RTBLSA RAISEDCHAR))) (COND ((EQ CTRLV.TC (SETQ TCLASS (fetch TERMCLASS of (\SYNCODE \PRIMTERMSA (SETQ RAISEDCHAR ( TEXEC.INSERTCHAR TEXOBJ)))))) (GO REDO))) (GO NEXT))) (SELECTC FILLTYPE (RATOM/RSTRING.FT (COND ((AND CONTROLTON (fetch STOPATOM of RSNX)) (GO EXIT)))) (READ.FT (SELECTC RSNX ((LIST RIGHTPAREN.RC RIGHTBRACKET.RC) (TEXEC.FLASHCARET TEXOBJ (TEXEC.PARENMATCH TEXOBJ RSNX))) NIL) (COND ((AND CONTROLTON (ZEROP (fetch (LINEBUFFER LBRKCOUNT) of \LINEBUF.OFD)) (ZEROP (fetch (LINEBUFFER LPARCOUNT) of \LINEBUF.OFD)) (fetch STOPATOM of RSNX) (SELECTC RSNX ((LIST LEFTPAREN.RC LEFTBRACKET.RC RIGHTBRACKET.RC RIGHTPAREN.RC) NIL) (STRINGDELIM.RC (COND ((fetch (LINEBUFFER INSTRINGP) of \LINEBUF.OFD) (replace (LINEBUFFER INSTRINGP) of \LINEBUF.OFD with NIL) T))) (NOT (fetch (LINEBUFFER INSTRINGP) of \LINEBUF.OFD)))) (* READ is reading an atom. Return when atom ends, but also obey bracket/paren exception noted on page 14.33 of manual.) (GO EXIT))) (COND ((TEXEC.EOTP TEXOBJ) (COND ( (fetch (STREAM REVALIDATEFLG) of \LINEBUF.OFD) (TEXEC.PARENCOUNT TEXOBJ) (* text needs recount of parens/brackets))) (COND ((\INCPARENCOUNT RSNX) (* Parens balance--throw the carriage if the closing paren or bracket character was not a CR, and if FLG argument of READ is NIL. (We know we are under a READ call because of FILLTYPE)) (* copy the chars from the textstream into the linebuffer) ( TEXEC.TEXTSTREAM.TO.LINEBUF TEXOBJ (TEXTPROP TEXOBJ (QUOTE STARTINGEOF)) \LINEBUF.OFD FILLTYPE) (AND ( EQ FILLTYPE READ.FT) (TEXEC.FIX? TEXOBJ \LINEBUF.OFD) (GO NEXT)) (* If it was a PA FIX command handle it, and allow editing) (* now reset the new STARTINGEOF to start at the end of the text) (TEXTPROP TEXOBJ (QUOTE STARTINGEOF) (fetch TEXTLEN of TEXOBJ)) (\CLOSELINE) (AND (NEQ RAISEDCHAR (CHARCODE EOL) ) (NOT FLG) (\OUTCHAR \TERM.OFD (CHARCODE EOL))) (* \CLOSELINE first so dribble happens before EOL) ( RETURN)) ((EQ IMMEDIATE.RMW (fetch WAKEUP of RSNX)) (* Immediate read-macro) (RETURN)))))) (SHOULDNT)) (GO NEXT) EXIT (COND ((AND (EQ FILLTYPE READ.FT) (EQ RAISEDCHAR (CHARCODE EOL)) (EQ (SUB1 (fetch TEXTLEN of TEXOBJ)) (TEXTPROP TEXOBJ (QUOTE STARTINGEOF)))) (\LINEBUFBOUT \LINEBUF.OFD (CAR (GETSYNTAX (QUOTE RIGHTBRACKET) #CURRENTRDTBL#))) (* If doing a READ, force a lone CR to terminate the READ by handing back a RIGHTBRACKET into the LINEBUFFER)) (T (TEXEC.TEXTSTREAM.TO.LINEBUF TEXOBJ (TEXTPROP TEXOBJ (QUOTE STARTINGEOF)) \LINEBUF.OFD FILLTYPE))) (TEXTPROP TEXOBJ (QUOTE STARTINGEOF) (fetch TEXTLEN of TEXOBJ)) (AND (EQ FILLTYPE READ.FT) (TEXEC.FIX? TEXOBJ \LINEBUF.OFD) (GO NEXT)) (* If it was a PA FIX command handle it, and allow editing) (\CLOSELINE) (AND (NEQ RAISEDCHAR (CHARCODE EOL)) ( NOT CONTROLTON) (NOT FLG) (\OUTCHAR \TERM.OFD (CHARCODE EOL))))))) ) (DECLARE: EVAL@COMPILE (RPAQQ RATOM/RSTRING.FT 1) (RPAQQ READ.FT 0) (RPAQQ READC.FT 2) (CONSTANTS RATOM/RSTRING.FT READ.FT READC.FT) ) (DECLARE: EVAL@COMPILE (PUTPROPS \RAISECHAR MACRO (OPENLAMBDA (C) (COND ((AND (fetch RAISEFLG of \PRIMTERMTABLE) (IGEQ C ( CHARCODE a)) (ILEQ C (CHARCODE z))) (IDIFFERENCE C 32)) (T C)))) (PUTPROPS \LINEBUFBOUT MACRO (OPENLAMBDA (STRM CHAR) (\BOUT STRM (\CHARSET CHAR)) (\BOUT STRM ( \CHAR8CODE CHAR)))) ) (MOVD (QUOTE TEXEC.FILLBUFFER.FIX) (QUOTE TEXEC.FILLBUFFER)) (UNMARKASCHANGED (QUOTE TEXEC.FILLBUFFER) (QUOTE FNS)) (PUTPROPS TEXECFIXES COPYRIGHT ("Quintus Computer Systems, Inc" 1986)) (DECLARE: DONTCOPY (FILEMAP (NIL (651 6853 (TEXEC.FILLBUFFER.FIX 661 . 6851))))) STOP