diff options
author | Andy Wingo <wingo@pobox.com> | 2010-08-06 17:28:10 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2010-08-06 17:28:10 +0200 |
commit | 5bc97ad5dd7baa1d9f19571fed0fe6a339ed0688 (patch) | |
tree | 831cf35eba2be809b96ac1897bc484af80f7e31a | |
parent | 66ad445dcfaa712a0f0b3f7d23c49b90165e1eaf (diff) | |
download | guile-5bc97ad5dd7baa1d9f19571fed0fe6a339ed0688.tar.gz |
,x unbound does not quit repl
* module/system/repl/repl.scm (run-repl): Catch errors executing
metacommands. Feature on top of feature...
-rw-r--r-- | module/system/repl/repl.scm | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/module/system/repl/repl.scm b/module/system/repl/repl.scm index 21998ba5d..9e364ddc5 100644 --- a/module/system/repl/repl.scm +++ b/module/system/repl/repl.scm @@ -121,10 +121,20 @@ (cond ((eqv? exp *unspecified*)) ; read error, pass ((eq? exp meta-command-token) - (catch 'quit - (lambda () (meta-command repl)) + (catch #t + (lambda () + (meta-command repl)) (lambda (k . args) - (abort args)))) + (if (eq? k 'quit) + (abort args) + (begin + (format #t "While executing meta-command:~%" string) + (pmatch args + ((,subr ,msg ,args . ,rest) + (display-error #f (current-output-port) subr msg args rest)) + (else + (format #t "ERROR: Throw to key `~a' with args `~s'.\n" key args))) + (force-output)))))) ((eof-object? exp) (newline) (abort '())) |