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, 24 Mar 2014 21:54:40 -0400 Message-ID: References: <20140309123711.GA2615@acm.acm> <20140316223509.GD3854@acm.acm> <20140319224231.GB4783@acm.acm> <20140322131350.GA3163@acm.acm> <20140322223454.GA3562@acm.acm> <20140324224055.GB3825@acm.acm> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1395712492 29238 80.91.229.3 (25 Mar 2014 01:54:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 25 Mar 2014 01:54:52 +0000 (UTC) Cc: emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 25 02:55:01 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 1WSGZw-00086G-Og for ged-emacs-devel@m.gmane.org; Tue, 25 Mar 2014 02:55:01 +0100 Original-Received: from localhost ([::1]:39252 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSGZw-0001ge-9E for ged-emacs-devel@m.gmane.org; Mon, 24 Mar 2014 21:55:00 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44896) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSGZm-0001fU-8n for emacs-devel@gnu.org; Mon, 24 Mar 2014 21:54:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WSGZe-0007Ej-RH for emacs-devel@gnu.org; Mon, 24 Mar 2014 21:54:50 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:51791) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSGZe-0007Ee-KN for emacs-devel@gnu.org; Mon, 24 Mar 2014 21:54:42 -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 s2P1seG7009204; Mon, 24 Mar 2014 21:54:40 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 43316600AF; Mon, 24 Mar 2014 21:54:40 -0400 (EDT) In-Reply-To: <20140324224055.GB3825@acm.acm> (Alan Mackenzie's message of "Mon, 24 Mar 2014 22:40:55 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Level: X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0.2 X-NAI-Spam-Rules: 2 Rules triggered SUBJ_END_HASH_PTRN=0.2, RV4891=0 X-NAI-Spam-Version: 2.3.0.9362 : core <4891> : inlines <642> : streams <1144130> : uri <1708969> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 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:170945 Archived-At: > Assume that electric indentation happens on \n, and not on {. You type > in a { (which is intrinsically 4 characters too indented, for some value > of 4) then do M-; to insert a comment at comment-column. You fill in the > comment, do C-e then RET. The ensuing electric indentation on RET puts > out the alignment of the comment: > if (foo) /* aligned comment */ > { /* coment misaligned by e-i-m */ Ah, you're again pointing out the benefit of adding more chars to electric-indent-chars. Fine. We've already been in violent agreement on this time for a long time. >> >> What would be more optimal? >> > A mode-dependent or buffer-local dependent setting, as well as, rather >> > than instead of. >> We have that: electric-indent-local-mode and electric-indent-inhibit. > OK, for electric-indent-local-mode, which is gradually becoming > prominent. But I thought electric-indent-inhibit was a variable for major > modes, not users - a mode initialisation thing, rather than a user > configuration variable. Indeed electric-indent-inhibit is not meant as a user-config. And electric-indent-mode is not meant as a buffer-local config. So what? There is electric-indent-local-mode which is meant as a buffer-local user-config. So what is the problem? Please tell precisely what feature you miss rather than just criticize the existing ones. >> Lack of patch implementing this (supposed) simple change? > Here is what I propose, and am willing to do: > 1. For electric indentation: > a - Restore `newline' and `newline-and-indent' to their traditional > functionality, and remove `electric-newline-and-maybe-indent'. > b - Simplify `electric-indent-post-self-insert-function' such that it > reindents only the line on which the self-inserting character is > typed. > c - Reform `electric-indent-local-mode' as a first-class minor mode and > `electric-indent-mode' as a global version of it. > 2. For making RET indent the new line in programming modes: > a - Bind RET to `newline-and-indent' and C-j to `newline' in > `prog-mode-map' and possibly in certain other major mode maps (to be > discussed). > b - (Maybe) create a minor mode to restore RET and C-j to traditional > bindings. > The above will leave electric-indent-mode functioning pretty much as it > currently does. What do you say? I want to keep electric-indent-mode as a global mode that determines whether certain self-inserting keys (such as RET and others) auto-indent. >> So make this bug report specific about a particular circumstance where >> the behavior is undesirable, or about how hard it is to disable it. > I think RMS's bug #16156, reproduced and being discussed on a parallel > thread, is a good enough example, so there's not much point in me opening > a new one. Then post in that bug explaining why the behavior is undesirable or how hard it is to disable it. Stefan