From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] trunk r116461: Connect electric-indent-mode up with CC Mode. Bug #15478. Date: Mon, 17 Mar 2014 11:48:16 -0400 Message-ID: References: <20140222182704.GA2639@acm.acm> <20140228195051.GA3446@acm.acm> <20140302115118.GA3768@acm.acm> <20140308225820.GB2726@acm.acm> <20140309123711.GA2615@acm.acm> <20140316223509.GD3854@acm.acm> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1395071307 16640 80.91.229.3 (17 Mar 2014 15:48:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 17 Mar 2014 15:48:27 +0000 (UTC) Cc: emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 17 16:48:35 2014 Return-path: Envelope-to: ged-emacs-devel@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 1WPZmE-0004Wt-Sj for ged-emacs-devel@m.gmane.org; Mon, 17 Mar 2014 16:48:34 +0100 Original-Received: from localhost ([::1]:58598 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPZmE-0003jX-Eq for ged-emacs-devel@m.gmane.org; Mon, 17 Mar 2014 11:48:34 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48524) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPZm4-0003jK-UR for emacs-devel@gnu.org; Mon, 17 Mar 2014 11:48:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WPZlx-0001fg-L5 for emacs-devel@gnu.org; Mon, 17 Mar 2014 11:48:24 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:42038) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPZlx-0001fW-Gv for emacs-devel@gnu.org; Mon, 17 Mar 2014 11:48:17 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFHO+KKg/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYSFBgNJCyHcgbBLZEKA44YlmKBXoMT X-IPAS-Result: Av4EABK/CFHO+KKg/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYSFBgNJCyHcgbBLZEKA44YlmKBXoMT X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="52356823" Original-Received: from 206-248-162-160.dsl.teksavvy.com (HELO pastel.home) ([206.248.162.160]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 17 Mar 2014 11:48:16 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 837F360F5C; Mon, 17 Mar 2014 11:48:16 -0400 (EDT) In-Reply-To: <20140316223509.GD3854@acm.acm> (Alan Mackenzie's message of "Sun, 16 Mar 2014 22:35:09 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:170441 Archived-At: >> Right. But I don't see what is so special about the C language that >> makes c-electric-flag (aka electric-indent-mode) indispensable in c-mode. > CC Mode modes don't indent correctly automatically without electric > indentation. And the same holds true for all other programming modes. Nothing special here. For some major modes (like Lisp), using newline-and-indent is sufficient to indent code as you type it. For most others, reindent-then-newline-and-indent is needed instead. I don't know of any mode where electric behavior of something else than the newline character is needed for the "typical case where lines of code are being typed in, line by line". But since this "typical case" is not that typical, several major modes elect to make a few other keys electric so as to try and maintain indentation even when code is being modified rather than just being written linearly. Maybe the special part of c-mode is that you used a set of electric chars which is sufficient and yet does not include newline. > Not quite. I want the default for CC Mode modes to be t, regardless of > any system wide default. I know you steadfastly refuse to recognize that this is your personal preference rather than a requirement of the languages you support. > I think you are wrong in your tacit assumption that liking of e-i-m is > person dependent rather than major mode dependent. There are details about *how* e-i-m works which depend on the mode. Yes. That's why e-i-m has mode-local settings (e.g. which keys are electric, or whether the indentation algorithm can reliably reindent). But the global e-i-m setting is about deciding whether the user wants his code to be automatically indented as he types (to the extent possible). It is *defined* as a person-dependent preference. > The way electric-indent-mode was implemented seems optimised to maximise > the difficulty of integrating CC Mode with it. Of course, my main objective was to piss you off and make your life miserable. It hasn't worked as well as planned, but this is not quite over yet ;-) Stefan