emacs-devel
[Top][All Lists]
Advanced

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

Re: electric-pair-mode as a minor mode?


From: Stefan Monnier
Subject: Re: electric-pair-mode as a minor mode?
Date: Fri, 27 Mar 2015 14:20:39 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

> Seriously, while I won't stand in the way of having some
> `electric-pair-mode'-related default hookage in text-mode-hook, why
> isn't this fixed in text-mode's syntax-table? Aren't those wrong
> assumptions the real culprit?

I don't think so: it's very useful for text-mode to match parentheses
(even if it only works 90% of the time), so I definitely don't want to
change that (that would prevent using C-M-f and friends).  But code
shouldn't assume that syntax-ppss gives any kind of useful info in such
modes because in practice it's much too frequent for parentheses not to
be properly paired.

> But you obviously know this, so what do you have in mind?

The behavior of the old electric-pair-mode did not use syntax-ppss and
its `)' simply always skipped (if there was a `)' to skip, obviously).

The assumption was basically that it's easier for the user to hit ')' one
more time than to delete an extraneous ')'.


        Stefan



reply via email to

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