Use sunterlib's INSPECT-EXCEPTION package for debugging. Fix a crash

when switching from result buffer to command buffer.
This commit is contained in:
eknauel 2005-05-17 09:22:07 +00:00
parent 03ffcf8280
commit 0a2c373bc0
2 changed files with 34 additions and 24 deletions

View File

@ -211,7 +211,19 @@
;;start the whole thing ;;start the whole thing
(define (nuit) (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 ;;handle input
(define (run) (define (run)
@ -273,7 +285,6 @@
;;Ctrl-x o ->switch buffer ;;Ctrl-x o ->switch buffer
((= ch 111) ((= ch 111)
(begin
(if (focus-on-command-buffer?) (if (focus-on-command-buffer?)
(let ((key-message (let ((key-message
(make-key-pressed-message active-command (make-key-pressed-message active-command
@ -287,7 +298,7 @@
(paint-command-window-contents) (paint-command-window-contents)
(move-cursor command-buffer))) (move-cursor command-buffer)))
(set! c-x-pressed #f) (set! c-x-pressed #f)
(loop (wait-for-input)))) (loop (wait-for-input)))
;;C-x r -> redo ;;C-x r -> redo
((= ch 114) ((= ch 114)
@ -435,9 +446,7 @@
(paint-command-window) (paint-command-window)
(paint-command-window-contents) (paint-command-window-contents)
(paint-result-window) (paint-result-window)
(move-cursor command-buffer))
(set! command-buffer
(move-cursor command-buffer)))
(define (wait-for-input) (define (wait-for-input)
(noecho) (noecho)
@ -633,7 +642,7 @@
(lambda (string) (lambda (string)
(let loop ((str string)) (let loop ((str string))
(if (equal? str "") (if (equal? str "")
values (values)
(let ((first-ch (string-ref str 0))) (let ((first-ch (string-ref str 0)))
(begin (begin
(add-to-command-buffer (char->ascii first-ch)) (add-to-command-buffer (char->ascii first-ch))
@ -656,7 +665,7 @@
(define print-active-command-win (define print-active-command-win
(lambda (win width) (lambda (win width)
(if (<= width 25) (if (<= width 25)
values (values)
(let ((active-command (string-append active-command (let ((active-command (string-append active-command
active-parameters))) active-parameters)))
(if (> (string-length active-command) (- width 25)) (if (> (string-length active-command) (- width 25))
@ -698,7 +707,7 @@
(let ((lines (get-right-result-lines))) (let ((lines (get-right-result-lines)))
(let loop ((pos 1)) (let loop ((pos 1))
(if (> pos result-lines) (if (> pos result-lines)
values (values)
(let ((line (list-ref lines (- pos 1)))) (let ((line (list-ref lines (- pos 1))))
(begin (begin
(if (not (standard-result-obj? current-result-object)) (if (not (standard-result-obj? current-result-object))
@ -934,7 +943,7 @@
((key-pressed-message? message) ((key-pressed-message? message)
(key-pressed-message-result-model message)) (key-pressed-message-result-model message))
((restore-message? message) ((restore-message? message)
values) (values))
((selection-message? message) ((selection-message? message)
"")))) ""))))
@ -991,7 +1000,7 @@
((key-pressed-message? message) ((key-pressed-message? message)
(key-pressed-message-result-model message)) (key-pressed-message-result-model message))
((restore-message? message) ((restore-message? message)
values) (values))
((selection-message? message) ((selection-message? message)
"")))) ""))))

View File

@ -10,6 +10,7 @@
handle handle
ncurses ncurses
srfi-6 srfi-6
inspect-exception
rt-modules) rt-modules)
(files nuit-engine (files nuit-engine
handle-fatal-error handle-fatal-error