From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#15478: cc-mode does not obey electric-indent-mode Date: Mon, 30 Sep 2013 14:23:55 -0400 Message-ID: References: <20130928201147.GC11317@acm.acm> <20130929091017.GA3161@acm.acm> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1380565520 21604 80.91.229.3 (30 Sep 2013 18:25:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 30 Sep 2013 18:25:20 +0000 (UTC) Cc: 15478@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 30 20:25:21 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 1VQi9o-00015s-T2 for geb-bug-gnu-emacs@m.gmane.org; Mon, 30 Sep 2013 20:25:21 +0200 Original-Received: from localhost ([::1]:51120 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQi9o-0003vd-GF for geb-bug-gnu-emacs@m.gmane.org; Mon, 30 Sep 2013 14:25:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50960) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQi9e-0003pa-6L for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2013 14:25:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VQi9W-00004w-Rl for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2013 14:25:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37901) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQi9W-0008VV-J7 for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2013 14:25:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VQi9V-0000ik-O4 for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2013 14:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 30 Sep 2013 18:25: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.13805654422702 (code B ref 15478); Mon, 30 Sep 2013 18:25:01 +0000 Original-Received: (at 15478) by debbugs.gnu.org; 30 Sep 2013 18:24:02 +0000 Original-Received: from localhost ([127.0.0.1]:46194 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VQi8X-0000hL-NC for submit@debbugs.gnu.org; Mon, 30 Sep 2013 14:24:02 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:59019) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VQi8T-0000h3-QC for 15478@debbugs.gnu.org; Mon, 30 Sep 2013 14:23:58 -0400 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id r8UINtxE021917; Mon, 30 Sep 2013 14:23:56 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 7FDC1631AA; Mon, 30 Sep 2013 14:23:55 -0400 (EDT) In-Reply-To: <20130929091017.GA3161@acm.acm> (Alan Mackenzie's message of "Sun, 29 Sep 2013 09:10:17 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4717=0 X-NAI-Spam-Version: 2.3.0.9362 : core <4717> : inlines <110> : streams <1047773> : uri <1551943> 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:78827 Archived-At: > 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