diff options
-rw-r--r-- | src/ChangeLog | 9 | ||||
-rw-r--r-- | src/interp/ht-util.boot | 3 | ||||
-rw-r--r-- | src/interp/i-util.boot | 6 | ||||
-rw-r--r-- | src/interp/int-top.boot | 8 | ||||
-rw-r--r-- | src/interp/metalex.lisp | 2 | ||||
-rw-r--r-- | src/interp/server.boot | 11 |
6 files changed, 25 insertions, 14 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index d0cfc83e..23586d9f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,14 @@ 2008-10-07 Gabriel Dos Reis <gdr@cs.tamu.edu> + * interp/i-util.boot (printPrompt): New. + * interp/ht-util.boot (executeInterpreterCommand): Use it. + * interp/int-top.boot (SpadInterpretStream): Likewise. + * interp/metalex.lisp (get-a-line): Likewise. + * interp/server.boot (serverReadLine): Likewise. + (serverLoop): Likewise. + +2008-10-07 Gabriel Dos Reis <gdr@cs.tamu.edu> + * algebra/Makefile.pamphlet (axiom_algebra_layer_user): Include RGBCMDL, RGBCSPC. * algebra/color.spad.pamphlet (RGBColorModel): New. diff --git a/src/interp/ht-util.boot b/src/interp/ht-util.boot index fe18f0e5..21d78e58 100644 --- a/src/interp/ht-util.boot +++ b/src/interp/ht-util.boot @@ -474,8 +474,7 @@ executeInterpreterCommand command == TERPRI() ncSetCurrentLine(command) CATCH($SpadReaderTag, parseAndInterpret command) - PRINC MKPROMPT() - FINISH_-OUTPUT() + printPrompt "andFlush" typeCheckInputAreas htPage == -- This needs to be severly beefed up diff --git a/src/interp/i-util.boot b/src/interp/i-util.boot index 5fe07fb2..dac2c3d8 100644 --- a/src/interp/i-util.boot +++ b/src/interp/i-util.boot @@ -78,6 +78,12 @@ MKPROMPT() == '" [", SUBSTRING(CURRENTTIME(),8,NIL),'"] [", STRINGIMAGE $IOindex, '"] -> ") + +printPrompt(flush? == false) == + PRINC(MKPROMPT(), $OutputStream) + if flush? then + FORCE_-OUTPUT $OutputStream + --% Miscellaneous Zeros n == diff --git a/src/interp/int-top.boot b/src/interp/int-top.boot index 9e5b1063..17c08196 100644 --- a/src/interp/int-top.boot +++ b/src/interp/int-top.boot @@ -134,7 +134,7 @@ SpadInterpretStream(str, source, interactive?) == $promptMsg : local := 'S2CTP023 interactive? => - PRINC(MKPROMPT()) + printPrompt() intloopReadConsole('"", str) [] intloopInclude (source,0) @@ -146,19 +146,19 @@ intloopReadConsole(b, n)== a:= serverReadLine $InputStream not STRINGP a => leaveScratchpad() #a=0 => - PRINC(MKPROMPT()) + printPrompt() intloopReadConsole('"", n) pfx := stripSpaces intloopPrefix?('")fi",a) pfx and ((pfx = '")fi") or (pfx = '")fin")) => [] b = '"" and (d := intloopPrefix?('")", a)) => setCurrentLine d c := ncloopCommand(d,n) - PRINC(MKPROMPT()) + printPrompt() intloopReadConsole('"", c) a:=CONCAT(b,a) ncloopEscaped a => intloopReadConsole(SUBSEQ(a, 0, (LENGTH a) - 1),n) c := intloopProcessString(a, n) - PRINC(MKPROMPT()) + printPrompt() intloopReadConsole('"", c) intloopPrefix?(prefix,whole) == diff --git a/src/interp/metalex.lisp b/src/interp/metalex.lisp index 65563cd7..8583158a 100644 --- a/src/interp/metalex.lisp +++ b/src/interp/metalex.lisp @@ -179,7 +179,7 @@ :adjustable t :initial-contents s)))) (defun get-a-line (stream) - (if (IS-CONSOLE stream) (princ (MKPROMPT))) + (if (IS-CONSOLE stream) (|printPrompt|)) (let ((ll (read-a-line stream))) (if (stringp ll) (make-string-adjustable ll) ll))) diff --git a/src/interp/server.boot b/src/interp/server.boot index 57a706a3..6e0ee514 100644 --- a/src/interp/server.boot +++ b/src/interp/server.boot @@ -90,8 +90,7 @@ serverReadLine(stream) == stringBuf := sockGetString $MenuServer CATCH('coerceFailure,CATCH($intTopLevel, CATCH($SpadReaderTag, parseAndInterpret stringBuf))) - PRINC MKPROMPT() - FINISH_-OUTPUT() + printPrompt "andFlush" action = $NonSmanSession => $SpadServer := nil action = $KillLispSystem => @@ -122,14 +121,13 @@ serverLoop() == IN_-STREAM: fluid := $InputStream _*EOF_*: fluid := NIL while not $EndServerSession and not _*EOF_* repeat - if $Prompt then (PRINC MKPROMPT(); FINISH_-OUTPUT()) + if $Prompt then printPrompt "andFlush" $Prompt := NIL action := serverSwitch() action = $CallInterp => CATCH('coerceFailure,CATCH($intTopLevel, CATCH($SpadReaderTag, parseAndInterpret read_-line($InputStream) ))) - PRINC MKPROMPT() - FINISH_-OUTPUT() + printPrompt "andFlush" sockSendInt($SessionManager, $EndOfOutput) action = $CreateFrame => frameName := GENSYM('"frame") @@ -155,8 +153,7 @@ serverLoop() == stringBuf := sockGetString $MenuServer CATCH('coerceFailure,CATCH($intTopLevel, CATCH($SpadReaderTag, parseAndInterpret stringBuf))) - PRINC MKPROMPT() - FINISH_-OUTPUT() + printPrompt "andFlush" sockSendInt($SessionManager, $EndOfOutput) NIL if _*EOF_* then $Prompt := true |