From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: electric-indent-mode: abolition of `newline' function is not the Right Thing. Date: Mon, 14 Oct 2013 08:56:25 -0400 Message-ID: References: <20131013101325.GA2621@acm.acm> <20131013140931.GC2621@acm.acm> <20131013172841.GA2498@acm.acm> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1381755404 6865 80.91.229.3 (14 Oct 2013 12:56:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 14 Oct 2013 12:56:44 +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 Oct 14 14:56:47 2013 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 1VVhhX-0005Zi-1y for ged-emacs-devel@m.gmane.org; Mon, 14 Oct 2013 14:56:47 +0200 Original-Received: from localhost ([::1]:36691 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVhhW-0002o5-MG for ged-emacs-devel@m.gmane.org; Mon, 14 Oct 2013 08:56:46 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42292) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVhhM-0002nk-TN for emacs-devel@gnu.org; Mon, 14 Oct 2013 08:56:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VVhhE-0006aZ-RU for emacs-devel@gnu.org; Mon, 14 Oct 2013 08:56:36 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:47283) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVhhE-0006aS-Mv for emacs-devel@gnu.org; Mon, 14 Oct 2013 08:56:28 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFMCqeW/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYSFBgNJIgeBsEtkQoDi1KRF4gRgV6DEw X-IPAS-Result: Av4EABK/CFFMCqeW/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYSFBgNJIgeBsEtkQoDi1KRF4gRgV6DEw X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="35445768" Original-Received: from 76-10-167-150.dsl.teksavvy.com (HELO pastel.home) ([76.10.167.150]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 14 Oct 2013 08:52:25 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id AA7DB60C09; Mon, 14 Oct 2013 08:56:25 -0400 (EDT) In-Reply-To: <20131013172841.GA2498@acm.acm> (Alan Mackenzie's message of "Sun, 13 Oct 2013 17:28:41 +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.182 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:164198 Archived-At: > And people calling `newline' do not simply want a \n. They want > abbreviations to be processed, they want auto-fill to be run, trailing > space to be removed from otherwise blank lines, and so on. What they > _don't_ want is indentation inserted on the new line. Not sure who is your "they". In my experience, what I've seen users want is "auto-indentation" and by that they mean that the text should be kept indented when they hit RET and a few other keys. E.g. a question I've seen many times is So I tried this Emacs thingy which claims to do indentation for me, but all my text stays at the left-margin. What am I doing wrong. and the answer I generally see given is: You want to bind RET to newline-and-indent. Are these the majority, users? I don't know. But so far, you're the only person who's complained about ?\n being in the default value of electric-indent-chars, so I see no evidence that your preference in this regard is representative. > Please take this indent-newline functionality out of > e-i-post-s-i-function (or let me do it). Very easy: remove ?\n from electric-indent-chars. IOW (setq-default electric-indent-chars nil) should do that for you. > Incidentally, each call of e-i-post-s-i-function creates a new marker, > bound to the let variable `before'. This is not set to point nowhere > before `before' becomes unbound. I think it probably should. Let's see if/when this leads to a concrete performance problem, and at that point we'll see how to fix it. Making a marker point nowhere is an annoyance and is itself a costly operation (O(N) for N markers), so I don't much like using the workaround you suggest. Stefan