diff options
| author | Kenichi Handa <handa@gnu.org> | 2012-09-16 20:47:45 +0900 |
|---|---|---|
| committer | Kenichi Handa <handa@gnu.org> | 2012-09-16 20:47:45 +0900 |
| commit | ba13e6168a07a085c0ca8e67c91640b84ee0c1fd (patch) | |
| tree | a63038205a6803ba06f5e17eda974c3ab23e57fb /lisp/progmodes/compile.el | |
| parent | dcbd9236f7be9da4e658fd559dfbd7454f4b6018 (diff) | |
| parent | a8c729af93b08531e5e3f3fff6f16a55c8baac3f (diff) | |
| download | emacs-ba13e6168a07a085c0ca8e67c91640b84ee0c1fd.tar.gz | |
merge trunk
Diffstat (limited to 'lisp/progmodes/compile.el')
| -rw-r--r-- | lisp/progmodes/compile.el | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index fbb0c9e204a..f5dedf0cd59 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -488,9 +488,12 @@ 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 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" @@ -1328,16 +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)) - ((symbolp 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))))))) |
