emacs-devel
[Top][All Lists]
Advanced

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

Re: CC Mode and electric-pair "problem".


From: Eli Zaretskii
Subject: Re: CC Mode and electric-pair "problem".
Date: Sun, 01 Jul 2018 18:22:48 +0300

> Date: Sat, 30 Jun 2018 20:14:47 +0000
> Cc: address@hidden, address@hidden,
>   address@hidden, address@hidden,
>   address@hidden
> From: Alan Mackenzie <address@hidden>
> 
> > Could you please recap what problem(s) you are trying to fix with
> > these changes?  (I'm sorry for not following, but this thread spans
> > two months and many long messages with several days in-between.  It's
> > hard to keep focused on the main issues.)
> 
> Sorry.  That's just the way things go, sometimes.

Not your fault.  Thanks for taking the time to recap.

> The initial problem I tried to solve was for CC Mode source files with
> things like:
> 
>     char foo[] = "foo
>     char bar[] = "bar";
> 
> Historically, the missing " on "foo has caused subsequent lines to have
> their string quoting reversed.  This is not good.

But not really a catastrophe, IMO.

> What I'm now proposing, and implementing as a trial, is to enhance the
> syntax table facilities to support unterminated strings.  There will be
> an extra syntax flag `s' on newlines meaning "terminate any open string".
> This is straightforward for forward scanning, but somewhat complicated
> for backward scanning.  However, it does enable unterminated strings to
> be easily fontified to EOL in any language, with minimal effort.
> 
> It should allow the desired fontification without causing problems for
> electric-pair-mode.
> 
> Stefan is concerned that the extra functionality may not justify the
> increase in complexity in syntax.c.

So am I.  I'm also concerned that introducing this will slow down
various syntax-related features, only to cater to what I consider a
minor improvement at best.

Of course, if the extra functionality turns out to be not as complex
as Stefan fears and won't cause any significant slowdown that concerns
me, then perhaps we should have it.  But is that a reasonable
assumption?

Thanks.



reply via email to

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