|
From: | Yi DAI |
Subject: | Re: [Chicken-users] Procedures in the `read' series shadowed by GNU readline |
Date: | Tue, 26 Oct 2010 19:17:53 +0200 |
Hi
You can use a dirty trick: in your .csirc, save your default stdin
On Mon, 25 Oct 2010 21:46:28 +0200 Yi DAI <address@hidden> wrote:
> I just found that procedures in the `read' series, like `read', `read-line',
> etc do not work in the interactive repl if I make use of the GNU readline egg.
> When I try to `(read)', it does not wait for my input any more instead directly
> jump to a new prompt as if I enter nothing. Below is my .csirc
>
> (use readline regex datatype matchable)
>
> (current-input-port (make-gnu-readline-port))
>
> (gnu-history-install-file-manager
> (string-append (or (getenv "HOME") ".") "/.csi.history"))
>
> But if I do not use readline (also comment the last two line of gnu-stuff), it
> works fine. I am currently using 4.6.0 on Archlinux.
before setting it to `(make-gnu-readline-port)'. When you want the old
`(current-input-port)', just parameterize it using the value you saved.
So, your .csirc would be:
(define old-stdin (current-input-port))
(use readline regex datatype matchable)
When you want to use, say, `read' without the readline port, do:
(current-input-port (make-gnu-readline-port))
(gnu-history-install-file-manager
(string-append (or (getenv "HOME") ".") "/.csi.history"))
(parameterize ((current-input-port old-stdin)) (read))
Best wishes.
Mario
--
http://parenteses.org/mario
[Prev in Thread] | Current Thread | [Next in Thread] |