diff --git a/modules/lang/php/autoload.el b/modules/lang/php/autoload.el index b5a6f9fb4..93b68eb43 100644 --- a/modules/lang/php/autoload.el +++ b/modules/lang/php/autoload.el @@ -18,7 +18,9 @@ ignore the cache." (defun +php|init-ac-php-core-eldoc () "Initialize eldoc support for `php-mode' with `ac-php-core'. Fails gracefully if phpctags isn't installed." - (require 'company-php) - (if (file-exists-p ac-php-ctags-executable) - (ac-php-core-eldoc-setup) - (message "phpctags is missing; eldoc support is disabled"))) + (require 'ac-php-core) + (cond ((not ac-php-ctags-executable)) + ((not (file-exists-p ac-php-ctags-executable)) + (message "Could not find phpctags executable, eldoc support is disabled") + (message "To disable these warnings, set ac-php-ctags-executable to nil")) + ((ac-php-core-eldoc-setup)))) diff --git a/modules/lang/php/config.el b/modules/lang/php/config.el index 47bd19712..6609f877d 100644 --- a/modules/lang/php/config.el +++ b/modules/lang/php/config.el @@ -73,14 +73,15 @@ :init (add-to-list '+php--company-backends 'company-ac-php-backend nil #'eq) (add-hook 'php-mode-hook #'+php|init-ac-php-core-eldoc) - :config (setq ac-php-tags-path (concat doom-cache-dir "ac-php/")) - ;; prioritize phpctags in PATH - (when (file-in-directory-p ac-php-ctags-executable ac-php-root-directory) - (setq ac-php-ctags-executable - (or (executable-find "phpctags") - (if (file-exists-p ac-php-ctags-executable) - ac-php-ctags-executable))))) + ;; loaded by `company-php' + (after! ac-php-core + (when (equal ac-php-ctags-executable + (concat ac-php-root-directory "phpctags")) + ;; prioritize phpctags in PATH + (setq ac-php-ctags-executable + (or (executable-find "phpctags") + ac-php-ctags-executable))))) ;;