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


Message #14 received at 15478 <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 15478 <at> debbugs.gnu.org
Subject: Re: bug#15478: cc-mode does not obey electric-indent-mode
Date: Sun, 29 Sep 2013 09:10:17 +0000
'morning, Stefan.

On Sat, Sep 28, 2013 at 11:02:39PM -0400, Stefan Monnier wrote:
> > 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.

> I don't see in which way this is different for cc-mode than for any
> other major mode.

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.

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

> Indeed, currently it can only be enabled globally.  But it can be
> disabled per-buffer.
> I haven't heard any complaint about it from users yet.

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

> I'm not sure that would prevent cc-mode from obeying
> electric-indent-mode.

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....

>         Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).




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.