From: wsnyder@wsnyder.org (Wilson Snyder)
To: emacs-devel@gnu.org
Subject: Dealing with "gnu" rule in compilation-error-regexp-alist
Date: Thu, 15 Apr 2010 07:21:10 -0400 (EDT) [thread overview]
Message-ID: <20100415112110.68C97188395@wsnyder.org> (raw)
I'm trying to debug a problem with a compile error regexp. An
example is below; the highlighting may look correct, but
next-error will bring you to the wrong filename. (I'm using the
HEAD, but the same issue exists since Emacs 21.)
What's going on is the "gnu" rule is trumping the "percent" rule
- if you look at the comments for the "gnu" rule in compile.el,
it been hacked to reduce aggressiveness several times before.
What do people suggest to work around this problem? When compile
is called from inside the package-mode's buffer it could
subtract "gnu" from compilation-error-regexp-alist, but that
seems very unfriendly, and hard for users to debug. Likewise
tweaking the "gnu" rule makes a mess, as there's really several
regexps causing the problem.
The solution needs to work with the already released versions of
Emacs too.
Long term, I think it would be good have some sort of
ordering or priority to the rules; "gnu" being low priority,
without breaking the later fontification rules (why these
rules "append" now).
Thanks
(setq compilation-error-regexp-alist-alist
(append
'((percent "%?\\(Error\\|Warning\\):[\n ]*\\([^ \t:]+\\):\\([0-9]+\\):" 2 3))
compilation-error-regexp-alist-alist))
;; Ok
(setq compilation-error-regexp-alist '(percent))
(compile "echo 'zz: %Error: foo.x:1: something'")
(compile "echo '%Error: foo.x:1: something'")
;; Bad
(setq compilation-error-regexp-alist '(gnu percent))
(compile "echo 'zz: %Error: foo.x:1: something'")
;; Bad
(setq compilation-error-regexp-alist '(percent gnu))
(compile "echo 'zz: %Error: foo.x:1: something'")
next reply other threads:[~2010-04-15 11:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-15 11:21 Wilson Snyder [this message]
2010-04-15 15:18 ` Dealing with "gnu" rule in compilation-error-regexp-alist Chong Yidong
2010-04-15 15:26 ` Wilson Snyder
2010-04-15 18:54 ` Stefan Monnier
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100415112110.68C97188395@wsnyder.org \
--to=wsnyder@wsnyder.org \
--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 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).