From: Philipp Stephani <p.stephani2@gmail.com>
To: Emacs developers <emacs-devel@gnu.org>
Subject: Improving compilation error regexp for Clang
Date: Sun, 11 Dec 2016 15:42:43 +0000 [thread overview]
Message-ID: <CAArVCkT88qZfpQg22BvNjDVOTYVZk4j6sgp8XeC_w-FJXHx_EQ@mail.gmail.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 109 bytes --]
Hi,
I've attached a small patch for compile.el that improves detection of
"Included from" lines from Clang.
[-- Attachment #1.2: Type: text/html, Size: 168 bytes --]
[-- Attachment #2: 0002-Add-a-new-compile-error-regexp-for-Clang-includes.txt --]
[-- Type: text/plain, Size: 1983 bytes --]
From c56f92b286ec192962f2a8ed5d013a95f9fbda22 Mon Sep 17 00:00:00 2001
From: Philipp Stephani <phst@google.com>
Date: Sat, 10 Dec 2016 21:39:55 +0100
Subject: [PATCH 2/2] Add a new compile error regexp for Clang includes
Clang uses a slight variation of GCC's include format, causing includes
to be treated as warnings instead of informational messages. Use a new
regular expression instead.
* lisp/progmodes/compile.el
(compilation-error-regexp-alist-alist): New element
`clang-include' for Clang-style "included from" lines.
* test/lisp/progmodes/compile-tests.el
(compile-tests--test-regexps-data): Add unit test.
---
lisp/progmodes/compile.el | 7 +++++++
test/lisp/progmodes/compile-tests.el | 3 +++
2 files changed, 10 insertions(+)
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index fc7056c..7f20e79 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -230,6 +230,13 @@ compilation-error-regexp-alist-alist
nil 1 nil 2 0
(2 (compilation-face '(3))))
+ (clang-include
+ ,(rx bol "In file included from "
+ (group (+ (not (any ?\n ?:)))) ?:
+ (group (+ (any (?0 . ?9)))) ?:
+ eol)
+ 1 2 nil 0)
+
(gcc-include
"^\\(?:In file included \\| \\|\t\\)from \
\\([0-9]*[^0-9\n]\\(?:[^\n :]\\| [^-/\n]\\|:[^ \n]\\)*?\\):\
diff --git a/test/lisp/progmodes/compile-tests.el b/test/lisp/progmodes/compile-tests.el
index 631174f..9f61c20 100644
--- a/test/lisp/progmodes/compile-tests.el
+++ b/test/lisp/progmodes/compile-tests.el
@@ -83,6 +83,9 @@ compile-tests--test-regexps-data
1 nil 302 "\\lib\\python\\Products\\PythonScripts\\PythonScript.py")
("File \"/tmp/foo.py\", line 10"
1 nil 10 "/tmp/foo.py")
+ ;; clang-include
+ ("In file included from foo.cpp:2:"
+ 1 nil 2 "foo.cpp" 0)
;; cmake cmake-info
("CMake Error at CMakeLists.txt:23 (hurz):"
1 nil 23 "CMakeLists.txt")
--
2.8.0.rc3.226.g39d4020
next reply other threads:[~2016-12-11 15:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-11 15:42 Philipp Stephani [this message]
2016-12-14 13:08 ` Improving compilation error regexp for Clang Philipp Stephani
2016-12-18 20:59 ` Philipp Stephani
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=CAArVCkT88qZfpQg22BvNjDVOTYVZk4j6sgp8XeC_w-FJXHx_EQ@mail.gmail.com \
--to=p.stephani2@gmail.com \
--cc=emacs-devel@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.