-
Notifications
You must be signed in to change notification settings - Fork 119
derive from prog-mode not from c-mode #409
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
Conversation
Thank you for the patches. Coincidentally I was looking at the project tonight for the first time in weeks (months?) and saw this pull-request and the related issue. Just two comments I wanted to make in passing:
Anyway, those are just the two things that came to mind. Thank you for the pull-request. And my thanks in advance to @zonuexe for handling the merging of this and any related changes. It has made me very happy tonight to look over the project and see all of his time and effort spent maintaining PHP Mode. |
@ejmr thanks for the kind words and the knowledge :) A few questions:
|
|
Deriving from c-mode results in a few unwanted side effects like the execution of the c-mode-hook everytime php-mode is enabled. Deriving from a major mode makes only sense if the mode is a specialization of the derived mode (like ng2-mode deriving from typescript mode as it adds only features and it makes sense that the typescript hook is being run). Also there could be some workarounds for c-mode specific issues which can be removed now (but haven't for the most now) This commit does not touch the usage of cc-mode stuff like c-lang-defconst and c-add-language. Instead of deriving c-mode to inherit the syntax table c-populate-syntax-table is called directly. The only workaround removed was the defcustom var php-do-not-use-semantic-imenu which was a workaround for a broken imenu when using semantic-mode (as c-mode enables semantic-imenu and the setting was inherited) which is not necessary anymore. Github Issue: #407
FYI: I rebased the commits and updated the commit message. |
That new commit message is really well-written and would make a great example in the future of the level of quality that should be the standard (in my opinion). Thank you very much for the addition. |
This is a quick shot not to derive from
c-mode
but usingcc-mode
functions. This is more a proof of concept than a thought through solution. I have tested it on a few files an I haven't found any misbehaviour for now. Maybe this can be elaborated upon? Some of the existingphp-mode
code maybe unnecessary now which worked around the limitations of being a derived mode fromc-mode.
@zonuexe I will surely update this branch removing such code parts and fixing any issues I find while using it, so don't feel pressured merging it quickly. If you have time reviewing it, maybe you can give your ideas, too?
Github Issue: #407