From 0a2c373bc06e08f3381026cbaa4581290aa0f753 Mon Sep 17 00:00:00 2001 From: eknauel Date: Tue, 17 May 2005 09:22:07 +0000 Subject: [PATCH] Use sunterlib's INSPECT-EXCEPTION package for debugging. Fix a crash when switching from result buffer to command buffer. --- scheme/nuit-engine.scm | 57 +++++++++++++++++++++++----------------- scheme/nuit-packages.scm | 1 + 2 files changed, 34 insertions(+), 24 deletions(-) diff --git a/scheme/nuit-engine.scm b/scheme/nuit-engine.scm index babc551..4ddbfa1 100644 --- a/scheme/nuit-engine.scm +++ b/scheme/nuit-engine.scm @@ -211,7 +211,19 @@ ;;start the whole thing (define (nuit) - (run)) + (with-inspecting-handler + 8888 + (lambda (condition) + (with-current-output-port* + (error-output-port) + (lambda () + (display "starting remote handler for condition") + (display condition) + (newline) + (display "Please connect to port 8888") + (newline) + #t))) + run)) ;;handle input (define (run) @@ -273,21 +285,20 @@ ;;Ctrl-x o ->switch buffer ((= ch 111) - (begin - (if (focus-on-command-buffer?) - (let ((key-message - (make-key-pressed-message active-command - current-result-object - 97))) - (focus-result-buffer!) - (set! current-result-object (switch key-message)) - (paint-result-window)) - (begin - (focus-command-buffer!) - (paint-command-window-contents) - (move-cursor command-buffer))) - (set! c-x-pressed #f) - (loop (wait-for-input)))) + (if (focus-on-command-buffer?) + (let ((key-message + (make-key-pressed-message active-command + current-result-object + 97))) + (focus-result-buffer!) + (set! current-result-object (switch key-message)) + (paint-result-window)) + (begin + (focus-command-buffer!) + (paint-command-window-contents) + (move-cursor command-buffer))) + (set! c-x-pressed #f) + (loop (wait-for-input))) ;;C-x r -> redo ((= ch 114) @@ -435,9 +446,7 @@ (paint-command-window) (paint-command-window-contents) (paint-result-window) - - (set! command-buffer - (move-cursor command-buffer))) + (move-cursor command-buffer)) (define (wait-for-input) (noecho) @@ -633,7 +642,7 @@ (lambda (string) (let loop ((str string)) (if (equal? str "") - values + (values) (let ((first-ch (string-ref str 0))) (begin (add-to-command-buffer (char->ascii first-ch)) @@ -656,7 +665,7 @@ (define print-active-command-win (lambda (win width) (if (<= width 25) - values + (values) (let ((active-command (string-append active-command active-parameters))) (if (> (string-length active-command) (- width 25)) @@ -698,7 +707,7 @@ (let ((lines (get-right-result-lines))) (let loop ((pos 1)) (if (> pos result-lines) - values + (values) (let ((line (list-ref lines (- pos 1)))) (begin (if (not (standard-result-obj? current-result-object)) @@ -934,7 +943,7 @@ ((key-pressed-message? message) (key-pressed-message-result-model message)) ((restore-message? message) - values) + (values)) ((selection-message? message) "")))) @@ -991,7 +1000,7 @@ ((key-pressed-message? message) (key-pressed-message-result-model message)) ((restore-message? message) - values) + (values)) ((selection-message? message) "")))) diff --git a/scheme/nuit-packages.scm b/scheme/nuit-packages.scm index f3dee2f..faa3845 100644 --- a/scheme/nuit-packages.scm +++ b/scheme/nuit-packages.scm @@ -10,6 +10,7 @@ handle ncurses srfi-6 + inspect-exception rt-modules) (files nuit-engine handle-fatal-error