summaryrefslogtreecommitdiff
path: root/elisp/geiser-debug.el
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2009-02-24 23:23:58 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2009-02-24 23:23:58 +0100
commit73af62cd02e94291c7fc26e5bfbf917ac7021bde (patch)
tree3e0ec4ed539165f3158e2c3e186ebb747a47ac80 /elisp/geiser-debug.el
parent8f76cb3c116723c11a542035efba6bce56608347 (diff)
downloadgeiser-73af62cd02e94291c7fc26e5bfbf917ac7021bde.tar.gz
geiser-73af62cd02e94291c7fc26e5bfbf917ac7021bde.tar.bz2
Smart tab is not enabled by default; module completion bound to C-.
Diffstat (limited to 'elisp/geiser-debug.el')
-rw-r--r--elisp/geiser-debug.el18
1 files changed, 11 insertions, 7 deletions
diff --git a/elisp/geiser-debug.el b/elisp/geiser-debug.el
index 1df03ef..c67a6aa 100644
--- a/elisp/geiser-debug.el
+++ b/elisp/geiser-debug.el
@@ -53,9 +53,7 @@
(defun geiser-debug--display-retort (what ret)
(let* ((err (geiser-eval--retort-error ret))
(output (geiser-eval--retort-output ret))
- (stack (geiser-eval--retort-stack ret))
- (step 2)
- (indent step))
+ (stack (geiser-eval--retort-stack ret)))
(when err
(geiser-debug--with-buffer
(erase-buffer)
@@ -63,9 +61,7 @@
(newline 2)
(insert (geiser-eval--error-str err) "\n\n")
(when output (insert output "\n\n"))
- (dolist (f (reverse (cdr stack)))
- (geiser-debug--display-stack-frame f indent)
- (setq indent (+ step indent)))
+ (geiser-debug--display-stack stack)
(goto-char (point-min)))
(geiser-debug--pop-to-buffer))))
@@ -76,6 +72,14 @@
(defsubst geiser-debug--frame-source-line (src) (or (cadr src) 1))
(defsubst geiser-debug--frame-source-column (src) (or (caddr src) 0))
+(defun geiser-debug--display-stack (stack)
+ (let* ((frames (cdr stack))
+ (step 2)
+ (indent (* (length frames) step)))
+ (dolist (f frames)
+ (geiser-debug--display-stack-frame f indent)
+ (setq indent (- indent step)))))
+
(defun geiser-debug--display-stack-frame (frame offset)
(let ((procedure (geiser-debug--frame-proc frame))
(source (geiser-debug--frame-source frame))
@@ -84,7 +88,7 @@
(insert (format "In file %s:%s:%s\n"
(geiser-debug--frame-source-file source)
(geiser-debug--frame-source-line source)
- (geiser-debug--frame-source-column source)))
+ (1+ (geiser-debug--frame-source-column source))))
(insert "In expression:\n"))
(insert (format "%s%s\n" (make-string offset ?\ ) description))))