diff options
author | jao <jao@gnu.org> | 2022-10-21 03:42:16 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2022-10-21 03:42:16 +0100 |
commit | d3e7dc792069724880356c4e0f8c1749b90ef1bb (patch) | |
tree | a6c6f37d458fdf7e3851142b5ba4caca5ddf142b /geiser-chez.el | |
parent | 5d9baf231bb4a7289585f88fcb168a81cd6ce7e7 (diff) | |
download | geiser-chez-d3e7dc792069724880356c4e0f8c1749b90ef1bb.tar.gz geiser-chez-d3e7dc792069724880356c4e0f8c1749b90ef1bb.tar.bz2 |
collecting and displaying condition locations (file, column)
Diffstat (limited to 'geiser-chez.el')
-rw-r--r-- | geiser-chez.el | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/geiser-chez.el b/geiser-chez.el index ef9f29a..9491a65 100644 --- a/geiser-chez.el +++ b/geiser-chez.el @@ -65,10 +65,6 @@ host." (define-obsolete-variable-alias 'geiser-chez-debug-on-exception-p 'geiser-chez-debug-on-exception "0.18") -(geiser-custom--defcustom geiser-chez-show-error-on-debug t - "Whether to issue a `show condition' command upon entering the debugger." - :type 'boolean) - (defconst geiser-chez-minimum-version "9.4") ;;; REPL support @@ -183,15 +179,24 @@ Return its local name." (geiser-repl-switch nil 'chez) (compilation-forget-errors) (geiser-repl--send "(debug)") - (when geiser-chez-show-error-on-debug (geiser-repl--send "s")) t)) (defun geiser-chez--display-error (_module key msg) "Display an error found during evaluation with the given KEY and message MSG." - (when (stringp msg) - (save-excursion (insert msg)) + (when msg + (save-excursion + (insert (car msg)) + (when-let (loc (cdr msg)) + (let ((file (cdr (assoc "file" loc))) + (line (or (cdr (assoc "line" loc)) "")) + (col (or (cdr (assoc "column" loc)) (cdr (assoc "char" loc)))) + (name (cdr (assoc "name" loc)))) + (insert "\n\n" file (format ":%s" line)) + (when col (insert (format ":%s" col))) + (when name (insert (format " (%s)" name)))) + (insert "\n"))) (geiser-edit--buttonize-files) - (not (zerop (length msg))))) + t)) ;;; Keywords and syntax |