]> git.eshelyaron.com Git - emacs.git/commitdiff
Alter last change to be compatible with Emacs 23.
authorChong Yidong <cyd@gnu.org>
Sun, 16 Sep 2012 04:31:02 +0000 (12:31 +0800)
committerChong Yidong <cyd@gnu.org>
Sun, 16 Sep 2012 04:31:02 +0000 (12:31 +0800)
* lisp/progmodes/compile.el (compilation-parse-errors): Accept list
values similar to font-lock-keywords.  Suggested by
Oleksandr Manzyuk.
(compilation-error-regexp-alist): Doc fix.

Fixes: debbugs:12136
lisp/ChangeLog
lisp/progmodes/compile.el

index 9d5f70eb224e44f9b8bf7e3e1f8b8c4e9f2aa00e..2d2ff692309d4b7a24b20db2132e4046b7d318e1 100644 (file)
@@ -1,7 +1,8 @@
 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).
+       * progmodes/compile.el (compilation-parse-errors): Accept list
+       values similar to font-lock-keywords (Bug#12136).  Suggested by
+       Oleksandr Manzyuk.
        (compilation-error-regexp-alist): Doc fix.
 
 2012-09-15  Glenn Morris  <rgm@gnu.org>
index ae2f6973fa58d0e6821bec0e5b901003ad457c98..f5dedf0cd591624a5bb26e6b29a4e83781ca2f72 100644 (file)
@@ -490,8 +490,10 @@ matched by the whole REGEXP becomes the hyperlink.
 
 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."
+which evaluates to a face name (a symbol or string).
+Alternatively, FACE can evaluate to a property list of the
+form (face FACE PROP1 VAL1 PROP2 VAL2 ...), in which case all the
+listed text properties PROP# are given values VAL# as well."
   :type '(repeat (choice (symbol :tag "Predefined symbol")
                         (sexp :tag "Error specification")))
   :link `(file-link :tag "example file"
@@ -1329,18 +1331,27 @@ to `compilation-error-regexp-alist' if RULES is nil."
             (compilation--put-prop
              end-col 'font-lock-face compilation-column-face)
 
+           ;; Obey HIGHLIGHT.
             (dolist (extra-item (nthcdr 6 item))
               (let ((mn (pop extra-item)))
                 (when (match-beginning mn)
                   (let ((face (eval (car extra-item))))
                     (cond
                      ((null face))
-                     ((or (symbolp face)
-                         (stringp face)
-                         (listp face))
+                     ((or (symbolp face) (stringp face))
                       (put-text-property
                        (match-beginning mn) (match-end mn)
                        'font-lock-face face))
+                    ((and (listp face)
+                          (eq (car face) 'face)
+                          (or (symbolp (cadr face))
+                              (stringp (cadr face))))
+                      (put-text-property
+                       (match-beginning mn) (match-end mn)
+                       'font-lock-face (cadr face))
+                      (add-text-properties
+                       (match-beginning mn) (match-end mn)
+                       (nthcdr 2 face)))
                      (t
                       (error "Don't know how to handle face %S"
                              face)))))))