diff --git a/modules/lang/cc/autoload.el b/modules/lang/cc/autoload.el index 35fc4b736..d14f7c28e 100644 --- a/modules/lang/cc/autoload.el +++ b/modules/lang/cc/autoload.el @@ -92,7 +92,8 @@ compilation dbs." ;;;###autoload (defun +cc|init-rtags () "Start an rtags server in c-mode and c++-mode buffers." - (when (memq major-mode '(c-mode c++-mode)) + (when (and (memq major-mode '(c-mode c++-mode)) + (rtags-executable-find "rtags")) (rtags-start-process-unless-running))) ;;;###autoload diff --git a/modules/lang/cc/config.el b/modules/lang/cc/config.el index fd25c0a7b..565dc5f49 100644 --- a/modules/lang/cc/config.el +++ b/modules/lang/cc/config.el @@ -213,7 +213,7 @@ compilation database is present in the project.") ;; (def-package! rtags - :commands (rtags-restart-process rtags-start-process-unless-running) + :commands (rtags-restart-process rtags-start-process-unless-running rtags-executable-find) :init (add-hook! (c-mode c++-mode) #'+cc|init-rtags) :config