> That would be overly expensive. I rewrote all this with ppss, two
> markers, a before-change-functions hook and without any text properties.
> It seems to work but needs some further testing.
> That is interesting. I would not have expected it to work.
> However, this would require doing that computation for each change,
> and that could be rather expensive, right?
Shouldn't be particularly expensive: syntax-ppss is called by font-lock
anyway, and since it uses caching, calling it a couple more times around the
same spot is pretty cheap.
> One advantage for the idea of saving it in a text property for the
> first character on each line is that it only has to be checked
> when it is time to refontify.
What his patch does is pretty much the same except he uses
before-change-functions in order to lazily only store the syntax-ppss of the
line after the change, whereas you'd eagerly store it for every line in
the buffer.
> Another possible advantage is: if things are not in sync for the first
> line after the end of the changed text, it might be in sync on a
> subsequent line, and that could avoid refontifying most of the lines
> on the screen.
My gut feeling is that this is way past the point of diminishing returns.
Already his optimization is rarely noticeable, but breaks a couple
(rare) special cases.
Stefan
_______________________________________________
Emacs-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/emacs-devel