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:
parent
fdc0361488
commit
483f0ecb10
1 changed files with 11 additions and 40 deletions
|
@ -2438,18 +2438,11 @@
|
|||
(define before-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)
|
||||
(letrec (
|
||||
(start-gc-rt #f)
|
||||
(start-rt #f)
|
||||
(repl-report-reset (lambda () #f))
|
||||
(repl-report-start-timing (lambda ()
|
||||
(set! start-gc-rt (gc-run-time))
|
||||
(set! start-rt (get-internal-run-time))))
|
||||
|
@ -2475,19 +2468,17 @@
|
|||
((char=? ch #\newline)
|
||||
(read-char))))))
|
||||
(-read (lambda ()
|
||||
;; It would be nice if we could run this after the
|
||||
;; first prompt was printed, but with readline
|
||||
;; that's not possible, so we punt.
|
||||
(run-hooks before-read-hook)
|
||||
(let ((val
|
||||
(let ((prompt (cond ((string? scm-repl-prompt)
|
||||
(if scm-repl-prompt
|
||||
(begin
|
||||
(display (cond ((string? scm-repl-prompt)
|
||||
scm-repl-prompt)
|
||||
((thunk? scm-repl-prompt)
|
||||
(scm-repl-prompt))
|
||||
(scm-repl-prompt "> ")
|
||||
(else ""))))
|
||||
(repl-reader prompt))))
|
||||
|
||||
(else "> ")))
|
||||
(force-output)
|
||||
(repl-report-reset)))
|
||||
(run-hooks before-read-hook)
|
||||
(let ((val (read (current-input-port))))
|
||||
;; As described in R4RS, the READ procedure updates the
|
||||
;; port to point to the first characetr past the end of
|
||||
;; the external representation of the object. This
|
||||
|
@ -2770,17 +2761,6 @@
|
|||
|
||||
;; the protected thunk.
|
||||
(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))
|
||||
|
||||
;; call at exit.
|
||||
|
@ -2844,15 +2824,6 @@
|
|||
(if (memq 'regex *features*)
|
||||
(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.}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue