summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2014-05-31 20:54:22 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2014-05-31 20:57:37 +0200
commit9ff03facb2ea1e0a6b320f603dfd7e0e787d9593 (patch)
tree41ec3f148b32692ecf0604c92749dc505fb68a9e
parent30c3c30774fc16e5ec342bc5eeca21c277a56107 (diff)
downloadgeiser-guile-9ff03facb2ea1e0a6b320f603dfd7e0e787d9593.tar.gz
geiser-guile-9ff03facb2ea1e0a6b320f603dfd7e0e787d9593.tar.bz2
Finer control of debugging window popups
It's now possible to control whether we jump to the debug window on evaluation errors (geiser-debug-jump-to-debug-p) and whether we show it all (geiser-debug-show-debug-p).
-rw-r--r--NEWS5
-rw-r--r--doc/parens.texi6
-rw-r--r--elisp/geiser-debug.el33
-rw-r--r--elisp/geiser-racket.el7
4 files changed, 43 insertions, 8 deletions
diff --git a/NEWS b/NEWS
index 2d3b741..fae671a 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,10 @@
* Version 0.5.1
+ New features:
+
+ - New customizable variables `geiser-debug-jump-to-debug-p` and
+ `geiser-debug-show-debug-p`.
+
Bug fixes:
- Better support for Typed Racket: (re)definitions now work for
diff --git a/doc/parens.texi b/doc/parens.texi
index 2c486ce..9b146e9 100644
--- a/doc/parens.texi
+++ b/doc/parens.texi
@@ -508,6 +508,12 @@ to said exception type. Both the error and exception link faces are
customizable (@code{geiser-font-lock-error-link} and
@code{geiser-font-lock-doc-link}).
+By default, Geiser will tele-transport your pointer to the debug buffer:
+if you prefer to stay in the source buffer, set
+@code{geiser-debug-jump-to-debug-p} to nil. And if, in addition, you
+don't even want to see the error trace, customize
+@code{geiser-debug-show-debug-p}, again, to nil.
+
On the other hand, Guile's reaction to evaluation errors is different:
it enters the debugger in its REPL. Accordingly, the REPL buffer will
pop up if your evaluation fails in a Guile file, and the error message
diff --git a/elisp/geiser-debug.el b/elisp/geiser-debug.el
index 611e50e..a63e8eb 100644
--- a/elisp/geiser-debug.el
+++ b/elisp/geiser-debug.el
@@ -1,6 +1,6 @@
;;; geiser-debug.el -- displaying debug information and evaluation results
-;; Copyright (C) 2009, 2010, 2011, 2012, 2013 Jose Antonio Ortega Ruiz
+;; Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Jose Antonio Ortega Ruiz
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the Modified BSD License. You should
@@ -42,6 +42,22 @@ has no effect."
:group 'geiser-debug
:type 'int)
+(geiser-custom--defcustom geiser-debug-jump-to-debug-p t
+ "When set to t (the default), jump to the debug pop-up buffer
+ in case of evaluation errors.
+
+See also `geiser-debug-show-debug-p`. "
+ :group 'geiser-debug
+ :type 'boolean)
+
+(geiser-custom--defcustom geiser-debug-show-debug-p t
+ "When set to t (the default), show the debug pop-up buffer in
+ case of evaluation errors.
+
+This option takes effect even if `geiser-debug-jump-to-debug-p`
+is set."
+ :group 'geiser-debug
+ :type 'boolean)
(geiser-custom--defcustom geiser-debug-auto-display-images-p t
"Whether to automatically invoke the external viewer to display
@@ -116,9 +132,8 @@ buffer.")
(insert res)
(let ((end (point)))
(goto-char begin)
- (let ((no
- (geiser-image--replace-images t
- geiser-debug-auto-display-images-p)))
+ (let ((no (geiser-image--replace-images
+ t geiser-debug-auto-display-images-p)))
(goto-char end)
(newline 2)
(and no (> no 0))))))
@@ -151,7 +166,15 @@ buffer.")
(insert "\nExpression evaluated was:\n\n")
(geiser-debug--display-error impl module nil what))
(goto-char (point-min)))
- (when (or img dbg) (geiser-debug--pop-to-buffer))))
+ (when (or img dbg)
+ (geiser-debug--pop-to-buffer)
+ (when (and dbg (not geiser-debug-jump-to-debug-p))
+ (next-error)
+ (when (not geiser-debug-show-debug-p)
+ (pop-to-buffer (geiser-debug--buffer)
+ 'display-buffer-reuse-window t)
+ (View-quit))
+ (message "Evaluation error: %s" dbg)))))
(defsubst geiser-debug--wrap-region (str)
(format "(begin %s)" str))
diff --git a/elisp/geiser-racket.el b/elisp/geiser-racket.el
index 4c1b127..f2cec3a 100644
--- a/elisp/geiser-racket.el
+++ b/elisp/geiser-racket.el
@@ -251,10 +251,10 @@ using start-geiser, a procedure in the geiser/server module."
(mapc 'geiser-edit--buttonize-files geiser-racket--file-rxs)
(goto-char end)
(newline))))
- (or key (not (zerop (length msg)))))
+ (if (and msg (string-match "\\(.+\\)$" msg)) (match-string 1 msg) key))
-;;; Trying to ascertain whether a buffer is mzscheme scheme:
+;;; Trying to ascertain whether a buffer is racket code:
(defun geiser-racket--guess ()
(or (save-excursion
@@ -275,7 +275,8 @@ using start-geiser, a procedure in the geiser/server module."
(defun geiser-racket--keywords ()
(append geiser-racket-font-lock-forms
(when geiser-racket-extra-keywords
- `((,(format "[[(]%s\\>" (regexp-opt geiser-racket-extra-keywords 1))
+ `((,(format "[[(]%s\\>"
+ (regexp-opt geiser-racket-extra-keywords 1))
. 1)))))
(geiser-syntax--scheme-indent