guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/3] Support Guile backtraces in compilation mode.


From: Jan Nieuwenhuizen
Subject: [PATCH 1/3] Support Guile backtraces in compilation mode.
Date: Fri, 8 Aug 2014 13:05:54 +0200

        * progmodes/compile.el (compilation-error-regexp-alist-alist):
        Add Guile regexpses.
        (compilation-dynamic-guile-load-path-p)
        (compilation-guile-get-load-path-command)
        (compilation-guile-load-path): New variable.
        (compilation-guile-in-find-file): New function.
---
 lisp/ChangeLog            |  9 +++++++++
 lisp/progmodes/compile.el | 30 ++++++++++++++++++++++++++++++
 2 files changed, 39 insertions(+)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b3da957..b66d48a 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,12 @@
+2014-08-08  Jan Nieuwenhuizen  <address@hidden>
+
+       * progmodes/compile.el (compilation-error-regexp-alist-alist):
+       Add Guile regexpses.
+       (compilation-dynamic-guile-load-path-p)
+       (compilation-guile-get-load-path-command)
+       (compilation-guile-load-path): New variable.
+       (compilation-guile-in-find-file): New function.
+
 2014-08-05  Jan Nieuwenhuizen  <address@hidden>
 
        * progmodes/gud.el (guiler): New function.  Starts the Guile REPL;
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 000d719..98d098c4 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -129,6 +129,34 @@ and a string describing how the process finished.")
 
 (defvar compilation-num-errors-found)
 
+(defcustom compilation-dynamic-guile-load-path-p nil
+  "If non-nil, Guile's load path is retrieved by running guile."
+  :type 'boolean
+  :group 'compilation
+  :version "24.3.2")
+
+(defcustom compilation-guile-get-load-path-command "guile -c '(write 
%load-path)'"
+  "Guile command to print %load-path to stdout."
+  :type 'string
+  :group 'compilation
+  :version "24.3.2")
+
+(defcustom compilation-guile-load-path '("/usr/share/guile/2.0" 
"/usr/share/guile/site")
+  "Path to locate Guile soure files for incomplete (Guile %load-path based) 
error messages.  If compilation-guile-load-path-p is non-nil, it is dynamically 
set from Guile."
+  :type 'list
+  :group 'compilation
+  :version "24.3.2")
+
+(defun compilation-guile-in-find-file ()
+  (let ((file-name (match-string 1)))
+    (if (file-exists-p file-name)
+        file-name
+      (if (and compilation-dynamic-guile-load-path-p
+               (not (compilation-guile-load-path)))
+          (setq guile-load-path (read (shell-command-to-string 
compilation-guile-get-load-path-command))))
+      (or (locate-file file-name compilation-guile-load-path)
+          file-name))))
+
 ;; If you make any changes to `compilation-error-regexp-alist-alist',
 ;; be sure to run the ERT test in test/automated/compile-tests.el.
 ;; emacs -batch -l compile-tests.el -f ert-run-tests-batch-and-exit
@@ -477,6 +505,8 @@ File = \\(.+\\), Line = \\([0-9]+\\)\\(?:, Column = 
\\([0-9]+\\)\\)?"
      ;;
      "^\\([^ \t\r\n(]+\\) (\\([0-9]+\\):\\([0-9]+\\)) "
      1 2 3)
+    (guile-file "^In \\(.+\\):\n" compilation-guile-in-find-file)
+    (guile-line "^ *\\([0-9]+\\): *\\([0-9]+\\)" nil 1 2)
     )
   "Alist of values for `compilation-error-regexp-alist'.")
 
-- 
Jan Nieuwenhuizen <address@hidden> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | AvatarĀ®  http://AvatarAcademy.nl  




reply via email to

[Prev in Thread] Current Thread [Next in Thread]