# HG changeset patch # User Sam Steingold # Date 1255381455 0 # Node ID 5d7b16939e28d66beb444db845b400b188715bfa # Parent e7f57b24c0a2923c2de066da9dd4ec2290bdaf73 (compilation-mode-font-lock-keywords): Do not prepend "^ *" to non-anchored patterns, like the perl one (bug#3928). diff -r e7f57b24c0a2 -r 5d7b16939e28 lisp/ChangeLog --- a/lisp/ChangeLog Mon Oct 12 20:42:45 2009 +0000 +++ b/lisp/ChangeLog Mon Oct 12 21:04:15 2009 +0000 @@ -1,7 +1,10 @@ 2009-10-12 Sam Steingold * 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 diff -r e7f57b24c0a2 -r 5d7b16939e28 lisp/progmodes/compile.el --- a/lisp/progmodes/compile.el Mon Oct 12 20:42:45 2009 +0000 +++ b/lisp/progmodes/compile.el Mon Oct 12 21:04:15 2009 +0000 @@ -989,11 +989,10 @@ ;; 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)))