diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2011-02-14 06:10:50 +0100 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2011-02-14 06:10:50 +0100 |
commit | a6c553d0d8e3d75d5557c40288ee0e2cf8418f3d (patch) | |
tree | 76ea48f3e5af3cbf496fc811f3afb337988de501 /elisp/geiser-connection.el | |
parent | 24ae4c34e08cd07945044f605b2d8a0306cc78c3 (diff) | |
download | geiser-chez-a6c553d0d8e3d75d5557c40288ee0e2cf8418f3d.tar.gz geiser-chez-a6c553d0d8e3d75d5557c40288ee0e2cf8418f3d.tar.bz2 |
Guile REPL: bug fix: correctly track debugging status
We weren't tracking the "enter debugger" event correctly, and all
evaluations in debug mode were failing. There's still (at least)
another bug, because error navigation in backtraces seems broken.
Diffstat (limited to 'elisp/geiser-connection.el')
-rw-r--r-- | elisp/geiser-connection.el | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/elisp/geiser-connection.el b/elisp/geiser-connection.el index d3c99cb..fb16aa6 100644 --- a/elisp/geiser-connection.el +++ b/elisp/geiser-connection.el @@ -104,6 +104,7 @@ (cons :eot (geiser-con--connection-eot-re prompt debug-prompt)) (cons :prompt prompt) (cons :debug-prompt debug-prompt) + (cons :is-debugging nil) (cons :count 0) (cons :completed (make-hash-table :weakness 'value)))) @@ -128,6 +129,18 @@ (defsubst geiser-con--connection-debug-prompt (c) (cdr (assoc :debug-prompt c))) +(defsubst geiser-con--connection-is-debugging (c) + (cdr (assoc :is-debugging c))) + +(defsubst geiser-con--connection-set-debugging (c d) + (setcdr (assoc :is-debugging c) d)) + +(defun geiser-con--connection-update-debugging (c txt) + (let* ((dp (geiser-con--connection-debug-prompt c)) + (is-d (and (stringp dp) (string-match dp txt)))) + (geiser-con--connection-set-debugging c is-d) + is-d)) + (defsubst geiser-con--connection-completed (c r) (geiser-con--request-deactivate r) (puthash (geiser-con--request-id r) r (cdr (assoc :completed c)))) @@ -142,8 +155,8 @@ new)) (defun geiser-con--has-entered-debugger (con answer) - (let ((dp (geiser-con--connection-debug-prompt con))) - (and (stringp dp) (string-match dp answer)))) + (and (not (geiser-con--connection-is-debugging con)) + (geiser-con--connection-update-debugging con answer))) (defun geiser-con--connection-close (con) (let ((tq (geiser-con--connection-tq con))) @@ -184,10 +197,10 @@ `((error (key . geiser-debugger)) (output . ,answer)) (condition-case err - (let* ((start (and (string-match "((\\(?:result\\|error\\)" answer) - (match-beginning 0))) - (form (car (read-from-string answer start)))) - (and (listp form) form)) + (let* ((start (string-match "((\\(?:result\\|error\\) " answer)) + (form (or (and start (car (read-from-string answer start))) + `((error . retort-syntax) (output . ,answer))))) + form) (error `((error (key . geiser-con-error)) (output . ,(format "%s\n(%s)" answer |