From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#15478: cc-mode does not obey electric-indent-mode Date: Sun, 29 Sep 2013 09:10:17 +0000 Message-ID: <20130929091017.GA3161@acm.acm> References: <20130928201147.GC11317@acm.acm> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1380446002 21116 80.91.229.3 (29 Sep 2013 09:13:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 29 Sep 2013 09:13:22 +0000 (UTC) Cc: 15478@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 29 11:13:24 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VQD44-0001Qi-Dr for geb-bug-gnu-emacs@m.gmane.org; Sun, 29 Sep 2013 11:13:20 +0200 Original-Received: from localhost ([::1]:43993 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQD43-00045D-T2 for geb-bug-gnu-emacs@m.gmane.org; Sun, 29 Sep 2013 05:13:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38558) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQD3u-00042x-0q for bug-gnu-emacs@gnu.org; Sun, 29 Sep 2013 05:13:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VQD3m-0003IX-Me for bug-gnu-emacs@gnu.org; Sun, 29 Sep 2013 05:13:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36108) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQD3m-0003IS-IY for bug-gnu-emacs@gnu.org; Sun, 29 Sep 2013 05:13:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VQD3l-0006ry-VT for bug-gnu-emacs@gnu.org; Sun, 29 Sep 2013 05:13:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 29 Sep 2013 09:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15478 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 15478-submit@debbugs.gnu.org id=B15478.138044592826343 (code B ref 15478); Sun, 29 Sep 2013 09:13:01 +0000 Original-Received: (at 15478) by debbugs.gnu.org; 29 Sep 2013 09:12:08 +0000 Original-Received: from localhost ([127.0.0.1]:44401 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VQD2t-0006qo-Pg for submit@debbugs.gnu.org; Sun, 29 Sep 2013 05:12:08 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:43661 helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VQD2r-0006qd-0B for 15478@debbugs.gnu.org; Sun, 29 Sep 2013 05:12:05 -0400 Original-Received: (qmail 7738 invoked by uid 3782); 29 Sep 2013 09:12:02 -0000 Original-Received: from acm.muc.de (p5492C855.dip0.t-ipconnect.de [84.146.200.85]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 29 Sep 2013 11:11:59 +0200 Original-Received: (qmail 3321 invoked by uid 1000); 29 Sep 2013 09:10:17 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:78790 Archived-At: '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).