-
Notifications
You must be signed in to change notification settings - Fork 107
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
Support for mmm-mode #169
Comments
Do you think it would be hard to add support for mmm-mode? I'm currently
using that to support vue-mode. It seems that other people have had trouble
with that in the past: AdamNiederer/vue-mode#52.
Adding support for a new major mode is fairly easy, it is just adding the
major mode and the variable to set to this list:
https://github.com/editorconfig/editorconfig-emacs/blob/master/editorconfig.el#L119
I'm not sure if mmm-mode (or vue-mode) is a minor mode or not though, in which
case it might add complications.
Let me know if you have questions, and I can try to help you out.
|
Thanks for the quick response! mmm-mode is a minor mode that allows for multiple major modes to co-exist in the same buffer. Vue for example has the concept of single file components where HTML, CSS and JS are combined in a single file per reactive component. Opening up a file with vue-mode (which is based on mmm-mode) will call the hooks of the respective major modes for the different parts of the code that the single component file contains. I noticed however that |
We currently always work with major mode. When using vue-mode, I guess you also have to use some js major mode. Is this correct? |
I see. That probably makes sense since I don't see how the current EditorConfig syntax can support different settings for the various parts of the same file. In that case, is it then better to ignore this issue, and perhaps consider supporting vue-mode directly? (with-eval-after-load 'editorconfig
(add-to-list 'editorconfig-indentation-alist
'(vue-mode css-indent-offset
js-indent-level
sgml-basic-offset
ssass-tab-width
))) |
This is a list of modes that vue-mode currently supports. I didn't look up the indentation settings for all possible submodes. I also don't know if we need anything apart from indentation settings. |
I think the simplest solution is to list up all possible offset variables in editorconfig-indentation-alist, as you just wrote above (and IMO it is OK to merge this to this repository). It is true that it seems to be hard to "support" mmm-mode when buffer-file-name will not be set when it calls mode hooks... |
The similar solution can be apply to
|
Thank you for writing and maintaining this plugin!
Do you think it would be hard to add support for mmm-mode? I'm currently using that to support vue-mode. It seems that other people have had trouble with that in the past: AdamNiederer/vue-mode#52.
I'm not too familiar with Emacs Lisp, but I think the main issue is that the buffer-file-name isn't set for the sub-modes?
Thank you!
The text was updated successfully, but these errors were encountered: