mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-05 06:50:21 +02:00
* boot-9.scm (top-repl): don't flush all ports at exit.
(error-catching-loop): likewise. * boot-9.scm (scm-style-repl): -read: don't call consume-trailing-whitespace if val is eof object. Allows exiting repl with single control-D. * boot-9.scm (error-catching-loop): don't force output within error catching loop after quit received. (top-repl): flush all ports when the repl terminates. * boot-9.scm (error-catching-loop): flush all ports before primitive exit if non-interactive. force-output on current-error-port if interactive. * boot-9.scm (reopen-file): deleted. * popen.scm (open-output-pipe, open-input-pipe): moved from boot-9.scm. * popen.scm: new file.
This commit is contained in:
parent
e6c32806f2
commit
e13c54c40e
1 changed files with 20 additions and 19 deletions
|
@ -723,7 +723,6 @@
|
||||||
(define (getprotoent) (getproto))
|
(define (getprotoent) (getproto))
|
||||||
(define (getpwent) (getpw))
|
(define (getpwent) (getpw))
|
||||||
(define (getservent) (getserv))
|
(define (getservent) (getserv))
|
||||||
(define (reopen-file . args) (apply freopen args))
|
|
||||||
(define (setgrent) (setgr #f))
|
(define (setgrent) (setgr #f))
|
||||||
(define (sethostent) (sethost #t))
|
(define (sethostent) (sethost #t))
|
||||||
(define (setnetent) (setnet #t))
|
(define (setnetent) (setnet #t))
|
||||||
|
@ -808,9 +807,6 @@
|
||||||
(define (file-position . args) (apply ftell args))
|
(define (file-position . args) (apply ftell args))
|
||||||
(define (file-set-position . args) (apply fseek args))
|
(define (file-set-position . args) (apply fseek args))
|
||||||
|
|
||||||
(define (open-input-pipe command) (open-pipe command OPEN_READ))
|
|
||||||
(define (open-output-pipe command) (open-pipe command OPEN_WRITE))
|
|
||||||
|
|
||||||
(define (move->fdes fd/port fd)
|
(define (move->fdes fd/port fd)
|
||||||
(cond ((integer? fd/port)
|
(cond ((integer? fd/port)
|
||||||
(dup->fdes fd/port fd)
|
(dup->fdes fd/port fd)
|
||||||
|
@ -2570,7 +2566,6 @@
|
||||||
(lambda (key . args)
|
(lambda (key . args)
|
||||||
(case key
|
(case key
|
||||||
((quit)
|
((quit)
|
||||||
(force-output)
|
|
||||||
(set! status args)
|
(set! status args)
|
||||||
#f)
|
#f)
|
||||||
|
|
||||||
|
@ -2583,22 +2578,26 @@
|
||||||
;;
|
;;
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(run-hook abort-hook)
|
(run-hook abort-hook)
|
||||||
(force-output)
|
(force-output (current-output-port))
|
||||||
(display "ABORT: " (current-error-port))
|
(display "ABORT: " (current-error-port))
|
||||||
(write args (current-error-port))
|
(write args (current-error-port))
|
||||||
(newline (current-error-port))
|
(newline (current-error-port))
|
||||||
(if interactive
|
(if interactive
|
||||||
(if (and (not has-shown-debugger-hint?)
|
(begin
|
||||||
(not (memq 'backtrace
|
(if (and
|
||||||
(debug-options-interface)))
|
(not has-shown-debugger-hint?)
|
||||||
(stack? (fluid-ref the-last-stack)))
|
(not (memq 'backtrace
|
||||||
(begin
|
(debug-options-interface)))
|
||||||
(newline (current-error-port))
|
(stack? (fluid-ref the-last-stack)))
|
||||||
(display
|
(begin
|
||||||
"Type \"(backtrace)\" to get more information.\n"
|
(newline (current-error-port))
|
||||||
(current-error-port))
|
(display
|
||||||
(set! has-shown-debugger-hint? #t)))
|
"Type \"(backtrace)\" to get more information.\n"
|
||||||
(primitive-exit 1))
|
(current-error-port))
|
||||||
|
(set! has-shown-debugger-hint? #t)))
|
||||||
|
(force-output (current-error-port)))
|
||||||
|
(begin
|
||||||
|
(primitive-exit 1)))
|
||||||
(set! stack-saved? #f)))
|
(set! stack-saved? #f)))
|
||||||
|
|
||||||
(else
|
(else
|
||||||
|
@ -2739,7 +2738,7 @@
|
||||||
(repl-reader prompt))))
|
(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 character past the end of
|
||||||
;; the external representation of the object. This
|
;; the external representation of the object. This
|
||||||
;; means that it doesn't consume the newline typically
|
;; means that it doesn't consume the newline typically
|
||||||
;; found after an expression. This means that, when
|
;; found after an expression. This means that, when
|
||||||
|
@ -2748,7 +2747,9 @@
|
||||||
;; breakpoints kind of useless. So, consume any
|
;; breakpoints kind of useless. So, consume any
|
||||||
;; trailing newline here, as well as any whitespace
|
;; trailing newline here, as well as any whitespace
|
||||||
;; before it.
|
;; before it.
|
||||||
(consume-trailing-whitespace)
|
;; But not if EOF, for control-D.
|
||||||
|
(if (not (eof-object? val))
|
||||||
|
(consume-trailing-whitespace))
|
||||||
(run-hook after-read-hook)
|
(run-hook after-read-hook)
|
||||||
(if (eof-object? val)
|
(if (eof-object? val)
|
||||||
(begin
|
(begin
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue