diff options
author | jao <jao@gnu.org> | 2021-12-20 20:51:34 +0000 |
---|---|---|
committer | jao <jao@gnu.org> | 2021-12-20 20:51:34 +0000 |
commit | 0897f31a3e3c06a04e613f1bac888d045eea0c48 (patch) | |
tree | 97c5bf991d90c82f99a585a319f7340ec983d93a /elisp/geiser-debug.el | |
parent | 0a7d55f34f09776a16d3e81521ee8cd081f3b717 (diff) | |
download | geiser-0897f31a3e3c06a04e613f1bac888d045eea0c48.tar.gz geiser-0897f31a3e3c06a04e613f1bac888d045eea0c48.tar.bz2 |
Better handling of (:debug) evaluations
Diffstat (limited to 'elisp/geiser-debug.el')
-rw-r--r-- | elisp/geiser-debug.el | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/elisp/geiser-debug.el b/elisp/geiser-debug.el index 394f7da..af4c8db 100644 --- a/elisp/geiser-debug.el +++ b/elisp/geiser-debug.el @@ -112,14 +112,21 @@ all ANSI sequences." (defvar-local geiser-debug--debugger-active-p nil) (defvar-local geiser-debug--sender-buffer nil) +(defun geiser-debug--send-dbg (thing) + (geiser-eval--send/wait (cons :debug (if (listp thing) thing (list thing))))) + +(defun geiser-debug--debugger-display (thing ret) + (geiser-debug--display-retort (format ",%s" thing) + ret + (geiser-eval--retort-result-str ret nil))) + (defun geiser-debug--send-to-repl (thing) (unless (and geiser-debug--debugger-active-p geiser-debug--sender-buffer) (error "Debugger not active")) (save-window-excursion (with-current-buffer geiser-debug--sender-buffer - (let* ((ret (geiser-eval--send/wait (cons :debug thing))) - (res (geiser-eval--retort-result-str ret nil))) - (geiser-debug--display-retort (format ",%s" thing) ret res))))) + (when-let (ret (geiser-debug--send-dbg thing)) + (geiser-debug--debugger-display thing ret))))) (defun geiser-debug-switch-to-buffer () "Return to the scheme buffer that pooped this debug window." |