diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-02-24 23:23:58 +0100 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-02-24 23:23:58 +0100 |
commit | b9b36421ff83a12b1ef9e645be7d23f68d703912 (patch) | |
tree | a6895235ca82cfe430c5e882e481f83e682a5cf1 /elisp/geiser-debug.el | |
parent | 05c2c94f9a29e24139c591d994a225d9de416767 (diff) | |
download | geiser-guile-b9b36421ff83a12b1ef9e645be7d23f68d703912.tar.gz geiser-guile-b9b36421ff83a12b1ef9e645be7d23f68d703912.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.el | 18 |
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)))) |