branch: elpa/drupal-mode
commit 0a5c95331258c00cfd1d4a254e0250d34acc7242
Author: Arne Jørgensen <[email protected]>
Commit: Arne Jørgensen <[email protected]>
flymake-phpcs will only be used in php-mode.
---
drupal/flymake-phpcs.el | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/drupal/flymake-phpcs.el b/drupal/flymake-phpcs.el
index a0eec709bb..6eaee99b2d 100644
--- a/drupal/flymake-phpcs.el
+++ b/drupal/flymake-phpcs.el
@@ -8,13 +8,14 @@
(defun drupal/flymake-phpcs-enable ()
"Enable drupal-mode support for flymake-phpcs."
- (when (and (executable-find flymake-phpcs-command)
- (ignore-errors
- (string-match
- "Drupal"
- (with-output-to-string
- (with-current-buffer standard-output
- (call-process (executable-find flymake-phpcs-command) nil
(list t nil) nil "-i"))))))
+ (when (and (eq major-mode 'php-mode)
+ (executable-find flymake-phpcs-command)
+ (ignore-errors
+ (string-match
+ "Drupal"
+ (with-output-to-string
+ (with-current-buffer standard-output
+ (call-process (executable-find flymake-phpcs-command) nil
(list t nil) nil "-i"))))))
(set (make-local-variable 'flymake-phpcs-standard) "Drupal")
;; We have probably set `flymake-phpcs-standard' after a syntax
;; check was initiated - so kill it and start syntax check again.