[Top][All Lists]

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

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

From: Alan Mackenzie
Subject: Re: CC Mode and electric-pair "problem".
Date: Tue, 26 Jun 2018 18:52:35 +0000
User-agent: Mutt/1.9.4 (2018-02-28)

Hello, João.

On Tue, Jun 19, 2018 at 05:02:44 +0000, Alan Mackenzie wrote:
> On Mon, Jun 18, 2018 at 18:01:18 +0100, João Távora wrote:

> [ .... ]

> Maybe we're looking at this the wrong way.

> How about this idea: we add a new syntax flag to Emacs, ", which
> terminates any open string, the same way the syntax > terminates any
> open comment.  We could then set this syntax flag on newline.

This isn't a sensible idea. because it wouldn't solve any of the
problems we have with the string-fence syntax.

Instead, maybe we should add a new syntactic symbol to Emacs, "one-line
string quote".  A string opened by such a delimiter would be terminated
either by the same quote again, or a newline.

This would have the advantage of making fontification easy, whilst still
allowing syntactic operations within an invalid string.  For example, in

    char *foo = "(

, the "s would have "one-line string quote" syntax and be fontified with
warning face, but a C-M-n from the ( would still move point to after the
), and all the electric-pair-mode stuff would still work.

> This would have the disadvantage (for CC Mode) that it wouldn't work
> with older Emacsen.  But it might solve the various problems we've
> stumbled over in the last few days.

This paragraph would still hold.

> > João

Alan Mackenzie (Nuremberg, Germany).

reply via email to

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