emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Re: Algorithm in electric-pair--unbalanced-strings-p unsuita


From: Clément Pit-Claudel
Subject: Re: [PATCH] Re: Algorithm in electric-pair--unbalanced-strings-p unsuitable for CC Mode
Date: Tue, 9 Jul 2019 08:33:15 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2

On 2019-07-09 05:06, João Távora wrote:
> On Tue, Jul 9, 2019 at 7:42 AM Clément Pit-Claudel <address@hidden 
> <mailto:address@hidden>> wrote:
>>
>> of the line.  That's not more "correct", of course, but it does minimize the 
>> amount
>> of refontification and blinking in a pretty common case.
> 
> No, it doesn't.

Huh? I'm claiming that:

* Single line string are a pretty common case
* Fontifying to the end of the line and not past it minimizes refontification 
in that case

Is that controversial?

> Suppose you had that hypothetical version of Emacs and
> you did have a multi-line string, properly escaped with backslashes. Now you
> removed the backslash. Brutal "wrong" refontification ensues just as now,
> fontifying as code what up to now used to be fontified as a string.

Yes, of course.  Did I say something else?

> Both situations are wrong, and neither is "more wrong" than the other.

I'm glad we agree. That's why I wrote 'That's not more "correct", of course'

> But the version you propose is much harder to implement, likely less
> efficient,

Strong words :) Are you saying refontifying the whole screen after the point is 
faster than just refontifying to the end of the line?

> Depending on how it is implemented (certainly how Alan
> implemented it) it breaks things in Emacs core and third-party code.

But surely the quality of Alan's implementation has little impact on the 
worthiness of the feature in general (I'm not arguing about how things should 
be in cc-mode today — just saying that I like the general idea)

> It is also
> useless in languages which do allow unescaped multi-line strings

And more strong words :) I'm saying it's an option I'd like to have while 
conceding it's not universally better, so it surely wouldn't be useless to me 
^^  

Do we know what behavior is standard in other IDEs, and whether it is 
configurable?  On my machine I have vim, geany, gedit, and vscode, and all of 
the behave like Emacs currently does (but they refontify immediately, without a 
jit-lock idle delay).



reply via email to

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