In compilation-error-regexp-alist, allow more HIGHLIGHT types.
authorChong Yidong <cyd@gnu.org>
Sun, 16 Sep 2012 04:16:51 +0000 (12:16 +0800)
committerChong Yidong <cyd@gnu.org>
Sun, 16 Sep 2012 04:16:51 +0000 (12:16 +0800)
* progmodes/compile.el (compilation-parse-errors): Apply any value
that is a valid font-lock-face property.
(compilation-error-regexp-alist): Doc fix.

Fixes: debbugs:12136

lisp/ChangeLog
lisp/progmodes/compile.el

index b436d9e..9d5f70e 100644 (file)
@@ -1,3 +1,9 @@
+2012-09-16  Chong Yidong  <cyd@gnu.org>
+
+       * progmodes/compile.el (compilation-parse-errors): Apply any value
+       that is a valid font-lock-face property (Bug#12136).
+       (compilation-error-regexp-alist): Doc fix.
+
 2012-09-15  Glenn Morris  <rgm@gnu.org>
 
        * version.el (emacs-bzr-version-bzr): New function.
index fbb0c9e..ae2f697 100644 (file)
@@ -488,9 +488,10 @@ What matched the HYPERLINK'th subexpression has `mouse-face' and
 `compilation-message-face' applied.  If this is nil, the text
 matched by the whole REGEXP becomes the hyperlink.
 
-Additional HIGHLIGHTs take the shape (SUBMATCH FACE), where SUBMATCH is
-the number of a submatch that should be highlighted when it matches,
-and FACE is an expression returning the face to use for that submatch.."
+Additional HIGHLIGHTs take the shape (SUBMATCH FACE), where
+SUBMATCH is the number of a submatch and FACE is an expression
+which evaluates to a face (more precisely, a valid value for the
+`font-lock-face' property) for highlighting the submatch."
   :type '(repeat (choice (symbol :tag "Predefined symbol")
                         (sexp :tag "Error specification")))
   :link `(file-link :tag "example file"
@@ -1334,7 +1335,9 @@ to `compilation-error-regexp-alist' if RULES is nil."
                   (let ((face (eval (car extra-item))))
                     (cond
                      ((null face))
-                     ((symbolp face)
+                     ((or (symbolp face)
+                         (stringp face)
+                         (listp face))
                       (put-text-property
                        (match-beginning mn) (match-end mn)
                        'font-lock-face face))