mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
,x unbound does not quit repl
* module/system/repl/repl.scm (run-repl): Catch errors executing metacommands. Feature on top of feature...
This commit is contained in:
parent
66ad445dcf
commit
5bc97ad5dd
1 changed files with 13 additions and 3 deletions
|
@ -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 '()))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue