summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--elisp/geiser-connection.el3
-rw-r--r--elisp/geiser-debug.el17
-rw-r--r--elisp/geiser-repl.el6
3 files changed, 15 insertions, 11 deletions
diff --git a/elisp/geiser-connection.el b/elisp/geiser-connection.el
index d9ffc15..1068330 100644
--- a/elisp/geiser-connection.el
+++ b/elisp/geiser-connection.el
@@ -200,8 +200,7 @@
(defun geiser-con--req-form (req answer)
(let ((con (geiser-con--request-connection req)))
- (if (or (geiser-con--connection-is-debugging con)
- (geiser-con--has-entered-debugger con answer))
+ (if (geiser-con--has-entered-debugger con answer)
`((error (key . geiser-debugger))
(output . ,answer))
(condition-case err
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))))))
diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el
index e86691e..58fa810 100644
--- a/elisp/geiser-repl.el
+++ b/elisp/geiser-repl.el
@@ -562,15 +562,13 @@ will be set up using `geiser-connect-local' when a REPL is started.")
(defun geiser-repl--connection-buffer (addr)
(when addr (get-buffer-create (format " %s <%s>" (buffer-name) addr))))
-(defun geiser-repl--connection-setup (impl address prompt-rx deb-prompt-rx)
+(defun geiser-repl--connection-setup (impl address prompt deb-prompt)
(let* ((addr (unless address (geiser-repl--connection-address impl)))
(buff (or (geiser-repl--connection-buffer addr) (current-buffer))))
(when addr
(setq geiser-repl--connection-buffer buff)
(geiser-repl--comint-local-connect buff addr))
- (geiser-con--make-connection (get-buffer-process buff)
- prompt-rx
- deb-prompt-rx)))
+ (geiser-con--make-connection (get-buffer-process buff) prompt deb-prompt)))
(defun geiser-repl--comint-local-connect (buff address)
"Connect over a Unix-domain socket."