Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake-ide-set-compiler-flags doesn't set company-c-headers-path-system correctly #108

Open
glowthrower opened this issue May 28, 2017 · 1 comment

Comments

@glowthrower
Copy link
Contributor

glowthrower commented May 28, 2017

The function cmake-ide-set-compiler-flags doesn't seem to set the company-c-headers-path-system variable correctly. For example, if I execute the following in *scratch* (after loading cmake-ide and company-c-headers):

(cmake-ide-set-compiler-flags (current-buffer) () () '("/foo" "/bar"))
(describe-variable 'company-c-headers-path-system)

then I get

company-c-headers-path-system is a variable defined in ‘company-c-headers.el’.
Its value is (("/foo" "/bar") "/usr/include/" "/usr/local/include/")

Original value was 
("/usr/include/" "/usr/local/include/")

Note that the first element of the variable is a nested list, which isn't what company-c-headers expects. This causes an error to occur when, for example, one starts to insert a new include statement and company-c-headers functionality is triggered.

Fortunately it's pretty easy to fix -- all that's required is a slight tweak to the code inside cmake-ide-set-compiler-flags, specifically in the when-clause predicated upon (featurep 'company-c-headers). I can submit a pull request (with supporting unit test) if you want.

@atilaneves
Copy link
Owner

Thanks for looking into this and analysing the issue. Yes, please submit a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants