Added a silly fatal-error-handler for EVAL-COMMAND-IN-SCHEME-MODE.

This commit is contained in:
eknauel 2005-08-10 19:46:13 +00:00
parent b46ff51a1c
commit ffff7d3a60
1 changed files with 38 additions and 19 deletions

View File

@ -200,7 +200,26 @@
(refresh-command-window)
(release-lock paint-lock)))
(define (display-error-and-continue condition more)
(let ((win (app-window-curses-win (result-window))))
(wclear win)
(wattron win (A-BOLD))
(mvwaddstr win 0 0
(string-append "I'm sorry " (user-login-name) ", "
"I'm afraid I can't do that. "
"The following error occured:"))
(wattrset win (A-NORMAL))
(let ((string-port (open-output-string)))
(display condition string-port)
(display " " string-port)
(display more)
(mvwaddstr win 5 0 (get-output-string string-port)))
(refresh-result-window)))
(define (eval-command-in-scheme-mode command-line)
(with-fatal-error-handler*
display-error-and-continue
(lambda ()
(let ((viewer
(find/init-plugin-for-result
(eval-string command-line))))
@ -217,9 +236,9 @@
(refresh-result-window)
(move-cursor (command-buffer) (result-buffer))
(refresh-command-window)
(release-lock paint-lock))))
(release-lock paint-lock))))))
;; #### crufty
;; #### crufty, and a very dumb idea
(define split-command-line string-tokenize)
(define (paste-selection/refresh viewer)