From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] trunk r116461: Connect electric-indent-mode up with CC Mode. Bug #15478. Date: Wed, 26 Mar 2014 21:21:17 +0000 Message-ID: <20140326212117.GB3787@acm.acm> References: <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; charset=us-ascii X-Trace: ger.gmane.org 1395869114 32166 80.91.229.3 (26 Mar 2014 21:25:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 26 Mar 2014 21:25:14 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 26 22:25:23 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 1WSvK6-0000xY-4i for ged-emacs-devel@m.gmane.org; Wed, 26 Mar 2014 22:25:22 +0100 Original-Received: from localhost ([::1]:50406 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSvK5-0005Ji-Ne for ged-emacs-devel@m.gmane.org; Wed, 26 Mar 2014 17:25:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41907) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSvJw-0005CR-LS for emacs-devel@gnu.org; Wed, 26 Mar 2014 17:25:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WSvJp-0001yY-BU for emacs-devel@gnu.org; Wed, 26 Mar 2014 17:25:12 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:16577 helo=mail.muc.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSvJp-0001sS-2r for emacs-devel@gnu.org; Wed, 26 Mar 2014 17:25:05 -0400 Original-Received: (qmail 29080 invoked by uid 3782); 26 Mar 2014 21:25:02 -0000 Original-Received: from acm.muc.de (pD951A044.dip0.t-ipconnect.de [217.81.160.68]) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 26 Mar 2014 22:25:01 +0100 Original-Received: (qmail 4218 invoked by uid 1000); 26 Mar 2014 21:21: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-detected-operating-system: by eggs.gnu.org: FreeBSD 8.x X-Received-From: 193.149.48.1 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:171016 Archived-At: Hello, Stefan. On Mon, Mar 24, 2014 at 09:54:40PM -0400, Stefan wrote: > >> > 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. I seem to have lost the thread here. Maybe there aren't any. > >> 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. How is this not satisfied by e-i-m being a define-globalized-minor-mode? With the current setup, we have a rather contorted relationship between e-i-m and e-i-local-m, with buffer local copies of electric-indent-mode popping into and out of existence. What about the rest of my suggestion? > Stefan -- Alan Mackenzie (Nuremberg, Germany).