* compilation mode: wrong default error regexp blocking workflow
@ 2014-12-14 15:14 LanX
2014-12-23 3:42 ` LanX
0 siblings, 1 reply; 2+ messages in thread
From: LanX @ 2014-12-14 15:14 UTC (permalink / raw)
To: help-gnu-emacs
Hi
I have to minor problems which become pretty annoying in combination.
1. There is a default error-regex for some languages like perl and python which I can't alter or delete.
Any sequence with colons 'NAME:NUMBER:' will not only be matched as errorline, but NAME grep anything from line's start, including hashes and whitespace(!)
just compile the following line in perl or python mode, and you'll see that '# file' is considered a filename.
print "# file:15:"
I already checked compilation-error-regexp-alist and compilation-error-regexp-alist-alist but my perl settings do not include such a regex and I don't even have any setting for python.
This seems to be hardcoded somewhere.
2. Unfortunately I can't ignore those false matches cause activating compilation-auto-jump-to-first-error will automatically try to open this unexisting file and hang in the dialog, even pop up a file browser under X.
I couldn't find any option to disable next-error from trying this.
Now my questions:
1. How can I disable or change this default error-regex?
2. How can I tell next-error not to open unexisting files?
emacs -version: GNU Emacs 23.3.1
Cheers
LanX
PS: Crossposted similar stuff on stackoverflow without success so far:
see http://stackoverflow.com/questions/27463431/emacs-compilation-mode-marking-wrong-lines-as-errors
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: compilation mode: wrong default error regexp blocking workflow
2014-12-14 15:14 compilation mode: wrong default error regexp blocking workflow LanX
@ 2014-12-23 3:42 ` LanX
0 siblings, 0 replies; 2+ messages in thread
From: LanX @ 2014-12-23 3:42 UTC (permalink / raw)
To: help-gnu-emacs
OK
I digged into the sources of compilation mode but I wasn't able to identify the origin of this greedy default regexp.
But I found a workaround!
One has to define an own regexp which matches the same lines before the default regexp can do and has to correct the matching groups to avoid strange characters.
This is a proof of concept
(add-to-list 'compilation-error-regexp-alist-alist '(perl "^.*?\\([a-zA-Z/][^ \n#]+\\):\\([0-9]+\\):" 1 2))
Now only paths starting with a character or a slash and w/o whitespace or # in between are matched. Any other leading characters are ignored.
Of course you'll still need to append the old regexp for typical Perl error messages, I left this out for readability.
And you'll have to do it for each programming mode...
HTH
LanX
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-12-23 3:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-14 15:14 compilation mode: wrong default error regexp blocking workflow LanX
2014-12-23 3:42 ` LanX
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).