racer-rust / emacs-racer

Racer support for Emacs
398 stars 48 forks source link

Readme instructions related to Company gives a warning #58

Closed saheel1115 closed 8 years ago

saheel1115 commented 8 years ago

Specifically, including the define-key statement that tells Company to use TAB for completion results in this:

Warning (initialization): An error occurred while loading `/home/saheel/.emacs':

Symbol's value as variable is void: rust-mode-map

If I do not include the define-key statement I can still use TAB for completion, hence I simply removed that statement. Nonetheless, wanted to report the issue. I have tried this on two distinct Ubuntu 16.04 machines with the same result. Am I doing something incorrectly?

For reference, here are the 3 lines of code related to Company, of which the second line is the culprit:

(add-hook 'racer-mode-hook #'company-mode)

(define-key rust-mode-map (kbd "TAB") #'company-indent-or-complete-common)
(setq company-tooltip-align-annotations t)
Wilfred commented 8 years ago

This should now be sorted: you need (require 'rust-mode) before you access rust-mode-map.