changeset 91816:5ec7c3d5aa70

add support to flymake for php, add support to flymake for perl module files (.pm)
author Mark A. Hershberger <mah@everybody.org>
date Wed, 13 Feb 2008 19:30:58 +0000
parents 547135392244
children f0b22bbb77fb
files lisp/ChangeLog lisp/progmodes/flymake.el
diffstat 2 files changed, 20 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Wed Feb 13 17:28:00 2008 +0000
+++ b/lisp/ChangeLog	Wed Feb 13 19:30:58 2008 +0000
@@ -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
--- a/lisp/progmodes/flymake.el	Wed Feb 13 17:28:00 2008 +0000
+++ b/lisp/progmodes/flymake.el	Wed Feb 13 19:30:58 2008 +0000
@@ -271,7 +271,8 @@
     ("\\.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 @@
       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 @@
                        (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))