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: Stefan Monnier
Subject: Re: CC Mode and electric-pair "problem".
Date: Thu, 28 Jun 2018 23:42:34 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> 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.

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.


        Stefan



reply via email to

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