diff options
author | Andy Wingo <wingo@pobox.com> | 2010-10-05 19:38:21 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2010-10-05 19:38:21 +0200 |
commit | 62651cb317c40ecb9f8257928f6f745ecb814747 (patch) | |
tree | a7b0b0e6398006e75fa542bf67ce502c9475985f /guile-readline | |
parent | 78e836efffb3c1633c606447f29782e349f47747 (diff) |
guile-readline slight modernization
* guile-readline/Makefile.am: Update to use am/guilec.
* guile-readline/ice-9/readline.scm (activate-readline): Update to use a
lambda*.
Diffstat (limited to 'guile-readline')
-rw-r--r-- | guile-readline/Makefile.am | 18 | ||||
-rw-r--r-- | guile-readline/ice-9/readline.scm | 7 |
2 files changed, 12 insertions, 13 deletions
diff --git a/guile-readline/Makefile.am b/guile-readline/Makefile.am index e749ce84a..f9d51a233 100644 --- a/guile-readline/Makefile.am +++ b/guile-readline/Makefile.am @@ -20,17 +20,18 @@ ## Floor, Boston, MA 02110-1301 USA include $(top_srcdir)/am/snarf +include $(top_srcdir)/am/guilec ## Prevent automake from adding extra -I options DEFS = @DEFS@ @EXTRA_DEFS@ -if HAVE_READLINE +# We're at the root of the module hierarchy. +modpath = +SOURCES = -# `ice-9' subdirectory. -ice9dir = $(pkgdatadir)/$(GUILE_EFFECTIVE_VERSION) -nobase_ice9_DATA = ice-9/readline.scm -EXTRA_DIST = $(nobase_ice9_DATA) +if HAVE_READLINE +SOURCES += ice-9/readline.scm ## Check for headers in $(srcdir)/.., so that #include ## <libguile/MUMBLE.h> will find MUMBLE.h in this dir when we're @@ -58,17 +59,16 @@ modincludedir = $(pkgincludedir)/$(GUILE_EFFECTIVE_VERSION) modinclude_HEADERS = readline.h snarfcppopts = $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) -SUFFIXES = .x +SUFFIXES += .x .c.x: $(AM_V_SNARF)$(GUILE_SNARF) -o $@ $< $(snarfcppopts) EXTRA_DIST += LIBGUILEREADLINE-VERSION ChangeLog-2008 -ETAGS_ARGS = \ - $(nobase_ice9_DATA) \ +ETAGS_ARGS += \ $(libguilereadline_v_@LIBGUILEREADLINE_MAJOR@_la_SOURCES) -CLEANFILES = *.x +CLEANFILES += *.x endif HAVE_READLINE diff --git a/guile-readline/ice-9/readline.scm b/guile-readline/ice-9/readline.scm index b7aee9149..38fb23fc7 100644 --- a/guile-readline/ice-9/readline.scm +++ b/guile-readline/ice-9/readline.scm @@ -205,7 +205,8 @@ (let ((repl-read-hook (lambda () (run-hook before-read-hook)))) (set-current-input-port (readline-port)) (set! repl-reader - (lambda (repl-prompt . reader) + (lambda* (repl-prompt + #:optional (reader (fluid-ref current-reader))) (let ((outer-new-input-prompt new-input-prompt) (outer-continuation-prompt continuation-prompt) (outer-read-hook read-hook)) @@ -214,9 +215,7 @@ (set-buffered-input-continuation?! (readline-port) #f) (set-readline-prompt! repl-prompt "... ") (set-readline-read-hook! repl-read-hook)) - (lambda () ((or (and (pair? reader) (car reader)) - (fluid-ref current-reader) - read))) + (lambda () ((or reader read) (current-input-port))) (lambda () (set-readline-prompt! outer-new-input-prompt outer-continuation-prompt) (set-readline-read-hook! outer-read-hook)))))) |