From: Mike G.
Subject: redefining SBCL prompts
Date: 
Message-ID: <1180552025.891926.37840@p47g2000hsd.googlegroups.com>
Hello,

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.

-M

From: Pillsy
Subject: Re: redefining SBCL prompts
Date: 
Message-ID: <1180555256.549857.31950@h2g2000hsg.googlegroups.com>
On May 30, 3:07 pm, "Mike G." <···············@gmail.com> 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
From: Mike G.
Subject: Re: redefining SBCL prompts
Date: 
Message-ID: <1180558910.955443.193630@m36g2000hse.googlegroups.com>
On May 30, 4:00 pm, Pillsy <·········@gmail.com> wrote:
> On May 30, 3:07 pm, "Mike G." <···············@gmail.com> 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
From: Pillsy
Subject: Re: redefining SBCL prompts
Date: 
Message-ID: <1180561904.654645.309750@m36g2000hse.googlegroups.com>
On May 30, 5:01 pm, "Mike G." <···············@gmail.com> wrote:
[...]
> Thanks again for the information, and if someone
> else knows how to change the DEBUG prompt, I'd would very much
> appreciate it.

You might have more luck asking on the sbcl-help mailing list.

Cheers,
Pillsy
From: Mike G.
Subject: Lisp/TeXmacs (was Re: redefining SBCL prompts)
Date: 
Message-ID: <1180619216.038142.85740@g4g2000hsf.googlegroups.com>
On May 30, 5:51 pm, Pillsy <·········@gmail.com> wrote:
>
> You might have more luck asking on the sbcl-help mailing list.

No need. I figured it out. SB-DEBUG::DEBUG-PROMPT can be
handled similarly to ordinary prompt, except that I had
no luck SETF'ing it to a lambda (even with package locks
turned off). Instead, I needed to unlock the package, and
DEFUN it. Whatever. It works, and now I have SBCL working
in TeXmacs. This will probably make it into the next
version of TeXmacs (supported Lisps are now: Clisp, CMUCL,
SCL, and SBCL).

Now I need to come up with a portable library to use
TeXmacs from Lisp.

If anyone plays with the Lisp/TeXmacs combo and has some
ideas, I'd love to hear them. One can deliver TeXmacs
formatted content as s-expressions already since it
uses Guile as its internal extension language. So the
CL library really just needs to provide a nice way to
transport said content to TeXmacs, and maybe a
pretty-printer would be nice.