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

* boot-9.scm: Revert changes to this file from Oct 23. It turns

out to interact badly with the Emacs support and the Tcl/Tk
support.  It's not a high enough priority at the moment to be
worth fixing.  I'm leaving the other readline support in, though.
This commit is contained in:
Jim Blandy 1997-10-27 07:07:03 +00:00
parent fdc0361488
commit 483f0ecb10

View file

@ -2438,18 +2438,11 @@
(define before-read-hook '()) (define before-read-hook '())
(define after-read-hook '()) (define after-read-hook '())
;;; The default repl-reader function. We may override this if we've
;;; the readline library.
(define repl-reader
(lambda (prompt)
(display prompt)
(force-output)
(read (current-input-port))))
(define (scm-style-repl) (define (scm-style-repl)
(letrec ( (letrec (
(start-gc-rt #f) (start-gc-rt #f)
(start-rt #f) (start-rt #f)
(repl-report-reset (lambda () #f))
(repl-report-start-timing (lambda () (repl-report-start-timing (lambda ()
(set! start-gc-rt (gc-run-time)) (set! start-gc-rt (gc-run-time))
(set! start-rt (get-internal-run-time)))) (set! start-rt (get-internal-run-time))))
@ -2475,19 +2468,17 @@
((char=? ch #\newline) ((char=? ch #\newline)
(read-char)))))) (read-char))))))
(-read (lambda () (-read (lambda ()
;; It would be nice if we could run this after the (if scm-repl-prompt
;; first prompt was printed, but with readline (begin
;; that's not possible, so we punt. (display (cond ((string? scm-repl-prompt)
scm-repl-prompt)
((thunk? scm-repl-prompt)
(scm-repl-prompt))
(else "> ")))
(force-output)
(repl-report-reset)))
(run-hooks before-read-hook) (run-hooks before-read-hook)
(let ((val (let ((val (read (current-input-port))))
(let ((prompt (cond ((string? scm-repl-prompt)
scm-repl-prompt)
((thunk? scm-repl-prompt)
(scm-repl-prompt))
(scm-repl-prompt "> ")
(else ""))))
(repl-reader prompt))))
;; As described in R4RS, the READ procedure updates the ;; As described in R4RS, the READ procedure updates the
;; port to point to the first characetr past the end of ;; port to point to the first characetr past the end of
;; the external representation of the object. This ;; the external representation of the object. This
@ -2770,17 +2761,6 @@
;; the protected thunk. ;; the protected thunk.
(lambda () (lambda ()
;; If we've got readline, use it to prompt the user. This is a
;; kludge, but we'll fix it soon. At least we only get
;; readline involved when we're actually running the repl.
(if (memq 'readline *features*)
(begin
(set-current-input-port (readline-port))
(set! repl-reader
(lambda (prompt)
(set-readline-prompt! prompt)
(read)))))
(scm-style-repl)) (scm-style-repl))
;; call at exit. ;; call at exit.
@ -2844,15 +2824,6 @@
(if (memq 'regex *features*) (if (memq 'regex *features*)
(define-module (guile) :use-module (ice-9 regex))) (define-module (guile) :use-module (ice-9 regex)))
;;; Load readline code if rreadline primitives are available.
;;;
;;; Ideally, we wouldn't do this until we were sure we were actually
;;; going to enter the repl, but autoloading individual functions is
;;; clumsy at the moment.
(if (memq 'readline *features*)
(define-module (guile) :use-module (ice-9 readline)))
;;; {Check that the interpreter and scheme code match up.} ;;; {Check that the interpreter and scheme code match up.}