summaryrefslogtreecommitdiff
path: root/elisp
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
commitf6c09395b569f273ca27bc951ec5b882f2c3da86 (patch)
treebb9bd048a7a47cd967268e9d40ee5a80f773fb73 /elisp
parentbdda30e6f263f7142f2f33a8be2545d3061fb598 (diff)
downloadgeiser-chez-f6c09395b569f273ca27bc951ec5b882f2c3da86.tar.gz
geiser-chez-f6c09395b569f273ca27bc951ec5b882f2c3da86.tar.bz2
Guile: support for the REPL debugger
On errors, we switch to the REPL, where the debugger is active.
Diffstat (limited to 'elisp')
-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)