unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] Handle output from Emacs byte-compilation properly
@ 2015-09-14 20:14 Jostein Kjønigsen
  2015-09-14 20:24 ` Jostein Kjønigsen
  0 siblings, 1 reply; 4+ messages in thread
From: Jostein Kjønigsen @ 2015-09-14 20:14 UTC (permalink / raw)
  To: emacs-devel; +Cc: Jan Nieuwenhuizen

[-- Attachment #1: Type: text/plain, Size: 863 bytes --]

It's common for module-developers to run Emacs byte-compilation in
separate build-scripts.

When invoking byte-compile on Emacs-lisp files you often get the
following headers:

- In toplevel form:
- In end of data:

When these errors show up in the output of a build-script initiated
through M-x compile and show up in a compilation-mode buffer, these
lines gets treated as guile-errors for files which doesn't exist.

This is due to the following regexp, which is quite frankly extremely
wide:

    (guile-file "^In \\(.+\\):\n" 1)

This breaks prev-error and next-error based navigation because the
files "toplevel form" and "end of data" doesn't exist.

This patch ensures those lines are treated as information only before
getting to the guile-file regexp.

--
Jostein Kjønigsen
jostein@kjonigsen.net / jostein@secure.kjonigsen.net

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: compilation-mode-emacs-lisp.patch --]
[-- Type: text/x-patch; name="compilation-mode-emacs-lisp.patch", Size: 1734 bytes --]

From eec1a7951b0bfb85875ef09f1d78988068893c06 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jostein=20Kj=C3=B8nigsen?= <jostein@kjonigsen.net>
Date: Mon, 14 Sep 2015 21:43:57 +0200
Subject: [PATCH] Handle output from Emacs byte-compilation properly

It's common for module-developers to run Emacs byte-compilation in
separate build-scripts.

When invoking byte-compile on Emacs-lisp files you often get the
following headers:

- In toplevel form:
- In end of data:

When these errors show up in the output of a build-script initiated
through M-x compile and show up in a compilation-mode buffer, these
lines gets treated as guile-errors for files with the respective names
"toplevel form" and "end of data".

This breaks prev-error and next-error based navigation.

This patch ensures those lines are treated as information only before
getting to the guile-files regexp.
---
 lisp/progmodes/compile.el | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index a6e9ed8..c936ec6 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -477,6 +477,12 @@ File = \\(.+\\), Line = \\([0-9]+\\)\\(?:, Column = \\([0-9]+\\)\\)?"
      ;;
      "^\\([^ \t\r\n(]+\\) (\\([0-9]+\\):\\([0-9]+\\)) "
      1 2 3)
+
+    ;; ensure emacs-info headers are not treated as guile-errors.
+    ;; created using (rx (or "In toplevel form:" "In end of data:"))
+    (add-to-list 'compilation-error-regexp-alist-alist '(elisp-info "\\(?:In \\(?:\\(?:end of data\\|toplevel form\\):\\)\\)" nil nil nil 0))
+    (add-to-list 'compilation-error-regexp-alist 'elisp-info)
+
     (guile-file "^In \\(.+\\):\n" 1)
     (guile-line "^ *\\([0-9]+\\): *\\([0-9]+\\)" nil 1 2)
     )
--
1.9.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-09-15 16:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-14 20:14 [PATCH] Handle output from Emacs byte-compilation properly Jostein Kjønigsen
2015-09-14 20:24 ` Jostein Kjønigsen
2015-09-15  9:57   ` Jostein Kjønigsen
2015-09-15 16:03     ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).