]> git.eshelyaron.com Git - emacs.git/commit
Fix electric-pair-tests by disabling bug#33794's fix with a variable
authorJoão Távora <joaotavora@gmail.com>
Thu, 17 Jan 2019 18:47:00 +0000 (18:47 +0000)
committerJoão Távora <joaotavora@gmail.com>
Thu, 17 Jan 2019 18:49:10 +0000 (18:49 +0000)
commitbe505726b68d407a44fdcd9c7ac1ef722398532d
tree5e9255f212aceadaa64a9bb3a431a26776cb9353
parent4bdc03746915c36313b33b6998b855eef514cdd1
Fix electric-pair-tests by disabling bug#33794's fix with a variable

The variable c--disable-fix-of-bug-33794, which should be removed in
the short term in favor of a permanent solution, is introduced.

It is bound to nil by default.  This means that breakage is still
happening in actual c-mode and c++-mode usage, though the tests no
longer show it.

To get around this breakage, put

   (setq c--disable-fix-of-bug-33794 t)

In your init file.  Evidently, you will lose the fix for bug#33794,
but that only affects a small corner case of c-toggle-auto-newline,
which is not turned on by default.

See https://lists.gnu.org/archive/html/emacs-devel/2019-01/msg00360.html
for more information.

* lisp/progmodes/cc-cmds.el (c--disable-fix-of-bug-33794): New
variable.
(c--with-post-self-insert-hook-maybe): New macro.
(c-electric-pound, c-electric-brace, c-electric-slash)
(c-electric-star, c-electric-semi&comma, c-electric-colon)
(c-electric-lt-gt, c-electric-paren): Use it.
(c-electric-paren, c-electric-brace): Check
c--disable-fix-of-bug-33794.

* test/lisp/electric-tests.el (c--disable-fix-of-bug-33794):
Forward declare.
(electric-pair-test-for)
(electric-layout-int-main-kernel-style)
(electric-modes-in-c-mode-with-self-insert-command): Use it.
lisp/progmodes/cc-cmds.el
test/lisp/electric-tests.el