GNU bug report logs - #33794
26.1; electric-pair-mode breaks auto-newline minor mode of cc-mode

Previous Next

Packages: emacs, cc-mode;

Reported by: bea <at> klebe.blog

Date: Tue, 18 Dec 2018 17:48:02 UTC

Severity: normal

Found in version 26.1

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Alan Mackenzie <acm <at> muc.de>
To: Beatrix Klebe <beeuhtricks <at> gmail.com>
Cc: 33794 <at> debbugs.gnu.org, bea <at> klebe.blog, João Távora <joaotavora <at> gmail.com>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: bug#33794: 26.1; electric-pair-mode breaks auto-newline minor mode of cc-mode
Date: Sat, 22 Dec 2018 02:41:43 +0000
Hello, Beatrix.

As maintainer of CC Mode, I earnestly recommend you NOT to follow João's
suggestion.  It will not work, and will waste your time.  Even if it
appears to work, you will end up picking out bugs for an indeterminate
period.

Basically, electric-pair-mode as it is currently built is incompatible
with CC Mode, as I have pointed out here, albeit somewhat
undiplomatically.

I suggest you do nothing until tempers amongst Emacs developers have
cooled down, and hopefully a genuine solution to the bug has been worked
out and implemented.

-- 
Alan Mackenzie (Nuremberg, Germany).



On Sat, Dec 22, 2018 at 02:16:03 +0000, João Távora wrote:
> Hi again Beatrix,

> In the latest version of the patch I am preparing, if you do

>     (add-hook 'c-mode-hook
> 	      (lambda ()
> 		(setq-local electric-layout-rules
> 			    '((?\{ . before})
>                               (?\{ . after)
> 			      (?\{ . after-stay)))))

> You should arive at Allman C-style electric layouts.  So typing
> int main () <spaces> then brace should give you:

> int main ()
> {
>   <cursor here>
> }

> I attach the two patches for convenience, which you can also find in the
> scratch/fix-33794-extend-electric-layout-mode branch.

> João




This bug report was last modified 6 years and 188 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.