emacs-devel
[Top][All Lists]
Advanced

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

Re: Algorithm in electric-pair--unbalanced-strings-p unsuitable for CC M


From: Alan Mackenzie
Subject: Re: Algorithm in electric-pair--unbalanced-strings-p unsuitable for CC Mode
Date: Thu, 4 Jul 2019 16:42:33 +0000
User-agent: Mutt/1.10.1 (2018-07-13)

Hello, Stefan.

On Thu, Jul 04, 2019 at 11:52:32 -0400, Stefan Monnier wrote:
> Hi Alan,

> > Thanks.  That's part of the problem.  Another part is that syntax
> > fontification will have wrongly fontified the bits beyond the end of the
> > invalid string with font-lock-string-face.

> We've gone through that several times already.
> We don't and can't know if it's wrong or not, because it depends on what
> is the error: is there a missing closing " on the line, or should the
> newline be preceded by \ ?

The error is clear: There is an opening quote without a matching closing
quote.  The former part of the error is at the opening quote, so we must
indicate its position somehow, most simply by marking it with
warning-face.  The latter part of the error happens at the first
unescaped EOL; this is what defines the string as invalid.  We must
indicate this position as well, and the best way of doing this is
terminating the string-face at that position.

It is not arbitrary.  We are not trying to guess the intention of the
user; we are pointing out the objective error.

[ .... ]

>         Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

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