diff options
Diffstat (limited to 'elisp/geiser-debug.el')
-rw-r--r-- | elisp/geiser-debug.el | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/elisp/geiser-debug.el b/elisp/geiser-debug.el index 3956c43..e3f2bb5 100644 --- a/elisp/geiser-debug.el +++ b/elisp/geiser-debug.el @@ -159,6 +159,11 @@ buffer.") (declare-function switch-to-geiser "geiser-repl") +(defun geiser-debug--remove-prompt (impl str) + (replace-regexp-in-string (or (geiser-repl--debugger-prompt-regexp impl) "^$") + "" + str)) + (defun geiser-debug--display-retort (what ret &optional res auto-p) (let* ((err (geiser-eval--retort-error ret)) (key (geiser-eval--error-key err)) @@ -170,6 +175,7 @@ buffer.") (dir default-directory) (buffer (current-buffer)) (debug (eq key 'geiser-debugger)) + (output (if debug (geiser-debug--remove-prompt impl output) output)) (debug-entered (when debug (switch-to-geiser nil nil buffer) (geiser-debug--enter-debugger impl))) @@ -179,7 +185,8 @@ buffer.") (erase-buffer) (when dir (setq default-directory dir)) (unless after (insert what "\n\n")) - (setq img (when (and res (not err)) (geiser-debug--insert-res res))) + (setq img (when (and res (not err) (not debug)) + (geiser-debug--insert-res res))) (when (or err key output) (or (geiser-debug--display-error impl module key output) (insert "\n" (if key (format "%s\n" key) "") output "\n"))) @@ -192,10 +199,10 @@ buffer.") (remove (ansi-color-filter-region (point-min) (point-max)))) (goto-char (point-min))) (when (or img err output) - (when (or geiser-debug-jump-to-debug-p geiser-debug-show-debug-p) - (if geiser-debug-jump-to-debug-p - (geiser-debug--pop-to-buffer) - (display-buffer (geiser-debug--buffer)))) + (cond (geiser-debug-jump-to-debug-p + (geiser-debug--pop-to-buffer)) + (geiser-debug-show-debug-p + (display-buffer (geiser-debug--buffer)))) (when (and err geiser-debug-auto-next-error-p) (ignore-errors (next-error)) (message "=> %s" output)))))) |