install an error handler for the execution of commands.

This commit is contained in:
eknauel 2005-08-20 08:14:36 +00:00
parent 837bc881fa
commit 0cade47534
1 changed files with 24 additions and 21 deletions

View File

@ -175,27 +175,30 @@
standard-command-plugin))
(define (eval-command-in-command-mode command-line)
(let* ((tokens (split-command-line command-line))
(command (car tokens))
(args (cdr tokens))
(command-plugin (find-command-plugin command))
(viewer
(find/init-plugin-for-result
(with-errno-handler
((errno data)
(else data))
((command-plugin-evaluater command-plugin) command args))))
(new-entry
(make-history-entry command args viewer)))
;; FIXME, use insert here
(append-to-history! new-entry)
(signal-result-buffer-object-change)
(obtain-lock paint-lock)
(paint-result-window new-entry)
(refresh-result-window)
(move-cursor (command-buffer) (result-buffer))
(refresh-command-window)
(release-lock paint-lock)))
(with-fatal-error-handler*
display-error-and-continue
(lambda ()
(let* ((tokens (split-command-line command-line))
(command (car tokens))
(args (cdr tokens))
(command-plugin (find-command-plugin command))
(viewer
(find/init-plugin-for-result
(with-errno-handler
((errno data)
(else data))
((command-plugin-evaluater command-plugin) command args))))
(new-entry
(make-history-entry command args viewer)))
;; FIXME, use insert here
(append-to-history! new-entry)
(signal-result-buffer-object-change)
(obtain-lock paint-lock)
(paint-result-window new-entry)
(refresh-result-window)
(move-cursor (command-buffer) (result-buffer))
(refresh-command-window)
(release-lock paint-lock)))))
(define (display-error-and-continue condition more)
(let ((win (app-window-curses-win (result-window))))