branch: externals/phps-mode commit 11e151afb79b4d93376b6e310751341c6a7e3e1f Author: Christian Johansson <christ...@cvj.se> Commit: Christian Johansson <christ...@cvj.se>
Fixed linting issues in flycheck file --- README.md | 7 +++++-- phps-mode-flycheck.el | 3 ++- phps-mode-test-functions.el | 2 +- phps-mode.el | 6 +++++- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3b9c7b9..aa4e05a 100644 --- a/README.md +++ b/README.md @@ -100,11 +100,14 @@ make clean Download to `~/.emacs.d/phps-mode/` and then add this to your init file: -### Using use-package +### Using use-package with flycheck support ``` emacs-lisp (add-to-list 'load-path (expand-file-name "~/.emacs.d/phps-mode/")) (use-package phps-mode - :mode ("\\.php\\'" "\\.phtml\\'")) + :after flycheck + :mode ("\\.php\\" "\\.phtml\\") + :config + (setq phps-mode-flycheck-support t)) ``` diff --git a/phps-mode-flycheck.el b/phps-mode-flycheck.el index f9de0f9..c2a0965 100644 --- a/phps-mode-flycheck.el +++ b/phps-mode-flycheck.el @@ -1,6 +1,6 @@ ;;; phps-mode-flycheck.el --- Flycheck support for PHPs -*- lexical-binding: t -*- -;; Copyright (C) 2018 Christian Johansson +;; Copyright (C) 2018-2019 Christian Johansson ;; This file is not part of GNU Emacs. @@ -28,6 +28,7 @@ ;;; Code: +(require 'flycheck) (defun phps-mode-flycheck-init () "Add flycheck support for PHP Semantic mode." diff --git a/phps-mode-test-functions.el b/phps-mode-test-functions.el index bbabaa4..904b5ef 100644 --- a/phps-mode-test-functions.el +++ b/phps-mode-test-functions.el @@ -953,7 +953,7 @@ (defun phps-mode-test-functions () "Run test for functions." - ;; (setq debug-on-error t) + (setq debug-on-error t) ;; (setq phps-mode-functions-verbose t) (phps-mode-test-functions-get-lines-indent-if) (phps-mode-test-functions-get-lines-indent-classes) diff --git a/phps-mode.el b/phps-mode.el index b890e3d..9d74de5 100644 --- a/phps-mode.el +++ b/phps-mode.el @@ -58,6 +58,9 @@ (defvar phps-mode-idle-interval 1.0 "Idle seconds before running incremental lexer.") +(defvar phps-mode-flycheck-support nil + "Boolean whether flycheck support should be enabled or not.") + (define-derived-mode phps-mode prog-mode "PHPs" "Major mode for PHP with Semantic integration." @@ -74,7 +77,8 @@ ;; (phps-mode-flymake-init) ;; Flycheck - (phps-mode-flycheck-init) + (when phps-mode-flycheck-support + (phps-mode-flycheck-init)) ;; Override functions (phps-mode-functions-init)