guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting the readline prompt ...


From: Neil Jerram
Subject: Re: Setting the readline prompt ...
Date: 08 Jan 2003 21:11:17 +0000
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

>>>>> "Paul" == Paul Jarc <address@hidden> writes:

    Paul> address@hidden wrote:
    >> just a quick question: how can i change the readline
    >> prompt (after readline is activated).
    >> I found (set-readline-prompt! prompt . prompt2) in
    >> 'ice-9 readline'

    Paul> AFAICT, set-readline-prompt! has no visible effect either in .guile or
    Paul> in the REPL.

It's a tricky business, prompting.

You can see the effect of set-readline-prompt! like this:

guile> (begin (set-readline-prompt! "1> " "2> ") (readline))
1> something
"something"
guile> (begin (set-readline-prompt! "1> " "2> ") (read))
2> something
something

The second case uses the secondary (continuation) prompt because the
(read) began by reading the trailing whitespace at the end of the
`(begin ...)' line.

So, in programs, you can use set-readline-prompt! to set whatever
prompt you like before reading some data.  It doesn't appear to work
at the REPL because the REPL itself does a set-readline-prompt! to set
the prompt to whatever was specified by the last set-repl-prompt!.

        Neil





reply via email to

[Prev in Thread] Current Thread [Next in Thread]