Subject: 23.1.50; compilation-mode not matching perl and more [regression]

From: Kevin Ryde <[email-masked]>
Date: Sat, 25 Jul 2009 22:42:44 +1000

Running "emacs -Q etc/compilation.txt" and scrolling down to the perl
section shows none of the sample perl errors matched at all, where I
hoped they would be.

I think the "^" anchor added by compilation-mode-font-lock-keywords
means perl and some other more obscure patterns need a ".*", like they
had back in Emacs 21, to work in the middle of a line.

I noticed this on the perl one.  I thought it was working fine not so
long ago, so I don't know what/when/how it went bad.  (The looseness of
Emacs 22 not anchoring reverted, but the patterns not put back at the
same time too??)

2009-07-25  Kevin Ryde  <[email-masked]>

	* progmodes/compile.el (compilation-error-regexp-alist-alist):
	In aix, ftnchek, mips-1, mips-2, perl, sun, 4bsd entries add ".*" so
	as to match in the middle of a line, now that there's a "^" anchor is
	again enforced by compilation-mode-font-lock-keywords.  These patterns
	were otherwise failing to match anything at all.
	In the 4bsd entry remove the "^" from inside the \\(\\) grouping since
	it's now unnecessary and since inside a group it isn't recognised by
	the omake indentation hack in compilation-mode-font-lock-keywords
	(meaning it wouldn't work with indentation).

*** compile.el	11 Jul 2009 07:12:48 +1000	1.495
--- compile.el	25 Jul 2009 21:55:50 +1000	
***************
*** 173,179 ****
       "\\(warning: .*\\)? at \\([^ \n]+\\):\\([0-9]+\\)$" 2 3 nil (1))
  
      (aix
!      " in line \\([0-9]+\\) of file \\([^ \n]+[^. \n]\\)\\.? " 2 1)
  
      (ant
       "^[ \t]*\\[[^] \n]+\\][ \t]*\\([^: \n]+\\):\\([0-9]+\\):\\(?:\\([0-9]+\\):[0-9]+:[0-9]+:\\)?\
--- 173,179 ----
       "\\(warning: .*\\)? at \\([^ \n]+\\):\\([0-9]+\\)$" 2 3 nil (1))
  
      (aix
!      ".* in line \\([0-9]+\\) of file \\([^ \n]+[^. \n]\\)\\.? " 2 1)
  
      (ant
       "^[ \t]*\\[[^] \n]+\\][ \t]*\\([^: \n]+\\):\\([0-9]+\\):\\(?:\\([0-9]+\\):[0-9]+:[0-9]+:\\)?\
***************
*** 207,213 ****
       "^Error [0-9]+ at (\\([0-9]+\\):\\([^)\n]+\\))" 2 1)
  
      (ftnchek
!      "\\(^Warning .*\\)? line[ \n]\\([0-9]+\\)[ \n]\\(?:col \\([0-9]+\\)[ \n]\\)?file \\([^ :;\n]+\\)"
       4 2 3 (1))
  
      (iar
--- 207,213 ----
       "^Error [0-9]+ at (\\([0-9]+\\):\\([^)\n]+\\))" 2 1)
  
      (ftnchek
!      "\\(Warning\\)?.* line[ \n]\\([0-9]+\\)[ \n]\\(?:col \\([0-9]+\\)[ \n]\\)?file \\([^ :;\n]+\\)"
       4 2 3 (1))
  
      (iar
***************
*** 284,292 ****
  
      ;; Should be lint-1, lint-2 (SysV lint)
      (mips-1
!      " (\\([0-9]+\\)) in \\([^ \n]+\\)" 2 1)
      (mips-2
!      " in \\([^()\n ]+\\)(\\([0-9]+\\))$" 1 2)
  
      (msft
       ;; AFAWK, The message may be a "warning", "error", or "fatal error".
--- 284,292 ----
  
      ;; Should be lint-1, lint-2 (SysV lint)
      (mips-1
!      ".* (\\([0-9]+\\)) in \\([^ \n]+\\)" 2 1)
      (mips-2
!      ".* in \\([^()\n ]+\\)(\\([0-9]+\\))$" 1 2)
  
      (msft
       ;; AFAWK, The message may be a "warning", "error", or "fatal error".
***************
*** 308,314 ****
      ;; warnings" in recent perl when breaking circular references
      ;; during program or thread exit.
      (perl
!      " at \\([^ \n]+\\) line \\([0-9]+\\)\\(?:[,.]\\|$\\| \
  during global destruction\\.$\\)" 1 2)
  
      (php
--- 308,314 ----
      ;; warnings" in recent perl when breaking circular references
      ;; during program or thread exit.
      (perl
!      "XXXXXXXXXX.* at \\([^ \n]+\\) line \\([0-9]+\\)\\(?:[,.]\\|$\\| \
  during global destruction\\.$\\)" 1 2)
  
      (php
***************
*** 332,338 ****
       nil 1 nil (3) nil (2 (compilation-face '(3))))
  
      (sun
!      ": \\(?:ERROR\\|WARNIN\\(G\\)\\|REMAR\\(K\\)\\) \\(?:[[:alnum:] ]+, \\)?\
  File = \\(.+\\), Line = \\([0-9]+\\)\\(?:, Column = \\([0-9]+\\)\\)?"
       3 4 5 (1 . 2))
  
--- 332,338 ----
       nil 1 nil (3) nil (2 (compilation-face '(3))))
  
      (sun
!      ".*: \\(?:ERROR\\|WARNIN\\(G\\)\\|REMAR\\(K\\)\\) \\(?:[[:alnum:] ]+, \\)?\
  File = \\(.+\\), Line = \\([0-9]+\\)\\(?:, Column = \\([0-9]+\\)\\)?"
       3 4 5 (1 . 2))
  
***************
*** 345,351 ****
       1 2 nil (4))
  
      (4bsd
!      "\\(?:^\\|::  \\|\\S ( \\)\\(/[^ \n\t()]+\\)(\\([0-9]+\\))\
  \\(?:: \\(warning:\\)?\\|$\\| ),\\)" 1 2 nil (3))
  
      (gcov-file
--- 345,351 ----
       1 2 nil (4))
  
      (4bsd
!      "^\\(?:\\|.*::  \\|.*\\S ( \\)\\(/[^ \n\t()]+\\)(\\([0-9]+\\))\
  \\(?:: \\(warning:\\)?\\|$\\| ),\\)" 1 2 nil (3))
  
      (gcov-file

In GNU Emacs 23.1.50.4 (i586-pc-linux-gnu, GTK+ Version 2.16.4)
 of 2009-07-24 on blah.blah
configured using `configure  'CFLAGS=-O -g' '--prefix=/down/emacs/b/inst' '--with-x-toolkit=gtk''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_AU
  value of $XMODIFIERS: nil
  locale-coding-system: iso-latin-1-unix
  default-enable-multibyte-characters: t