emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: web-mode.el


From: Lennart Borgman
Subject: Re: web-mode.el
Date: Sat, 16 Jun 2012 12:55:41 +0200

On Sat, Jun 16, 2012 at 8:17 AM, Stefan Monnier
<address@hidden> wrote:
>>>> 2) sgml-indent-line calls sgml-parse-tag-backward, which does
>>>> (re-search-backward "[<>]"), finds "<" and performs simple regexp check.
>>>> Thus,<% if a<  3 %>  breaks indentation on following lines, until first
>>>> closing tag.
>>> I think we can treat this as a bug in sgml-indent-line, which should try
>>> and use syntax-ppss or something like that instead of regexps.
>> I wonder how that could be fixed exactly. parse-partial-sexp doesn't look
>> helpful, because it works with single characters, and sgml is concerned with
>> full tags. It also has to handle unclosed tags like <br>, some closing tags
>> are optional, and HTML 4 has self-closing tags.
>
> I think just checking after the regexp-match whether the match was found
> within a "comment" should do the trick, assuming we can get syntax-ppss
> (or some extension thereof) to treat "other modes" as comments.

So this is similar to a light version of my suggestion. Just change
one function instead of all functions that are reading the buffer. I
am beginning to like the idea ;-)

"syntax-ppss" then need a table of chunks. And there must be a way to
quickly switch that table.

Could it look like a macro, something like "with-chunks"? Will that
take care of "inner calls" to syntax-ppss in a correct way?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]