all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jan Nieuwenhuizen <janneke@gnu.org>
To: emacs-devel <emacs-devel@gnu.org>, guile-user <guile-user@gnu.org>
Subject: [PATCH 1/3] Support Guile backtraces in compilation mode.
Date: Fri,  8 Aug 2014 13:05:54 +0200	[thread overview]
Message-ID: <1407495956-20322-2-git-send-email-janneke@gnu.org> (raw)
In-Reply-To: <1407495956-20322-1-git-send-email-janneke@gnu.org>

	* 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  <janneke@gnu.org>
+
+	* 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  <janneke@gnu.org>
 
 	* 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 <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar®  http://AvatarAcademy.nl  




  reply	other threads:[~2014-08-08 11:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-08 11:05 compilation-mode support for Guile backtrace Jan Nieuwenhuizen
2014-08-08 11:05 ` Jan Nieuwenhuizen [this message]
2014-08-08 13:29   ` [PATCH 1/3] Support Guile backtraces in compilation mode Stefan Monnier
2014-08-08 17:43     ` Jan Nieuwenhuizen
2014-08-08 13:47   ` Eli Zaretskii
2014-08-08 13:53     ` Jan Nieuwenhuizen
2014-08-08 13:57       ` Eli Zaretskii
2014-08-08 14:34       ` Emilio Lopes
2014-08-08 11:05 ` [PATCH 2/3] Add Guile backtrace example Jan Nieuwenhuizen
2014-08-08 11:05 ` [PATCH 3/3] Add tests for Guile compile regexps Jan Nieuwenhuizen
2014-08-08 13:33 ` compilation-mode support for Guile backtrace Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1407495956-20322-2-git-send-email-janneke@gnu.org \
    --to=janneke@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.