-
Notifications
You must be signed in to change notification settings - Fork 33
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
Mason <%perl> section identifies as HTML submode instead of (c)perl-mode #141
Comments
Hi! Thanks for the kind words. When you say lines 18-19, which exact lines are you referring to? If it's about I'm also not seeing the The below config makes things work in my testing: (setq mmm-global-mode 'maybe)
(require 'mmm-mason)
(mmm-add-mode-ext-class nil "\\.mas\\'" 'mason)
(add-to-list 'auto-mode-alist '("\\.mason\\'" . html-mode)) We should probably also change |
Maybe you're referring to this line: (add-to-list 'mmm-mode-ext-classes-alist '(html-helper-mode nil html-js)) If this class's rules match the |
Thanks for replying. I think you've misunderstood me? I meant lines 18-19 of the
So, if I delete those two lines from the foo.mas file, the submode is correct (perl-mode). With those two lines in the file, the submode of the whole <%perl> section is wrong (html-helper-mode). |
Oh, sorry, I was replying to your first comment. I think you figured it out. I'll try changing the order and get back to you. Thanks! |
Well, I think it's working now. I think commenting out I think the ideal solution is something like PR #114 though, and I'm sad to see that that hasn't been merged in 3.5 years (because of legitimate problems, I'm sure, but I wish they'd been worked through). Anyway, thanks for the support. Cheers! |
IIUC it's solving a slightly different problem: infinite nesting. But even with that patch applied, parsing would still be affected by the order of classes in the list. To help with problem currently discussed, we'd either need to introduce class priorities (so that the order can be specified more explicitly, at least), or alter the algorithm in a way that would be able to recognize new regions even when they cross already-found ones, while retaining consistency. The latter is harder, though it doesn't seem impossible. |
Oh, I thought it was adding support for nested submodes, like sub-submodes and sub-sub-submodes, etc. I misunderstood. Anyway, thanks! |
Just to clarify. If your file has nesting like
then the list of classes has to be The PR above adds the ability for the nesting to be infinite (or very deep anyway), but doesn't change the above rule. |
I'm probably doing something wrong (some kind of precedence thing?), but when I load up the file attached below into my Emacs using mmm-mode version 0.5.11, I'm not getting (c)perl-mode in the
<%perl>
section. I'm getting "HTML helper" mode instead.Here's what I have in my
.emacs
:(I've tried it with and without the last three lines commented out. Same result.)
Here is the file I'm editing (rename it to
foo.mas
after downloding it):foo.mas.txt
Hmmm.... If I delete lines 18-19 from the file, then the whole
<%perl>
section does switch to (c)perl-mode. I guess the<script>
tags in the comments on these lines are somehow overriding the submode for the whole section. Why? What can be done about this?I've been using mmm-mode for something like 20 years, I think. I'm very appreciative of your efforts in developing and maintaining it. Thank you!
The text was updated successfully, but these errors were encountered: