[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/geiser-guile 1c9457a 116/284: Guile: heuristically resolvi
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/geiser-guile 1c9457a 116/284: Guile: heuristically resolving relative paths in REPL errors. |
Date: |
Sun, 1 Aug 2021 18:29:28 -0400 (EDT) |
branch: elpa/geiser-guile
commit 1c9457aa15b00a9a9f058a5677370305aa68da79
Author: Jose Antonio Ortega Ruiz <jao@gnu.org>
Commit: Jose Antonio Ortega Ruiz <jao@gnu.org>
Guile: heuristically resolving relative paths in REPL errors.
---
elisp/geiser-guile.el | 37 +++++++++++++++++++++++++++++++++++--
1 file changed, 35 insertions(+), 2 deletions(-)
diff --git a/elisp/geiser-guile.el b/elisp/geiser-guile.el
index 0523dfe..db4b27d 100644
--- a/elisp/geiser-guile.el
+++ b/elisp/geiser-guile.el
@@ -150,11 +150,44 @@ This function uses `geiser-guile-init-file' if it exists."
;;; Compilation shell regexps
+
+(defconst geiser-guile--path-rx "^In \\([^:\n]+\\):\n")
+
+(defconst geiser-guile--rel-path-rx
+ "^In \\([^/\n]+.+?/module/\\([^:\n]+\\)\\):\n")
+
+(make-variable-buffer-local
+ (defvar geiser-guile--load-path nil))
+
+(defun geiser-guile--load-path ()
+ (geiser-eval--send/result `(:eval (:scm "%load-path"))))
+
+(defun geiser-guile--find-in-load-path (f ps)
+ (when ps
+ (let ((c (expand-file-name f (car ps))))
+ (or (and (file-exists-p c) c)
+ (geiser-guile--find-in-load-path f (cdr ps))))))
+
+(defun geiser-guile--resolve-file-x ()
+ (let ((f (match-string-no-properties 1)))
+ (if (file-name-absolute-p f)
+ (list f)
+ (let ((p (match-string-no-properties 0)))
+ (when (string-match geiser-guile--rel-path-rx p)
+ (let ((f (geiser-guile--find-in-load-path
+ (match-string-no-properties 2 p)
+ geiser-guile--load-path)))
+ (and f (list f))))))))
+
(defun geiser-guile--startup ()
(set (make-local-variable 'compilation-error-regexp-alist)
- '(("^In \\(/[^:\n]+\\):\n +\\([0-9]+\\): +" 1 2)
+ `((,geiser-guile--path-rx geiser-guile--resolve-file-x)
+ ("^ +\\([0-9]+\\): +" nil 1)
("at \\(/[^:\n]+\\):\\([[:digit:]]+\\):\\([[:digit:]]+\\)" 1 2 3)))
- (compilation-setup t))
+ (setq geiser-guile--load-path (geiser-guile--load-path))
+ (compilation-setup t)
+ (font-lock-add-keywords
+ nil `((,geiser-guile--path-rx 1 compilation-error-face))))
;;; Implementation definition:
- [nongnu] elpa/geiser-guile 6d3f98b 085/284: Guile: unbreaking evaluation., (continued)
- [nongnu] elpa/geiser-guile 6d3f98b 085/284: Guile: unbreaking evaluation., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 0e5a52b 090/284: Leftover removed., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 58ae3a1 100/284: Cosmetics., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 5807a76 105/284: Guile: adjustment to stack size display., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile a405f22 104/284: Guile: fix for file loading (we always compile them now)., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 134606d 102/284: Guile: Support for multiple arities in autodoc., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile c34995d 110/284: Guile: support for the REPL debugger, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 55c37c7 109/284: Guile: Minimal support for the new REPL debug mode., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile a9f26f1 115/284: Guile: slightly better compilation error regexps., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 11c2d58 138/284: Guile: excluding anonymous module names from completion., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 1c9457a 116/284: Guile: heuristically resolving relative paths in REPL errors.,
Philip Kaludercic <=
- [nongnu] elpa/geiser-guile f1ac35f 140/284: Guile: filtering gensym names in autodoc display., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 6baa7d3 124/284: Guile: better stack trace limits during evaluation., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 14c1689 132/284: Guile: no more module loading under the rug., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile e43cfa8 121/284: Guile: evaluation fixes (current git head)., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile d41ac93 123/284: Debugging leftover., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 6907aea 145/284: Guile: geiser commands working at the debugging prompt., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 1178462 155/284: Guile: show error message upon entering the debugger, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile d1d05b7 175/284: Guile: using the new syntax for sending eval requests, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 8552404 176/284: Guile: using meta-commands to talk with Guile, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 1a35206 150/284: More docs., Philip Kaludercic, 2021/08/01