all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Dealing with "gnu" rule in compilation-error-regexp-alist
@ 2010-04-15 11:21 Wilson Snyder
  2010-04-15 15:18 ` Chong Yidong
  2010-04-15 18:54 ` Stefan Monnier
  0 siblings, 2 replies; 4+ messages in thread
From: Wilson Snyder @ 2010-04-15 11:21 UTC (permalink / raw)
  To: emacs-devel


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'")




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

end of thread, other threads:[~2010-04-15 18:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-15 11:21 Dealing with "gnu" rule in compilation-error-regexp-alist Wilson Snyder
2010-04-15 15:18 ` Chong Yidong
2010-04-15 15:26   ` Wilson Snyder
2010-04-15 18:54 ` Stefan Monnier

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.