Re: catastrophic failure under MMM
Zack Weinberg <zack <at> codesourcery.com>
2004-12-04 19:55:45 GMT
Martin Stjernholm <mast <at> lysator.liu.se> writes:
>> The overlay contains its own limits, by definition. /.../
>
> I know, but from the looks of it those limits can include some padding
> stuff that doesn't follow the syntax of the submode. In MMM terms,
> they give the "front start" and "back end" of the region, which
> includes the "front" and "back delimiters". In the major mode I don't
> want to see those delimiters, i.e. I want the "front end" and "back
> start" positions. Or have I misunderstood the meaning of "delimiters"
> here?
It depends on the nature of the delimiters... I'm not familiar with
noweb syntax, but consider Javascript embedded in HTML: the delimiters
are "<script>" and "</script>". Clearly these should be treated as
HTML, not Javascript. Contrariwise, in the mode I'm trying to write
(for GCC machine descriptions) the delimiters are "^{" and "^}", and
*should* be treated as C, or at least that makes the most sense to me.
MMM handles this with the :include-front and :include-back tags on its
classes. If they are true, the delimiters are included in the region;
if they are false, they aren't. I'd think that you could rely on the
class author to set these correctly, and assume that the overlay
limits were sane.
> However, it's unfortunately not a feasible way to find out the
> subregions that CC Mode should ignore. It must be possible to match
> them inside a generic regexp. I can adapt all searches inside CC Mode
> to heed whitespace syntax, as well as the generic string and comment
> delimiter syntaxes. I'd prefer the latter, though.
(Continue reading)