Use configured variables for rtags binary names

This commit is contained in:
Shanavas M 2019-02-27 12:49:33 +05:30
parent c85565cfef
commit 1f63358947
3 changed files with 7 additions and 6 deletions

View file

@ -106,7 +106,7 @@ simpler."
;; first rtag ;; first rtag
(when (and (featurep 'rtags) (when (and (featurep 'rtags)
rtags-enabled rtags-enabled
(executable-find "rc")) (executable-find rtags-rc-binary-name))
(with-temp-buffer (with-temp-buffer
(message "Reloaded compile commands for rtags daemon") (message "Reloaded compile commands for rtags daemon")
(rtags-call-rc :silent t "-J" (or (doom-project-root) default-directory)))) (rtags-call-rc :silent t "-J" (or (doom-project-root) default-directory))))

View file

@ -191,7 +191,7 @@ compilation database is present in the project.")
(defun +cc|init-rtags () (defun +cc|init-rtags ()
"Start an rtags server in c-mode and c++-mode buffers." "Start an rtags server in c-mode and c++-mode buffers."
(when (and (memq major-mode '(c-mode c++-mode)) (when (and (memq major-mode '(c-mode c++-mode))
(rtags-executable-find "rdm")) (rtags-executable-find rtags-rdm-binary-name))
(rtags-start-process-unless-running))) (rtags-start-process-unless-running)))
(add-hook 'c-mode-common-hook #'+cc|init-rtags) (add-hook 'c-mode-common-hook #'+cc|init-rtags)
:config :config

View file

@ -1,10 +1,11 @@
;; -*- lexical-binding: t; no-byte-compile: t; -*- ;; -*- lexical-binding: t; no-byte-compile: t; -*-
;;; lang/cc/doctor.el ;;; lang/cc/doctor.el
;; rtags (when (require 'rtags nil t)
(let ((bins (cl-remove-if #'executable-find '("rdm" "rc")))) ;; rtags
(when (/= (length bins) 0) (let ((bins (cl-remove-if #'executable-find `(,rtags-rdm-binary-name ,rtags-rc-binary-name))))
(warn! "Couldn't find the rtag client and/or server programs %s. Disabling rtags support" bins))) (when (/= (length bins) 0)
(warn! "Couldn't find the rtag client and/or server programs %s. Disabling rtags support" bins))))
;; irony server ;; irony server
(when (require 'irony nil t) (when (require 'irony nil t)