Re: redefining SBCL prompts



On May 30, 4:00 pm, Pillsy <pillsb...@xxxxxxxxx> wrote:
On May 30, 3:07 pm, "Mike G." <michael.graf...@xxxxxxxxx> wrote:

Can someone please post a few lines to show me the proper way to
redefine the REPL and DEBUG prompts in SBCL? Static strings are fine
for my use. Thank you.

You can redefine the REPL prompt by setting the variable SB-INT:*REPL-
PROMPT-FUNCTION* (provided you're using SBCL directly, instead of
SLIME or something, which evidently does its own prompt handling). You
want to set it to a function of a stream variable that will send the
desired prompt string to that stream. For example:

(setf sb-int:*repl-prompt-function*
(lambda (stream)
(format stream "~&Foo> ")))

I don't know how to change the debug prompt, though.

Cheers,
Pillsy


Thanks, thats a step in the right direction! This was fairly straight-
forward
for me to do on CMUCL and Clisp. Thanks again for the information, and
if someone
else knows how to change the DEBUG prompt, I'd would very much
appreciate it.

Both changes are vital, as I'm interfacing SBCL to TeXmacs (a WYSIWYG
TeX editor).
This enables SBCL output to appear directly in TeXmacs, SBCL code can
generate
graphical depictions of trees, graphs, pretty-print matrices and so
on.

TeXmacs requires that coding be placed into the communication stream
so that
it knows when the slave program (SBCL in this case) is expecting
input.

-M

.



Relevant Pages

  • Re: Starting up Slime
    ... That IS a typical sbcl (and several other lisps) debug prompt though. ... slime normally takes over the debugger once loaded, ...
    (comp.lang.lisp)
  • redefining SBCL prompts
    ... redefine the REPL and DEBUG prompts in SBCL? ... Static strings are fine ...
    (comp.lang.lisp)