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: electric-indent-mode: abolition of `newline' function is not the Right Thing. Date: Sun, 13 Oct 2013 10:13:25 +0000 Message-ID: <20131013101325.GA2621@acm.acm> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1381659337 15116 80.91.229.3 (13 Oct 2013 10:15:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 13 Oct 2013 10:15:37 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 13 12:15:39 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 1VVIi2-0004c3-6C for ged-emacs-devel@m.gmane.org; Sun, 13 Oct 2013 12:15:38 +0200 Original-Received: from localhost ([::1]:60861 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVIi1-0002v3-F3 for ged-emacs-devel@m.gmane.org; Sun, 13 Oct 2013 06:15:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38028) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVIhr-0002t9-Q3 for emacs-devel@gnu.org; Sun, 13 Oct 2013 06:15:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VVIhk-0002fm-Ef for emacs-devel@gnu.org; Sun, 13 Oct 2013 06:15:27 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:29129 helo=mail.muc.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVIhk-0002fS-4y for emacs-devel@gnu.org; Sun, 13 Oct 2013 06:15:20 -0400 Original-Received: (qmail 64312 invoked by uid 3782); 13 Oct 2013 10:15:17 -0000 Original-Received: from acm.muc.de (p5492C747.dip0.t-ipconnect.de [84.146.199.71]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 13 Oct 2013 12:15:16 +0200 Original-Received: (qmail 2945 invoked by uid 1000); 13 Oct 2013 10:13:25 -0000 Content-Disposition: inline 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:164169 Archived-At: Hi, Emacs. `electric-indent-post-self-insert-function' effectively redefines `newline' to `newline-and-indent'. So, whilst `electric-indent-mode' is enabled, there is no easy way to invoke the traditional functionality of `newline'. This is a Bad Thing. I discovered this whilst trying `electric-indent-mode' in Text Mode. I have a command which starts a new paragraph thusly: (i) It calls `newline' and inserts, e.g. "(vi) ". (ii) It calls `fill-paragraph' for the text in the new paragraph. Unfortunately, `newline' indents the "(vi) " to the level of the old paragraph, so that the following `fill-paragraph' joins the old and new paragraphs together. This is bad. `newline-and-indent' exists as its own command, traditionally bound to C-j. A better way for `electric-indent-mode' to achieve the effect it wants is to get users to rebind to `newline-and-indent' or suggest the use of C-j. `newline' must continue to exist, both as a command and as a lisp function. -- Alan Mackenzie (Nuremberg, Germany).