|
From: | Dmitry Gutov |
Subject: | Re: html, css, and js modes working together |
Date: | Tue, 7 Feb 2017 13:28:38 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0 |
On 07.02.2017 05:40, Tom Tromey wrote:
Dmitry> It indents fine. Now try replacing "4" with "4 < 5" and reindenting Dmitry> the "alert" line. It jumps to the right. I debugged this tonight. The problem here is that sgml-parse-tag-backward looks for "<" or ">" characters, but doesn't consider the syntax. The appended patch fixes this test case.
It should work. But maybe another thing to try is avoid using sgml-get-context as the dispatch function for html-indent-line.
After all, html-syntax-propertize-function already knows how to find the limits of the hunks. The method may change, but hopefully you'd be able to reuse it. It could also leave a text property (or some overlays) which the indentation function can look up.
My hope is that the html-syntax-propertize-function -- maybe not the one I wrote but one that's been fixed according to the various comments in this thread -- should suffice to fix all such problems in principle.
I think so. IME adding syntax-table property on such `<` and `>` works well enough. And the main issue to look out for is indentation of HTML tags following the tags with such rogue < and > inside.
Something like this problem in sgml-parse-tag-backward doesn't invalidate the scheme; this is just a buglet. What do you think?
I agree, at least as far as this specific combination of modes in concerned. Things get complicated when we try to combine arbitrary modes.
[Prev in Thread] | Current Thread | [Next in Thread] |