summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2010-01-28 14:54:42 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2010-01-28 14:54:42 +0100
commitc34995d238fc6e2253c6a453a5e49110de3b5957 (patch)
tree6e5ab300e47a52e8e19e031d5412cafe7e92d363
parent55c37c72c7a0c04c1ca2e1642776c673c6c6a3a7 (diff)
downloadgeiser-guile-c34995d238fc6e2253c6a453a5e49110de3b5957.tar.gz
geiser-guile-c34995d238fc6e2253c6a453a5e49110de3b5957.tar.bz2
Guile: support for the REPL debugger
On errors, we switch to the REPL, where the debugger is active.
-rw-r--r--elisp/geiser-guile.el32
1 files changed, 10 insertions, 22 deletions
diff --git a/elisp/geiser-guile.el b/elisp/geiser-guile.el
index 3008878..89b80d7 100644
--- a/elisp/geiser-guile.el
+++ b/elisp/geiser-guile.el
@@ -63,33 +63,12 @@ This function uses `geiser-guile-init-file' if it exists."
,@(and init-file (file-readable-p init-file) (list "-l" init-file)))))
(defconst geiser-guile--prompt-regexp "^[^() \n]+@([^)]*?)> ")
-
-
-;;; Catching the debugger
-(make-variable-buffer-local
- (defvar geiser-guile--is-debugging nil))
-
-(defun geiser-guile--is-debugging ()
- (with-current-buffer (geiser-repl--get-repl geiser-impl--implementation)
- geiser-guile--is-debugging))
-
-(defvar geiser-guile--debugger-prompt-regexp "[0-9]+ debug> *$")
-(defun geiser-guile--watch-debugger (str)
- (setq geiser-guile--is-debugging
- (string-match-p geiser-guile--debugger-prompt-regexp str)))
-
-(defun geiser-guile--startup ()
- (add-hook 'comint-output-filter-functions
- 'geiser-guile--watch-debugger
- nil
- t))
+(defconst geiser-guile--debugger-prompt-regexp "[0-9]+ debug> *")
;;; Evaluation support:
(defun geiser-guile--geiser-procedure (proc)
- (when (geiser-guile--is-debugging)
- (error "(Guile REPL is in debug mode)"))
(let ((proc (intern (format "ge:%s" (if (eq proc 'eval) 'compile proc)))))
`(@ (geiser emacs) ,proc)))
@@ -164,6 +143,14 @@ This function uses `geiser-guile-init-file' if it exists."
(re-search-forward geiser-guile--module-re nil t)))
+;;; Compilation shell regexps
+(defun geiser-guile--startup ()
+ (set (make-local-variable 'compilation-error-regexp-alist)
+ '(("^In \\([^:]+\\):" 1)
+ ("^ \\([0-9]+\\): " nil 1)))
+ (compilation-setup t))
+
+
;;; Implementation definition:
(define-geiser-implementation guile
@@ -171,6 +158,7 @@ This function uses `geiser-guile-init-file' if it exists."
(arglist geiser-guile--parameters)
(startup geiser-guile--startup)
(prompt-regexp geiser-guile--prompt-regexp)
+ (debugger-prompt-regexp geiser-guile--debugger-prompt-regexp)
(marshall-procedure geiser-guile--geiser-procedure)
(find-module geiser-guile--get-module)
(find-symbol-begin geiser-guile--symbol-begin)