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: Thu, 3 Apr 2014 21:53:04 +0000 Message-ID: <20140403215304.GB3918@acm.acm> References: <20140322131350.GA3163@acm.acm> <20140322223454.GA3562@acm.acm> <20140324224055.GB3825@acm.acm> <87d2hb9hys.fsf@yandex.ru> <20140326205330.GA3787@acm.acm> <5333DB29.7030403@yandex.ru> <20140330145717.GB3338@acm.acm> <5339A1DE.8030807@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1396562242 18593 80.91.229.3 (3 Apr 2014 21:57:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 3 Apr 2014 21:57:22 +0000 (UTC) Cc: Stefan , emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Apr 03 23:57:16 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 1WVpdK-0006Lc-Lr for ged-emacs-devel@m.gmane.org; Thu, 03 Apr 2014 23:57:14 +0200 Original-Received: from localhost ([::1]:46539 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVpdK-00025o-Ck for ged-emacs-devel@m.gmane.org; Thu, 03 Apr 2014 17:57:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45965) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVpdB-0001t4-2B for emacs-devel@gnu.org; Thu, 03 Apr 2014 17:57:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WVpd5-0001F9-3d for emacs-devel@gnu.org; Thu, 03 Apr 2014 17:57:05 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:59251 helo=mail.muc.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVpd4-0001Ey-Q3 for emacs-devel@gnu.org; Thu, 03 Apr 2014 17:56:59 -0400 Original-Received: (qmail 24003 invoked by uid 3782); 3 Apr 2014 21:56:55 -0000 Original-Received: from acm.muc.de (pD9519A72.dip0.t-ipconnect.de [217.81.154.114]) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 03 Apr 2014 23:56:54 +0200 Original-Received: (qmail 5200 invoked by uid 1000); 3 Apr 2014 21:53:04 -0000 Content-Disposition: inline In-Reply-To: <5339A1DE.8030807@yandex.ru> 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:171289 Archived-At: Hello, Dmitry. On Mon, Mar 31, 2014 at 08:11:58PM +0300, Dmitry Gutov wrote: > On 30.03.2014 17:57, Alan Mackenzie wrote: > >> This could be considered a reason to improve the > >> indent-line-function in text-mode. `indent-relative' offers behavior > >> that's pretty close. Maybe it could be made to follow the behavior > >> of auto-fill even closer. > > Notice, here, how we're no longer talking about electric indentation, but > > rather about newline-and-indent. The two topics are distinct. > Yes, but I think we're discussing both in this thread. FWIW, I think > we're in agreement about electric indentation on RET. See my message > here, and also Stefan's reply: > http://lists.gnu.org/archive/html/emacs-devel/2014-03/msg00936.html > http://lists.gnu.org/archive/html/emacs-devel/2014-03/msg00957.html Yes, I think we're in agreement with eachother, but not with Stefan. He has decided to conflate the RET/C-j bindings and electric-indent-mode, and to have these bindings apparently flip each time e-i-m is called. He's also decided to do this although there's never been any meaningful discussion of it here, and there isn't going to be any. > > I usually think of html, markdown, and such like, as the "etc." in > > "programming modes (etc.)". > Yeah, okay. Which other modes exactly need newline-and-indent on RET > could be a matter of debate, but one possible criteria is "mode has a > meaningful/specialized indentation function". Hmm. I'm not sure that gets us very far, in practice. What does "meaningful/specialized" mean? I'll be more specific: programming modes which use syntactic indentation (i.e. most of them) and the various markup-like modes which are "like" programming languages. > > I think RET should do the most natural sort of newline, and C-j the > > subsidiary one, whatever they may happen to be for a particular mode. > Sounds okay, I guess. > >> As long as this new mode is divorced from electric-indent-mode, I'd be > >> happy. > > This is a key point. > It could be something called like `old-newline-keys-mode'. Appropriate > major modes would swap RET and C-j bindings, and the above minor mode > would force them all back to (RET C-j) -> (newline newline-and-indent). Again, Stefan has decided there will be no such new mode, and that its functionality is going to be twisted up with electric-indent-mode, rather than being independent of it. It now seems us discussing this further would just be a waste of time. > >> This specific behavior is a consequence of using `newline-and-indent'. > > No, not at all. It's a consequence of electric behaviour getting > > entangled with newline-and-indent. > It's the same if I disable `electric-indent-mode' but bind RET to > `newline-and-indent'. > And if `electric-indent-mode' didn't do `-and-indent' but retained the > electric indent on RET, a similar example is easy to demonstrate: > foo > bar| > Press RET, see the same result. Yes. Again, if we're in a programming mode that's what we want nearly all the time - it's what electric indentation is for (despite all the disadvantages of doing it on \n). In non-programming modes it's what we don't want. It now seems Somebody (tm) is going to have to trawl through all major modes disabling electric indentation for lots of them. > IOW, text-mode could be considered in trouble if RET triggers call to > indentation at any line. Yes indeed. -- Alan Mackenzie (Nuremberg, Germany).