Try to get handlers right

part of darcs patch Thu Sep 22 19:36:25 EEST 2005  Martin Gasbichler <gasbichl@informatik.uni-tuebingen.de>
This commit is contained in:
eknauel 2005-09-27 16:36:07 +00:00
parent 04e4dba6a2
commit ae9052aeaf
1 changed files with 21 additions and 25 deletions

View File

@ -236,10 +236,7 @@
(command-plugin (find-command-plugin command)) (command-plugin (find-command-plugin command))
(viewer (viewer
(find/init-plugin-for-result (find/init-plugin-for-result
(with-errno-handler ((command-plugin-evaluater command-plugin) command args)))
((errno data)
(else data))
((command-plugin-evaluater command-plugin) command args))))
(new-entry (new-entry
(make-history-entry command args viewer))) (make-history-entry command args viewer)))
;; FIXME, use insert here ;; FIXME, use insert here
@ -273,7 +270,9 @@
(receive (command args) (split-scheme-command-line command-line) (receive (command args) (split-scheme-command-line command-line)
(let* ((viewer (let* ((viewer
(find/init-plugin-for-result (find/init-plugin-for-result
(eval-scheme-command command args))) (with-inspector-handler
(lambda ()
(eval-scheme-command command args)))))
(new-entry (new-entry
(make-history-entry command args viewer))) (make-history-entry command args viewer)))
(append-to-history! new-entry) (append-to-history! new-entry)
@ -285,28 +284,25 @@
(move-cursor (command-buffer) (result-buffer)) (move-cursor (command-buffer) (result-buffer))
(refresh-command-window) (refresh-command-window)
(release-lock paint-lock)))) (release-lock paint-lock))))
(define (eval-command-in-scheme-mode command-line) (define (eval-command-in-scheme-mode command-line)
(with-inspector-handler (if (scheme-command-line? command-line)
(lambda () (process-scheme-command command-line)
(if (scheme-command-line? command-line) (let ((viewer
(process-scheme-command command-line) (find/init-plugin-for-result
(let ((viewer (eval-string command-line)))
(find/init-plugin-for-result (new-entry
(eval-string command-line)))) (make-history-entry command-line '() viewer)))
(let ((new-entry ;; #### shouldn't we use some kind of insertion here?
(make-history-entry command-line '() viewer))) (append-to-history! new-entry)
;; #### shouldn't we use some kind of insertion here? (signal-result-buffer-object-change)
(append-to-history! new-entry) (obtain-lock paint-lock)
(signal-result-buffer-object-change) (paint-active-command-window)
(obtain-lock paint-lock) (paint-result-window new-entry)
(paint-active-command-window) (refresh-result-window)
(paint-result-window new-entry) (move-cursor (command-buffer) (result-buffer))
(refresh-result-window) (refresh-command-window)
(move-cursor (command-buffer) (result-buffer)) (release-lock paint-lock))))
(refresh-command-window)
(release-lock paint-lock)))))))
;; #### crufty, and a very dumb idea ;; #### crufty, and a very dumb idea
(define split-command-line string-tokenize) (define split-command-line string-tokenize)