all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to adapt compilation-error-regexp-alist
@ 2023-04-03 14:33 Pascal Quesseveur
  2023-04-05  8:02 ` Pascal Quesseveur
  0 siblings, 1 reply; 2+ messages in thread
From: Pascal Quesseveur @ 2023-04-03 14:33 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,

I'm using Emacs 28.1 on Windows 64 bits.

I'm compiling Java sources using a compilation command which launches
javac through a project management tool. That works fine but when
there are compilation errors they appear as follows in the compilation
buffer:

  C:\Users\..\file.java:307: error: ';' expected

The 2 spaces before the file name are taken into account in the name,
and the attempt to open file with emacs fails.

I think I need to adapt compilation-error-regexp-alist, but it's not
obvious how to do it. Any suggestion would be welcome.


-- 
Pascal Quesseveur
pquessev@gmail.com




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

* Re: How to adapt compilation-error-regexp-alist
  2023-04-03 14:33 How to adapt compilation-error-regexp-alist Pascal Quesseveur
@ 2023-04-05  8:02 ` Pascal Quesseveur
  0 siblings, 0 replies; 2+ messages in thread
From: Pascal Quesseveur @ 2023-04-05  8:02 UTC (permalink / raw)
  To: help-gnu-emacs

I modified compilation-error-regexp-alist as follows ant it works:

(add-to-list 'compilation-error-regexp-alist
             '("^[[:blank:]]+\\([[:alnum:]/\\].*\\):\\([0-9]+\\):[[:blank:]]+\\(?:error\\|\\(warning\\)\\|\\(info\\)\\)"
                   1 2 nil (3 . 4) 1))

(i am not sure there are info messages from javac compiler)

But I have a couple of questions. IIUW my problem comes from the fact
there is at least one regexp in compilation-error-regexp-alist that
matches the error line without removing spaces at beginning of file
name. But there's no mean to identify that regexp. Regexp definitions
are set in compilation-error-regexp-alist-alist and they don't use a
uniform way of coding with makes them difficult to read.

Should'nt the definition of the list change according to the
programming modes used?


-- 
Pascal Quesseveur
pquessev@gmail.com




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

end of thread, other threads:[~2023-04-05  8:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-03 14:33 How to adapt compilation-error-regexp-alist Pascal Quesseveur
2023-04-05  8:02 ` Pascal Quesseveur

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.