From 8d0d2cdf4e997b68453a8efe99a4a8d3a3d3be2a Mon Sep 17 00:00:00 2001 From: Hugo Thunnissen Date: Mon, 25 Apr 2022 10:00:11 +0200 Subject: [PATCH] Emacs: Only load/use phpinspect when it is present on the system --- emacs/init.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/emacs/init.el b/emacs/init.el index af112a6..193e387 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -129,6 +129,7 @@ (setq flycheck-emacs-lisp-load-path 'inherit) + ;; END GLOBAL MODES ;;;;;;;;;;;;;;;;;;;;; @@ -195,7 +196,6 @@ (add-to-list 'auto-mode-alist `("\\.php$" . php-mode)) -;;;###autoload (defun hugot-php-personal-hook () (require 'expand) @@ -217,6 +217,13 @@ (phpinspect-mode)) +(let ((phpinspect-dir "~/projects/phpinspect.el")) + (when (file-exists-p phpinspect-dir) + (add-to-list 'load-path phpinspect-dir))) + +(when (require 'phpinspect nil t) + (add-hook 'php-mode-hook #'hugot-php-personal-hook)) + ;; END PHP ;;;;;;;;;;;;;;;