Oleksandr Manzyuk | 4 Aug 2012 16:07
Picon
Gravatar

bug#12136: 24.1; Allow faces specified by property lists in `compilation-error-regexp-alist'.

Unlike Emacs 23 in which fontification of compilation errors is handled
by `font-lock.el', in Emacs 24, it is performed by `compile.el' itself,
in a rather ad hoc fashion.  In particular, it doesn't handle the faces
specified by property list of the form (face FACE PROP1 VAL1 PROP2 VAL2
...).  The documentation of `compilation-error-regexp-alist' says that
it is an alist that specifies how errors in compiler output are matched,
where each element has the form

(REGEXP FILE [LINE COLUMN TYPE HYPERLINK HIGHLIGHT...]).

Additional HIGHLIGHTs take the shape (SUBMATCH FACE), where FACE is an
expression returning the face to use for the submatch.  If fact, only
symbols are supported by the current version of `compile.el' and lists
error out with the error message "Don't know how to handle face ...".

As a consequence, compilation error messages are not properly fontified
in `inferior-haskell-mode', which also breaks navigation between errors
with C-x ` (see https://github.com/haskell/haskell-mode/issues/67 for
more details).  Unfortunately, I don't know of any other examples where
this problem manifests itself.

It seems to be straightforward to add support for faces specified by
property list.  I use the following patch:

diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index c008e1c..be73850 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
 <at>  <at>  -1338,6 +1338,11  <at>  <at>  to `compilation-error-regexp-alist' if RULES is nil."
                       (put-text-property
(Continue reading)

Chong Yidong | 16 Sep 2012 06:31
Picon

bug#12136: 24.1; Allow faces specified by property lists in `compilation-error-regexp-alist'.

Oleksandr Manzyuk <manzyuk <at> gmail.com> writes:

> Unlike Emacs 23 in which fontification of compilation errors is handled
> by `font-lock.el', in Emacs 24, it is performed by `compile.el' itself,
> in a rather ad hoc fashion.  In particular, it doesn't handle the faces
> specified by property list of the form (face FACE PROP1 VAL1 PROP2 VAL2
> ...).
>
> (REGEXP FILE [LINE COLUMN TYPE HYPERLINK HIGHLIGHT...]).
>
> Additional HIGHLIGHTs take the shape (SUBMATCH FACE), where FACE is an
> expression returning the face to use for the submatch.  If fact, only
> symbols are supported by the current version of `compile.el' and lists
> error out with the error message "Don't know how to handle face ...".

Thanks.  I committed a slightly amended version of the suggested fix.


Gmane