[Top][All Lists]

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

Re: font-lock-syntactic-keywords obsolet?

From: Dmitry Gutov
Subject: Re: font-lock-syntactic-keywords obsolet?
Date: Sun, 19 Jun 2016 18:50:26 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2

On 06/19/2016 06:34 PM, Alan Mackenzie wrote:

What's a "logical line"?

What you get when you resolve the escaped new lines, or the non-escaped
new lines inside a C++ raw string.

But when the raw string is unclosed, it stretches until the end of the buffer, doesn't it? Hence, the effects of adding or removing a closer must affect the buffer until its end.

There's no reason to do so, and it would cost a lot of time.  The
syntax-propertize-function stuff just isn't a good way of impelementing
CC Mode.

A critical reason, which I've told you before, is that on any buffer
change, the syntax-propertize-function mechanism blasts all s-t
properties out of existence from the point the change is made onwards.
This is wasteful of run-time, given that these properties are quite
expensive to apply.

They can't be too expensive, considering other language modes, which do use syntax-propertize-function, exhibit fewer performance problems than CC Mode, even at the same file sizes.

And if the automatic removal of syntax-table properties would lose important information, you could save them to a separate structure.

Anyway, you're welcome to propose an alternative general abstraction for the same kind of thing than syntax-propertize does. font-lock-syntactic-keyword is definitely not that.

Maybe you'll need to hand-implement the logic corresponding to
syntax-propertize-rules, but that's just work.

In this context, both "just" and "work" are curse words.  :-)

"just implementation work", then. As opposed to "design and implementation".

reply via email to

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