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

Warnings when opening PHP files with the default configuration #27

Open
MatMercer opened this issue Sep 26, 2016 · 1 comment
Open

Warnings when opening PHP files with the default configuration #27

MatMercer opened this issue Sep 26, 2016 · 1 comment

Comments

@MatMercer
Copy link

MatMercer commented Sep 26, 2016

Annoying messages shows up when I open PHP files.
I use company-irony and I have read that this happens because of the hooks:
Answer
But even using the settings above didn't fix the problem. My init.el file is here:
init.el

Irony mode configuration is at line 67.

screenshot from 2016-09-26 18 49 06

Thanks.

@Sarcasm
Copy link
Owner

Sarcasm commented Sep 30, 2016

When you see this warning you have 2 options.

Either irony-mode will work perfectly in this mode and you add the mode to irony-supported-major-modes, or the mode, like PHP in your case does not work and you should not enable irony in this case.

If you use the standard irony mode configuration:

(add-hook 'c++-mode-hook 'irony-mode)
(add-hook 'c-mode-hook 'irony-mode)

It's possible that php-mode is derived from c-mode or something like that, and the c-mode-hook is invoked, enabling irony-mode.

You have to change these 2 lines with something different, for example (not tested):

(defun my-irony-enable ()
  (when (memq major-mode irony-supported-major-modes))
     (irony-mode 1)))

(add-hook 'c++-mode-hook 'my-irony-enable)
(add-hook 'c-mode-hook 'my-irony-enable)

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