]> git.eshelyaron.com Git - emacs.git/commitdiff
(compilation-mode-font-lock-keywords): Do not prepend "^ *" to
authorSam Steingold <sds@gnu.org>
Mon, 12 Oct 2009 21:04:15 +0000 (21:04 +0000)
committerSam Steingold <sds@gnu.org>
Mon, 12 Oct 2009 21:04:15 +0000 (21:04 +0000)
non-anchored patterns, like the perl one (bug#3928).

lisp/ChangeLog
lisp/progmodes/compile.el

index 72b4848f595263d1fa950e464e3aad5b9ce4fbce..58975e14f44aeb7111584865a989634fa564ac1b 100644 (file)
@@ -1,7 +1,10 @@
 2009-10-12  Sam Steingold  <sds@gnu.org>
 
        * progmodes/compile.el (compilation-next-error-function): Fix the
-       timestamps if the buffer has been visited before
+       timestamps if the buffer has been visited before.
+
+       (compilation-mode-font-lock-keywords): Do not prepend "^ *" to
+       non-anchored patterns, like the perl one (bug#3928).
 
 2009-10-12  Glenn Morris  <rgm@gnu.org>
 
index 7b2d21cf3102ab415ed6d87f8e39f9f6ea80f225..c44ddfdb242f3ceb059a320877bf92b91eacd8b4 100644 (file)
@@ -989,11 +989,10 @@ FMTS is a list of format specs for transforming the file name.
           ;; another solution is to modify (some?) regexps in
           ;; `compilation-error-regexp-alist'.
           ;; note that omake usage is not limited to ocaml and C (for stubs).
-          (unless (string-match (concat "^" (regexp-quote "^ *")) pat)
-            (setq pat (concat "^ *"
-                              (if (= ?^ (aref pat 0))
-                                  (substring pat 1)
-                                  pat))))
+          (when (and (= ?^ (aref pat 0)) ; anchored: starts with "^"
+                     ;; but does not allow an arbitrary number of leading spaces
+                     (not (and (= ?  (aref pat 1)) (= ?* (aref pat 1)))))
+            (setq pat (concat "^ *" (substring pat 1))))
          (if (consp file)      (setq fmt (cdr file)      file (car file)))
          (if (consp line)      (setq end-line (cdr line) line (car line)))
          (if (consp col)       (setq end-col (cdr col)   col (car col)))