[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Flymake PHP Emacs

From: lampshade
Subject: Flymake PHP Emacs
Date: Thu, 3 Jan 2008 21:52:21 -0800 (PST)
User-agent: G2/1.0


I've been trying to get flymake to work with PHP based off of a blog
post I saw here

But I've run into problems with it.  When I try to enable it, I
receive the error

Flymake: Configuration error has occured while running (php -l
myfile.php). Flymake will be switched OFF

Nothing else appears in the message buffer.

my .emacs looks like
(add-to-list 'load-path "~/.emacs.d/")
(load "~/.emacs.d/flymake.php.el")
(require 'flymake-php)
(add-hook 'php-mode-user-hook 'flymake-php-load)

;; Flymake PHP Extension

(require 'flymake)

(defconst flymake-allowed-php-file-name-masks '(
("\\.php3\\'" flymake-php-init)
("\\.inc\\'" flymake-php-init)
("\\.php\\'" flymake-php-init))
"Filename extensions that switch on flymake-php mode syntax checks")

(defconst flymake-php-err-line-pattern-re '("(Parse|Fatal) error: (.*)
in (.*) on line ([0-9]+)" 3 4 nil 2)
"Regexp matching PHP error messages")

(defun flymake-php-init ()
(let* ((temp-file (flymake-init-create-temp-buffer-copy
(local-file (file-relative-name
(file-name-directory buffer-file-name))))
;;(list "php" (list "-f" local-file "-l"))))
(list "php" (list "-l" local-file))))

(defun flymake-php-load ()
(setq flymake-allowed-file-name-masks (append flymake-allowed-file-
name-masks flymake-allowed-php-file-name-masks))
(setq flymake-err-line-patterns (cons flymake-php-err-line-pattern-re
(flymake-mode t)
(local-set-key "C-cd" 'flymake-display-err-menu-for-current-line))

(provide 'flymake-php)

Any ideas?

Thanks in advance,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]