summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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")