[Top][All Lists]

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

Re: Bug #25608 and the comment-cache branch

From: Stefan Monnier
Subject: Re: Bug #25608 and the comment-cache branch
Date: Mon, 13 Feb 2017 00:50:32 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

> How about adding two text properties like island-major-mode and
> island-variables? All chars in the same island have the same values of
> the two text properties.

A multi-major-mode package could use such a strategy, but I don't think
we want to hard-code such a thing directly in font-lock and syntax-ppss.
Instead, we should focus on an intermediate API that syntax-ppss and
font-lock can use on one side and which a new island-mode mmm can use on
the other.

E.g. sgml-mode may want to occasionally treat a tag as "an island"
(i.e. parse it using a special syntax-table and ignoring the surrounding
context), during some internal processing (e.g. within a limited dynamic
scope), but it wouldn't want to have to place text-properties for that:
let-binding vars would be a lot more convenient.

Similarly, it would be a lot more convenient for syntax-ppss to consult
some dynamically-scoped variable to find the "beginning of (sub)buffer",
rather than having to scan text properties.

So, I think something along the lines of prog-indentation-context would
be more appropriate (and an island-mode could still consult
text-properties to then temporarily set some dynamically scoped variable).


reply via email to

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