My development environment works as follows:

Working locally on a MacOS laptop with Emacs without a local code repository (or any development tools e.g. clang) Code is remote on an Ubuntu development VM; also C++ dev tools

Currently I edit with tramp mode and things are awesome. I just went through setting up rtags (rdm running on the VM, rc via tramp) and that works as well. Where I'm stuck is trying to add in company mode. Here's my .emacs:

; Setup rtags key bindings and turn on company mode                                             
(when (require 'rtags nil :noerror)
  ;; make sure you have company-mode installed                                                  
  (require 'company)
  (define-key c-mode-base-map (kbd "M-.") `rtags-find-symbol)
  (define-key c-mode-base-map (kbd "M-,") `rtags-find-references)
  ;; install standard rtags keybindings.                                                        
  (setq rtags-autostart-diagnostics t)
  (setq rtags-completions-enabled t)
  (push 'company-rtags company-backends)
  (define-key c-mode-base-map (kbd "<C-tab>") (function company-complete)))

(a mildly hacked version of https://vxlabs.com/2016/04/11/step-by-step-guide-to-c-navigation-and-completion-with-emacs-and-the-clang-based-rtags/)

However, with company mode enabled, it's trying to run clang on my laptop - I get a prompt to install clang from XCode every time I open Emacs up. I don't want this; how can I tell company mode to run clang via tramp?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.