emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r110042: Alter last change to be comp


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110042: Alter last change to be compatible with Emacs 23.
Date: Sun, 16 Sep 2012 12:31:02 +0800
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110042
fixes bug: http://debbugs.gnu.org/12136
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Sun 2012-09-16 12:31:02 +0800
message:
  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.
modified:
  lisp/ChangeLog
  lisp/progmodes/compile.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-09-16 04:16:51 +0000
+++ b/lisp/ChangeLog    2012-09-16 04:31:02 +0000
@@ -1,7 +1,8 @@
 2012-09-16  Chong Yidong  <address@hidden>
 
-       * 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  <address@hidden>

=== modified file 'lisp/progmodes/compile.el'
--- a/lisp/progmodes/compile.el 2012-09-16 04:16:51 +0000
+++ b/lisp/progmodes/compile.el 2012-09-16 04:31:02 +0000
@@ -490,8 +490,10 @@
 
 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 @@
             (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)))))))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]