From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Davis Herring Newsgroups: gmane.emacs.devel Subject: Re: electric-indent-mode: abolition of `newline' function is not the Right Thing. Date: Tue, 15 Oct 2013 09:54:22 -0600 Organization: XCP-1 Message-ID: <525D652E.3090200@lanl.gov> References: <20131013101325.GA2621@acm.acm> <878uxxlz5q.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1381852496 6580 80.91.229.3 (15 Oct 2013 15:54:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 15 Oct 2013 15:54:56 +0000 (UTC) Cc: Alan Mackenzie , Matthias Meulien , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 15 17:54:58 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 1VW6xR-00052f-0s for ged-emacs-devel@m.gmane.org; Tue, 15 Oct 2013 17:54:53 +0200 Original-Received: from localhost ([::1]:42656 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VW6xQ-0004Lh-D5 for ged-emacs-devel@m.gmane.org; Tue, 15 Oct 2013 11:54:52 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57891) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VW6xD-00040N-Ie for emacs-devel@gnu.org; Tue, 15 Oct 2013 11:54:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VW6x4-0005il-5K for emacs-devel@gnu.org; Tue, 15 Oct 2013 11:54:39 -0400 Original-Received: from proofpoint5.lanl.gov ([204.121.3.53]:52473) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VW6x3-0005hU-UR for emacs-devel@gnu.org; Tue, 15 Oct 2013 11:54:30 -0400 Original-Received: from mailrelay2.lanl.gov (mailrelay2.lanl.gov [128.165.4.103]) by mailgate5.lanl.gov (8.14.5/8.14.5) with ESMTP id r9FFsNjJ024287; Tue, 15 Oct 2013 09:54:23 -0600 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by mailrelay2.lanl.gov (Postfix) with ESMTP id 9E7491923DDD; Tue, 15 Oct 2013 09:54:23 -0600 (MDT) X-NIE-2-Virus-Scanner: amavisd-new at mailrelay2.lanl.gov Original-Received: from [128.165.123.183] (xray-r06.lanl.gov [128.165.123.183]) by mailrelay2.lanl.gov (Postfix) with ESMTP id 7A4041923DCF; Tue, 15 Oct 2013 09:54:23 -0600 (MDT) User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110717 Lanikai/3.1.11 In-Reply-To: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.10.8794, 1.0.431, 0.0.0000 definitions=2013-10-15_06:2013-10-15, 2013-10-15, 1970-01-01 signatures=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 204.121.3.53 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:164221 Archived-At: >> class base(object): >>> pass > > Hmm, then I don't know if it happens in trunk or not, because I don't > really know how to reproduce it or what result would be correct or not > (I don't know/use Python). I can help with the basic idea: most colons require a following statement, either on the same line (one statement) or on all the following lines indented more than the line with the colon. (We're only concerned with the latter case, which Python calls a suite.) "pass" is a no-op used in such a context where no (real) statement is desired. Therefore, it makes sense for an Emacs Python mode to notice a "pass" (along with certain other choices like "return") and presume that the user wants it to end the suite -- that is, to use one fewer level of indentation on the next line. (Sometimes the user wants even less indentation, so they type p a s s C-j DEL or so.) The bug (if it exists) is that newline/newline-and-indent/whatever are not implementing this behavior properly, resulting in blocks that the user "obviously" means to be siblings being nested instead (when no DEL is used). Davis -- This product is sold by volume, not by mass. If it appears too dense or too sparse, it is because mass-energy conversion has occurred during shipping.