GNU bug report logs - #15478
cc-mode does not obey electric-indent-mode

Previous Next

Packages: emacs, cc-mode;

Reported by: Stefan Monnier <monnier <at> iro.umontreal.ca>

Date: Sat, 28 Sep 2013 18:12:02 UTC

Severity: normal

Found in version 24.3.50

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: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Alan Mackenzie <acm <at> muc.de>
Cc: 15478 <at> debbugs.gnu.org
Subject: bug#15478: cc-mode does not obey electric-indent-mode
Date: Mon, 30 Sep 2013 14:23:55 -0400
> I'm not familiar enough with these other modes to be able to say.  But
> what exactly are you saying here?  Even if CC Mode is not different from
> the other modes, that doesn't change the fact that electricity must be
> enabled by default in CC Mode.

I don't see anything that requires electric-indent to be enabled by
default in cc-mode.  Most major modes don't enable electric-layout by
default (and AFAICT most users care more about "indent after newline",
which cc-mode doesn't enable anyway).

So, yes, I do think that the default behavior of cc-mode should be changed.

> Perhaps not, but there is a good deal of thinking and scheming needed
> before this can be done.  For CC Mode simply to `and' in the variable
> electric-indent-mode when testing c-electric-flag would cause breakage,
> confusion and bug reports.  Or perhaps should CC Mode set a buffer-local
> copy of e-i-m to t at initialisation?  Should C-c C-l be extended also
> to toggle e-i-m?  And so on....

There are several separate issues, and they can be handled somewhat
separately.  First, let's see what we'd ultimately want to have as
behavior, disregarding backward compatibility and preservation of
previous behaviors.  For me, I'd like cc-mode to do as little as
possible besides adding ?\;, ?\{, and ?\} to electric-indent-chars.
I'm not convinced there's a real need for a key binding that toggles
electric-indent buffer-locally, but if there is, then I don't see why
cc-mode needs it more than any other mode.


        Stefan




This bug report was last modified 11 years and 91 days ago.

Previous Next


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