summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2010-08-31 16:43:35 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2010-08-31 16:43:35 +0200
commitf6e8492346b1ac7be21b96849df25c08dd8ce3ae (patch)
treefa45e217219a3f92c11cb2e008e57ea3e4740901
parentfb357359565a89c8e97db0c8068bad11579bb291 (diff)
downloadgeiser-chez-f6e8492346b1ac7be21b96849df25c08dd8ce3ae.tar.gz
geiser-chez-f6e8492346b1ac7be21b96849df25c08dd8ce3ae.tar.bz2
Guile: show error message upon entering the debugger
-rw-r--r--elisp/geiser-guile.el14
-rw-r--r--scheme/guile/geiser/emacs.scm2
2 files changed, 14 insertions, 2 deletions
diff --git a/elisp/geiser-guile.el b/elisp/geiser-guile.el
index 28a0015..910d3b7 100644
--- a/elisp/geiser-guile.el
+++ b/elisp/geiser-guile.el
@@ -44,6 +44,12 @@ started."
:type 'string
:group 'geiser-guile)
+(geiser-custom--defcustom geiser-guile-debug-show-bt-p nil
+ "Whether to autmatically show a full backtrace when entering the debugger.
+If `nil', only the last frame is shown."
+ :type 'boolean
+ :group 'geiser-guile)
+
;;; REPL support:
@@ -141,9 +147,13 @@ This function uses `geiser-guile-init-file' if it exists."
(defun geiser-guile--display-error (module key msg)
(if (eq key 'geiser-debugger)
- (progn
+ (let ((bt-cmd (format ",%s\n"
+ (if geiser-guile-debug-show-bt-p "bt" "fr"))))
(goto-char (point-max))
- (comint-send-string nil ",bt\n"))
+ (comint-send-string nil "((@ (geiser emacs) ge:newline))\n")
+ (comint-send-string nil ",error-message\n")
+ (comint-send-string nil bt-cmd)
+ (message "Debug REPL. Enter ,q to quit, ,h for help."))
(when key
(insert "Error: ")
(geiser--insert-with-face (format "%s" key) 'bold)
diff --git a/scheme/guile/geiser/emacs.scm b/scheme/guile/geiser/emacs.scm
index 05c525e..3b6f49c 100644
--- a/scheme/guile/geiser/emacs.scm
+++ b/scheme/guile/geiser/emacs.scm
@@ -27,6 +27,7 @@
ge:callees
ge:find-file)
#:export (ge:no-values)
+ #:export (ge:newline)
#:use-module (geiser evaluation)
#:use-module ((geiser modules) :renamer (symbol-prefix-proc 'ge:))
#:use-module ((geiser completion) :renamer (symbol-prefix-proc 'ge:))
@@ -34,5 +35,6 @@
#:use-module ((geiser doc) :renamer (symbol-prefix-proc 'ge:)))
(define (ge:no-values) (values))
+(define ge:newline newline)
;;; emacs.scm ends here