diff options
author | jao <jao@gnu.org> | 2021-12-19 03:47:57 +0000 |
---|---|---|
committer | jao <jao@gnu.org> | 2021-12-19 03:47:57 +0000 |
commit | ec580a16e10168eb8f12b686dca051719d37fcc4 (patch) | |
tree | 1080b9311fea68cc3c2b03d5965c5e70e621a3b7 /elisp/geiser-connection.el | |
parent | 21dcac5de1c99bbdfd81eb5de6e50fb002be4535 (diff) | |
download | geiser-ec580a16e10168eb8f12b686dca051719d37fcc4.tar.gz geiser-ec580a16e10168eb8f12b686dca051719d37fcc4.tar.bz2 |
Debugger: fixes and better determination of debugging status
Diffstat (limited to 'elisp/geiser-connection.el')
-rw-r--r-- | elisp/geiser-connection.el | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/elisp/geiser-connection.el b/elisp/geiser-connection.el index 1068330..344fbe2 100644 --- a/elisp/geiser-connection.el +++ b/elisp/geiser-connection.el @@ -157,9 +157,9 @@ new)) (defun geiser-con--has-entered-debugger (con answer) - (and (not (geiser-con--connection-is-debugging con)) - (let ((p (car (last (split-string answer "\n" t))))) - (and p (geiser-con--connection-update-debugging con p))))) + (when-let ((p (car (last (split-string answer "\n" t))))) + (geiser-con--connection-update-debugging con p)) + (geiser-con--connection-is-debugging con)) (defun geiser-con--connection-eot-p (con txt) (and txt @@ -199,17 +199,18 @@ ;;; Requests handling: (defun geiser-con--req-form (req answer) - (let ((con (geiser-con--request-connection req))) - (if (geiser-con--has-entered-debugger con answer) - `((error (key . geiser-debugger)) - (output . ,answer)) - (condition-case err - (let ((start (string-match "((\\(?:result)?\\|error\\) " answer))) - (or (and start (car (read-from-string answer start))) - `((error (key . retort-syntax)) (output . ,answer)))) - (error `((error (key . geiser-con-error)) - (output . ,(format "%s\n(%s)" - answer (error-message-string err))))))))) + (let* ((con (geiser-con--request-connection req)) + (debugging (geiser-con--has-entered-debugger con answer))) + (condition-case err + (let ((start (string-match "((\\(?:result)?\\|error\\) " answer))) + (or (and start (car (read-from-string answer start))) + `((error (key . retort-syntax)) + (output . ,answer) + (debug . ,debugging)))) + (error `((error (key . geiser-con-error)) + (debug . debugging) + (output . ,(format "%s\n(%s)" + answer (error-message-string err)))))))) (defun geiser-con--process-completed-request (req answer) (let ((cont (geiser-con--request-continuation req)) |