summaryrefslogtreecommitdiff
path: root/elisp/geiser-debug.el
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2010-09-07 00:22:37 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2010-09-07 00:22:37 +0200
commitc21b375451a6b47bcb922514a962c9e2dabcf3f0 (patch)
tree82dde22765365cb113bbd4d1354c0bf1495d5f86 /elisp/geiser-debug.el
parent5f2d19e28bfe4860eaadd46010b29d34da8fc918 (diff)
downloadgeiser-c21b375451a6b47bcb922514a962c9e2dabcf3f0.tar.gz
geiser-c21b375451a6b47bcb922514a962c9e2dabcf3f0.tar.bz2
Support for evaluation warnings
Diffstat (limited to 'elisp/geiser-debug.el')
-rw-r--r--elisp/geiser-debug.el42
1 files changed, 23 insertions, 19 deletions
diff --git a/elisp/geiser-debug.el b/elisp/geiser-debug.el
index 909dffb..7f70d19 100644
--- a/elisp/geiser-debug.el
+++ b/elisp/geiser-debug.el
@@ -65,29 +65,33 @@ and the accompanying error message) and should display
error was successfully displayed, the call should evaluate to a
non-null value.")
+(geiser-impl--define-caller geiser-debug--enter-debugger
+ enter-debugger ()
+ "This method is called upon entering the debugger, in the REPL
+buffer.")
+
(defun geiser-debug--display-retort (what ret &optional res)
(let* ((err (geiser-eval--retort-error ret))
(key (geiser-eval--error-key err))
(output (geiser-eval--retort-output ret))
(impl geiser-impl--implementation)
- (module (geiser-eval--get-module)))
- (if (eq key 'geiser-debugger)
- (progn
- (switch-to-geiser nil nil (current-buffer))
- (geiser-debug--display-error impl module key output))
- (geiser-debug--with-buffer
- (erase-buffer)
- (insert what)
- (newline 2)
- (when (and res (not err))
- (insert res)
- (newline 2))
- (unless (geiser-debug--display-error impl module key output)
- (when err (insert (geiser-eval--error-str err) "\n\n"))
- (when output (insert output "\n\n")))
- (goto-char (point-min)))
- (when (or err (and output (> (length output) 0)))
- (geiser-debug--pop-to-buffer)))))
+ (module (geiser-eval--get-module))
+ (jump nil)
+ (buffer (current-buffer))
+ (debug (eq key 'geiser-debugger)))
+ (when debug
+ (switch-to-geiser nil nil buffer)
+ (geiser-debug--enter-debugger impl))
+ (geiser-debug--with-buffer
+ (erase-buffer)
+ (insert what)
+ (newline 2)
+ (when (and res (not err))
+ (insert res)
+ (newline 2))
+ (setq jump (geiser-debug--display-error impl module key output))
+ (goto-char (point-min)))
+ (when jump (geiser-debug--pop-to-buffer))))
(defsubst geiser-debug--wrap-region (str)
(format "(begin %s)" str))
@@ -107,7 +111,7 @@ non-null value.")
(geiser-autodoc--clean-cache)
(when and-go (funcall and-go))
(when (not err) (message "%s" res))
- (geiser-debug--display-retort str ret res)))
+ (geiser-debug--display-retort (geiser-syntax--scheme-str str) ret res)))
(defun geiser-debug--expand-region (start end all wrap)
(let* ((str (buffer-substring-no-properties start end))