[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: Sat, 30 Jun 2018 18:09:26 +0000
User-agent: Mutt/1.9.4 (2018-02-28)

Hello, Stefan.

On Thu, Jun 28, 2018 at 23:42:34 -0400, Stefan Monnier wrote:
> > This is effectively electric-pair-mode, which if enabled, already
> > inserts two "s when you type ".

> It's very different: it inserts/removes the second " at the end of the
> line, so it ends up behaving very much like your current code, except:
> - it only affects self-insert-command.
> - it uses an explicit " character rather than a syntax-table text-property.

Some people, including me, find the insertion of characters they haven't
typed (aside from tabs/spaces for indentation) annoying.  It's good that
there are minor modes that can do this, but it's not the way to solve
the current difficulty.

> So OT1H it provides a behavior closer to current `master` than to
> electric-pair-mode, but like electric-pair-mode it has a fairly focus'd
> effect, so is less likely to have unexpected interactions.

> > Not everybody likes electric-pair-mode.  I don't think your suggestion
> > is any better than mine (snipped) to which you replied.

> Its main benefit is that it's very superficial with a narrow focus.
> No need to change any core API like syntax-tables with a feature which
> will need to be supported for the next very many years.

But it doesn't really address the problem.  That problem is how to
fontify unterminated strings (in both senses of the word "how").  Up
till now, Emacs hasn't bothered - it just allows these strings, and the
subsequent buffer portion, to be fontified randomly.

I think such a string should have string face up till the first
unescaped newline (in modes where escaped NLs are required for multiline
strings).  I can't see any other way anybody would want such a construct
to be fontified.

>         Stefan

Alan Mackenzie (Nuremberg, Germany).

reply via email to

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