Sarcasm / irony-mode

A C/C++ minor mode for Emacs powered by libclang
GNU General Public License v3.0
906 stars 99 forks source link

Irony and php-mode compatibility issues #471

Open yuzumx opened 6 years ago

yuzumx commented 6 years ago

Hello:

I mentioned this issue in #410 .

I revisit this because I think that this feature needs to be improved, not just provide a workaround.

Because php-mode wakes up c-mode, this is not a configuration issue, but it's Emacs defaults.

Sorry for my poor English.

Thank you very much!

Sarcasm commented 6 years ago

I don't consider my answer a "workaround". Do you have something in mind that would be better?

yuzumx commented 6 years ago

I also have no idea, because until now I am still an ELisp rookie, Sorry.

I don't know if there is any way to hide this error, or do support php-mode ...... but I can think of that is a huge project. I personally prefer to hide the error and not enable irony-mode, and write it out in the README.

In addition, I think it is a workaround because I have to start irony-mode in another way...

yuzumx commented 6 years ago

@Sarcasm I can't seem to find any good way to solve this problem...

I can only think of two ways to solve this problem now:

  1. Add your answer in #410 to the README as the default configuration for enabling irony-mode.
  2. Hide the error message and turn off irony-mode in PHP mode.

I think there are still a lot of people who use both irony-mode and php-mode...so I think it is necessary to add a description for this.

And... about the function in your answer, I have the following changes:

(defun my-enable-irony-mode ()
    (when (memq major-mode '(c-mode c++-mode objc-mode))
      (irony-mode 1)))

This avoids irony-supported-major-modes is void when lazy load irony-mode.

Thanks.