Subject: bug#15478: cc-mode does not obey electric-indent-mode

From: Alan Mackenzie <[email-masked]>
Date: Sat, 28 Sep 2013 20:11:47 +0000

Hi, Stefan.

> Package: Emacs
> Version: 24.3.50

> As the subject says, cc-mode should obey electric-indent-mode and only
> perform auto-indent after inserting `;' or braces when the user has
> requested it by enabling electric-indent-mode.

There are problems with electric-indent-mode from the point of view of CC
Mode:

In particular, the electricity MUST be enabled by default in CC Mode,
otherwise automatic indentation won't work.  For example, after typing "}"
at the end of an otherwise blank line, the "}" typically needs to be
indented several spaces outwards.  electric-indent-mode appears to be
disabled by default.

electric-indent-mode is not buffer local; c-electric-flag is.

There is a key binding to toggle c-electric-flag, namely C-c C-l.

There is a set of "minor mode" toggling commands in CC Mode, and it would
seem not to be the Right Thing to destroy the coherence of this set.

>        Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).