[Top][All Lists]

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

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

From: Stefan Monnier
Subject: Re: [PATCH] Re: Algorithm in electric-pair--unbalanced-strings-p unsuitable for CC Mode
Date: Mon, 08 Jul 2019 16:59:31 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

>> > Don't knock it - it's working, and will give João what he wants whilst
>> > preserving correct fontification.
>> Several people have already pointed out that what you call here "correct
>> fontification" is "incorrect" in the cases where the error is a missing
>> \ rather than a missing ".
> "Several people" is just one that I have seen, and he is wrong.

João gave you actual examples where fontifying the second line as
a code rather than string was an error.  So we're at least 2.

> Whether
> the error "is" a missing \ or a missing " (for whatever value of "is"),
> the purpose of the fontification is to draw attention to this error.
> This error is at the EOL where there is a missing " or \.  In that sense
> CC Mode's fontification of it is correct.

Maybe we're not talking about the same thing: The addition of some kind
of error/warning face on this line is indeed always correct and is
something that can easily be done without any need to fiddle with
syntax-table text properties.  I'm definitely not arguing against this
highlighting of the immediate error.

But I'm talking about is the highlighting of the subsequent line(s).

You seem to want them to be highlighted as if the next line was not part
of a string (i.e. assume that a " was missing on the previous line),
whereas all other major modes highlight that second line under the
assumption that what was missing was a final \ on the previous line (or
whatever other syntax the corresponding language requires).

Both are wrong sometimes and right at other times.

> How can you expect me to be other than adversarial when faced with such
> an attitude?

I guess I like to expect the unexpected ;-)


reply via email to

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