emacs-devel
[Top][All Lists]
Advanced

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

Re: font-lock-syntactic-keywords obsolet?


From: Alan Mackenzie
Subject: Re: font-lock-syntactic-keywords obsolet?
Date: Tue, 21 Jun 2016 15:26:53 +0000
User-agent: Mutt/1.5.24 (2015-08-30)

Hello, Dmitry.

On Tue, Jun 21, 2016 at 02:30:44AM +0300, Dmitry Gutov wrote:
> On 06/21/2016 01:45 AM, John Wiegley wrote:

> > There is really no need for this kind of tone. Alan is striving to solve a
> > problem;

> No, he's not. He doesn't have a specific problem he's trying to solve, 
> just a lot of opinions and one flimsy, tangentially related, bug report.

I think "lot of opinions" could be summed up in my insistence that there
are several strategies which can be adopted for handling syntax-table
text properties.  You seem to be of the opposite opinion, that there is
one single blessed way of doing this handling, and any other way is thus
the Wrong Thing.

As far as I am aware, there has never been a general discussion on
emacs-devel about this topic.  One isolated developer developed the
strategy you like, and he spread it around existing modes as far as he
could, again, without any consultation that I'm aware of.  If that
discussion had taken place, likely the strategy would be better thought
out, more widely applicable, and better implemented with less resulting
bad feeling.

[ .... ]

> Here's an example in Ruby:

>      a = `def

>      b = :`

> If you add ` at the end of the first line, the code will have one 
> meaning (with the last ` character having syntax-table property 
> "symbol"). Without it, another meaning, and no syntax-table property on 
> the last character.

> Now mentally insert 300000 lines of code between these lines, none of 
> them containing the character `. And imagine yourself adding and 
> removing the ` character at the end of the first line.

Thanks, that's an interesting example.

> If Emacs is supposed to keep the syntax-table value on the last 
> character up to date using after-change-functions, it will have to scan 
> the whole 300000 line buffer after every keypress.

Could it not restrict the scanning to cases where a "`" is inserted or
deleted?  Do you not have to do the scanning anyway when you type in "`"
at the end of the "b = :`" line?

> Addendum:

> With clever enough caching (to be implemented by someone highly 
> motivated), I suppose it's possible to avoid having this problem on 
> *every* keypress. But having to do that even on some of them is bad enough.

You've got a strategy in Ruby Mode which works, and you'll note I've
never tried to talk you into abandoning that strategy.

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

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