bug-make
[Top][All Lists]
Advanced

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

Re: Make error messages


From: Paul Smith
Subject: Re: Make error messages
Date: Sun, 22 Sep 2019 16:49:08 -0400
User-agent: Evolution 3.32.1-2

On Wed, 2019-09-11 at 08:44 +0200, Andreas Schwab wrote:
> On Sep 10 2019, Paul Smith <address@hidden> wrote:
> 
> > That didn't work, however, because particularly in recursive make
> > the makefile name is likely not qualified with a path, but the
> > current working directory when the build is invoked is not the same
> > as the one where make is invoked--thus "Makefile" is at best
> > ambiguous.
> 
> But isn't that the same situation as with any other error message in
> a recursive make, which Emacs already handles correctly (with the
> help of make --print-directory)?

Thanks for getting me to look into this more deeply.

The problem is not print-directory, etc.  The problem is that Emacs
compile mode doesn't have a matcher for error messages generated by GNU
make when a target fails.  As such it matches some other regex in
compilation-error-regexp-alist-alist and computes the filename
incorrectly.

I've sent a patch to Emacs for compile.el which adds a matching regex
for GNU make error messages, and assigns them the INFO level since they
are usually not needed, but sometimes is is very handy to be able to
jump to the makefile recipe.

In the meantime I've added this to my init.el:

;; Add support for GNU make error matching, if it doesn't yet exist
(with-eval-after-load 'compile
  (or (member 'gmake compilation-error-regexp-alist)
      (progn
        (setf (alist-get 'gmake compilation-error-regexp-alist-alist)
              '(": \\*\\*\\* \\[\\(\\(.+?\\):\\([0-9]+\\): .+\\)\\]"
                2 3 nil 0 1))
        (add-to-list 'compilation-error-regexp-alist 'gmake))))

I'm going to revert the change I made to GNU make to use ";" instead of
":" between the filename and line number (that was never part of any
release of GNU make) and go back to ":".




reply via email to

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