Commit f1be615c authored by Chong Yidong's avatar Chong Yidong
Browse files

Alter last change to be compatible with Emacs 23.

* 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
parent c584eaf9
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>
......
......@@ -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)))))))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment