diff options
author | Andy Wingo <wingo@pobox.com> | 2009-10-16 13:30:52 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2009-10-16 13:30:52 +0200 |
commit | a58b7fbb7eb80bdbc0af9aee86a5ac12b9cfeef3 (patch) | |
tree | d8f5d79fcedf805bcc67c13b5b2bda5b16b6540c /guile-readline | |
parent | 27c8177fe424fcf65a2c1cf3245b13382a2d22d9 (diff) |
repl-reader accepts optional "read" argument
* module/ice-9/boot-9.scm (repl-reader): Accept an optional second
argument, the reader to use. If it is given, use it instead of
dereferencing the current-reader fluid.
* guile-readline/ice-9/readline.scm (activate-readline): Make our
replacement definition of repl-reader compatible with boot-9.
Diffstat (limited to 'guile-readline')
-rw-r--r-- | guile-readline/ice-9/readline.scm | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/guile-readline/ice-9/readline.scm b/guile-readline/ice-9/readline.scm index 4c852eec1..4766e619e 100644 --- a/guile-readline/ice-9/readline.scm +++ b/guile-readline/ice-9/readline.scm @@ -1,6 +1,6 @@ ;;;; readline.scm --- support functions for command-line editing ;;;; -;;;; Copyright (C) 1997, 1999, 2000, 2001, 2002, 2006 Free Software Foundation, Inc. +;;;; Copyright (C) 1997, 1999, 2000, 2001, 2002, 2006, 2009 Free Software Foundation, Inc. ;;;; ;;;; This program is free software; you can redistribute it and/or modify ;;;; it under the terms of the GNU General Public License as published by @@ -208,7 +208,7 @@ (let ((repl-read-hook (lambda () (run-hook before-read-hook)))) (set-current-input-port (readline-port)) (set! repl-reader - (lambda (repl-prompt) + (lambda (repl-prompt . reader) (let ((outer-new-input-prompt new-input-prompt) (outer-continuation-prompt continuation-prompt) (outer-read-hook read-hook)) @@ -217,7 +217,9 @@ (set-buffered-input-continuation?! (readline-port) #f) (set-readline-prompt! repl-prompt "... ") (set-readline-read-hook! repl-read-hook)) - (lambda () ((or (fluid-ref current-reader) read))) + (lambda () ((or (and (pair? reader) (car reader)) + (fluid-ref current-reader) + read))) (lambda () (set-readline-prompt! outer-new-input-prompt outer-continuation-prompt) (set-readline-read-hook! outer-read-hook)))))) |