From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jan Nieuwenhuizen Newsgroups: gmane.lisp.guile.user,gmane.emacs.devel Subject: [PATCH 1/3] Support Guile backtraces in compilation mode. Date: Fri, 8 Aug 2014 13:05:54 +0200 Message-ID: <1407495956-20322-2-git-send-email-janneke@gnu.org> References: <1407495956-20322-1-git-send-email-janneke@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1407496004 13930 80.91.229.3 (8 Aug 2014 11:06:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 8 Aug 2014 11:06:44 +0000 (UTC) To: emacs-devel , guile-user Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Aug 08 13:06:39 2014 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XFi0M-0004As-Pq for guile-user@m.gmane.org; Fri, 08 Aug 2014 13:06:39 +0200 Original-Received: from localhost ([::1]:50430 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XFi0M-0005bd-AW for guile-user@m.gmane.org; Fri, 08 Aug 2014 07:06:38 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43009) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XFi01-0005a5-Iy for guile-user@gnu.org; Fri, 08 Aug 2014 07:06:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XFhzt-0005om-VP for guile-user@gnu.org; Fri, 08 Aug 2014 07:06:17 -0400 Original-Received: from smtp-vbr8.xs4all.nl ([194.109.24.28]:4796) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XFhzt-0005nl-Kr; Fri, 08 Aug 2014 07:06:09 -0400 Original-Received: from drakenvlieg.flower (static.kpn.net [92.70.116.82] (may be forged)) (authenticated bits=0) by smtp-vbr8.xs4all.nl (8.13.8/8.13.8) with ESMTP id s78B61I0092965 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 8 Aug 2014 13:06:09 +0200 (CEST) (envelope-from janneke@gnu.org) X-Mailer: git-send-email 1.9.1 In-Reply-To: <1407495956-20322-1-git-send-email-janneke@gnu.org> X-Virus-Scanned: by XS4ALL Virus Scanner X-MIME-Autoconverted: from 8bit to quoted-printable by smtp-vbr8.xs4all.nl id s78B61I0092965 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 194.109.24.28 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:11380 gmane.emacs.devel:173474 Archived-At: * 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 + + * 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 =20 * 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.") =20 (defvar compilation-num-errors-found) =20 +(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 %lo= ad-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/sh= are/guile/site") + "Path to locate Guile soure files for incomplete (Guile %load-path bas= ed) error messages. If compilation-guile-load-path-p is non-nil, it is d= ynamically 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 compilati= on-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 =3D \\(.+\\), Line =3D \\([0-9]+\\)\\(?:, Column= =3D \\([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'.") =20 --=20 Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.= nl =20