• João Távora's avatar
    Fix electric-pair-tests by disabling bug#33794's fix with a variable · be505726
    João Távora authored
    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.
    be505726
cc-cmds.el 175 KB