1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-29 19:30:36 +02:00

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*.
This commit is contained in:
Andy Wingo 2010-10-05 19:38:21 +02:00
parent 78e836efff
commit 62651cb317
2 changed files with 12 additions and 13 deletions

View file

@ -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@
# We're at the root of the module hierarchy.
modpath =
SOURCES =
if HAVE_READLINE
# `ice-9' subdirectory.
ice9dir = $(pkgdatadir)/$(GUILE_EFFECTIVE_VERSION)
nobase_ice9_DATA = ice-9/readline.scm
EXTRA_DIST = $(nobase_ice9_DATA)
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

View file

@ -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))))))