add support to flymake for php, add support to flymake for perl module files (.pm)
authorMark A. Hershberger <mah@everybody.org>
Wed, 13 Feb 2008 19:30:58 +0000 (19:30 +0000)
committerMark A. Hershberger <mah@everybody.org>
Wed, 13 Feb 2008 19:30:58 +0000 (19:30 +0000)
lisp/ChangeLog
lisp/progmodes/flymake.el

index d95e064..8769283 100644 (file)
@@ -1,3 +1,10 @@
+2008-02-14  Mark A. Hershberger  <mah@everybody.org>
+
+       * progmodes/flymake.el (flymake-allowed-file-name-masks): Add
+       support for .pm files and .php files.
+       (flymake-err-line-patterns): Add pattern for PHP errors.
+       (flymake-php-init): New function.  PHP support for flymake.
+
 2008-02-13  Michael Albinus  <michael.albinus@gmx.de>
 
        * net/ange-ftp.el (ange-ftp-quote-string): Use
index 6de464b..757afdd 100644 (file)
@@ -271,7 +271,8 @@ are the string substitutions (see `format')."
     ("\\.xml\\'" flymake-xml-init)
     ("\\.html?\\'" flymake-xml-init)
     ("\\.cs\\'" flymake-simple-make-init)
-    ("\\.pl\\'" flymake-perl-init)
+    ("\\.p[ml]\\'" flymake-perl-init)
+    ("\\.php[345]?\\'" flymake-php-init)
     ("\\.h\\'" flymake-master-make-header-init flymake-master-cleanup)
     ("\\.java\\'" flymake-simple-make-java-init flymake-simple-java-cleanup)
     ("[0-9]+\\.tex\\'" flymake-master-tex-init flymake-master-cleanup)
@@ -916,6 +917,8 @@ Convert it to flymake internal format."
       1 3 nil 4)
      ;; perl
      ("\\(.*\\) at \\([^ \n]+\\) line \\([0-9]+\\)[,.\n]" 2 3 nil 1)
+     ;; PHP
+     ("\\(?:Parse\\|Fatal\\) error: \\(.*\\) in \\(.*\\) on line \\([0-9]+\\)" 2 3 nil 1)
      ;; LaTeX warnings (fileless) ("\\(LaTeX \\(Warning\\|Error\\): .*\\) on input line \\([0-9]+\\)" 20 3 nil 1)
      ;; ant/javac
      (" *\\(\\[javac\\] *\\)?\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)\:\\([0-9]+\\)\:[ \t\n]*\\(.+\\)"
@@ -1725,6 +1728,15 @@ Use CREATE-TEMP-F for creating temp copy."
                        (file-name-directory buffer-file-name))))
     (list "perl" (list "-wc " local-file))))
 
+;;;; php-specific init-cleanup routines
+(defun flymake-php-init ()
+  (let* ((temp-file   (flymake-init-create-temp-buffer-copy
+                       'flymake-create-temp-inplace))
+        (local-file  (file-relative-name
+                       temp-file
+                       (file-name-directory buffer-file-name))))
+    (list "php" (list "-f" local-file "-l"))))
+
 ;;;; tex-specific init-cleanup routines
 (defun flymake-get-tex-args (file-name)
   ;;(list "latex" (list "-c-style-errors" file-name))