summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-12-20 20:51:34 +0000
committerjao <jao@gnu.org>2021-12-20 20:51:34 +0000
commit0897f31a3e3c06a04e613f1bac888d045eea0c48 (patch)
tree97c5bf991d90c82f99a585a319f7340ec983d93a
parent0a7d55f34f09776a16d3e81521ee8cd081f3b717 (diff)
downloadgeiser-0897f31a3e3c06a04e613f1bac888d045eea0c48.tar.gz
geiser-0897f31a3e3c06a04e613f1bac888d045eea0c48.tar.bz2
Better handling of (:debug) evaluations
-rw-r--r--elisp/geiser-debug.el13
-rw-r--r--elisp/geiser-eval.el3
2 files changed, 13 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."
diff --git a/elisp/geiser-eval.el b/elisp/geiser-eval.el
index 2ee451c..1019e55 100644
--- a/elisp/geiser-eval.el
+++ b/elisp/geiser-eval.el
@@ -96,6 +96,9 @@ module-exports, autodoc, callers, callees and generic-methods.")
(defsubst geiser-eval--ge (proc args)
(apply 'geiser-eval--form (cons proc (mapcar 'geiser-eval--scheme-str args))))
+(defsubst geiser-eval--debug (args)
+ (geiser-eval--ge 'debug args))
+
(defun geiser-eval--scheme-str (code)
(cond ((null code) "'()")
((eq code :f) "#f")