From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Carlos Pita Newsgroups: gmane.emacs.bugs Subject: bug#19691: closed (24.4; python.el: indentation RFE) Date: Fri, 30 Jan 2015 07:18:13 -0300 Message-ID: References: <87zj90aprz.fsf@gnu.org> <87vbjt4o1d.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1422613155 7889 80.91.229.3 (30 Jan 2015 10:19:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 30 Jan 2015 10:19:15 +0000 (UTC) Cc: Fabian Ezequiel Gallina To: 19691@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jan 30 11:19:14 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1YH8fO-0000hg-8e for geb-bug-gnu-emacs@m.gmane.org; Fri, 30 Jan 2015 11:19:10 +0100 Original-Received: from localhost ([::1]:35865 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YH8fN-00051z-Mp for geb-bug-gnu-emacs@m.gmane.org; Fri, 30 Jan 2015 05:19:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51718) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YH8fJ-0004xn-K1 for bug-gnu-emacs@gnu.org; Fri, 30 Jan 2015 05:19:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YH8fG-0008JO-C7 for bug-gnu-emacs@gnu.org; Fri, 30 Jan 2015 05:19:05 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:38292) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YH8fG-0008JE-95 for bug-gnu-emacs@gnu.org; Fri, 30 Jan 2015 05:19:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YH8fF-0004sz-Nj for bug-gnu-emacs@gnu.org; Fri, 30 Jan 2015 05:19:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Carlos Pita Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 30 Jan 2015 10:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19691 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Original-Received: via spool by 19691-submit@debbugs.gnu.org id=B19691.142261312218752 (code B ref 19691); Fri, 30 Jan 2015 10:19:01 +0000 Original-Received: (at 19691) by debbugs.gnu.org; 30 Jan 2015 10:18:42 +0000 Original-Received: from localhost ([127.0.0.1]:57765 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YH8ev-0004sO-TE for submit@debbugs.gnu.org; Fri, 30 Jan 2015 05:18:42 -0500 Original-Received: from mail-lb0-f180.google.com ([209.85.217.180]:33686) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YH8et-0004s6-Qy for 19691@debbugs.gnu.org; Fri, 30 Jan 2015 05:18:40 -0500 Original-Received: by mail-lb0-f180.google.com with SMTP id b6so35542886lbj.11 for <19691@debbugs.gnu.org>; Fri, 30 Jan 2015 02:18:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=nsNtFQfc8ob3zq5QlCSziH05RskFyWnh2dGRljSTPnM=; b=EPfbWn1AzX9sI0OfQyj7MTvtoNULfUm77ua+r6wO7NjNOGowSnitmriHeiLmPuoqWe RH5Ratf6DkI5Fpmcxtidv9wx6lPWLB9nnx+qw2fzIELOjrC1+N6HyTsOxI26JAjZZGGW GY77HdgrsdpTSiZnjj3WCNeFr18NoetNgv6ilTs7lHrXq4vd8Uuk4jYbobU5LEGMWDLs MUJoNfQ7iE+5TVHUysDEgVE/rTtQ95Li2BH+NityBtWeR33/lbp2sY8X4Bq7PRhKbqHz d2Ma0bzUyC7dPGwmqS1wbwwHpRl5mKm9e+LfKhcSgg4DP55L6uiJZvDZ10+NtY6lyggZ imjw== X-Received: by 10.112.83.104 with SMTP id p8mr5723416lby.70.1422613113985; Fri, 30 Jan 2015 02:18:33 -0800 (PST) Original-Received: by 10.112.124.193 with HTTP; Fri, 30 Jan 2015 02:18:13 -0800 (PST) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:98898 Archived-At: Hi Fabian, I was thinking a bit more about this after my report and I concluded that a simpler approach based on the recommendations of pep8 could fit the bill: two consecutive blank lines can be considered as an "indentation context" that finishes a top level definition, so the next line will have no indentation at all. I've already implemented this and could post a patch later if you want, but it's a pretty trivial one and I'm sure you would do it better than me. Cheers -- Carlos On Fri, Jan 30, 2015 at 12:53 AM, GNU bug Tracking System wrote: > Your bug report > > #19691: 24.4; python.el: indentation RFE > > which was filed against the emacs package, has been closed. > > The explanation is attached below, along with your original report. > If you require more details, please reply to 19691@debbugs.gnu.org. > > -- > 19691: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D19691 > GNU Bug Tracking System > Contact help-debbugs@gnu.org with problems > > > ---------- Forwarded message ---------- > From: "Fabi=C3=A1n Ezequiel Gallina" > To: 19691-done@debbugs.gnu.org > Cc: > Date: Fri, 30 Jan 2015 00:52:32 -0300 > Subject: 24.4; python.el: indentation RFE > tags 19691 + notabug > quit > > > Hi Carlos, > > The functionality already exists, it's a matter of toggling > `electric-indent-mode` OR alternate between using RET and `C-j` for > creating a newline (depending the case). > > When `electric-indent-mode` is enabled, you can achieve what you want by > using `C-j`, while RET would indent just like you see right now. > > When `electric-indent-mode` is disabled, you can achieve what you want > by using RET, and `C-j` would indent. > > If what you want is to keep the current column in places where there are > several indentation levels involved, then `C-a C-j` or `C-a RET` > (depending on the status `electric-indent-mode`) will help. > > > > Cheers, > Fabi=C3=A1n > > > > ---------- Forwarded message ---------- > From: Carlos Pita > To: bug-gnu-emacs@gnu.org > Cc: galli.87@gmail.com > Date: Mon, 26 Jan 2015 11:25:18 -0300 > Subject: 24.4; python.el: indentation RFE > When you're in a blank line and press Enter, IMHO it would be better if > python.el kept the cursor column position, instead of restoring the last > non-blank line indentation level. > > For example, say the cursor is X: > > def f(): > pass > X > > When I press Enter most often I don't want to get: > > def f(): > pass > > X > > Instead, I think a more sensible default behaviour would be: > > def f(): > pass > > X > > That is, to keep the cursor vertical position. This is consistent with > the criterion of auto-indenting up to the indentation of last (both > blank or non-blank) line, except for the technicality that a blank last > line is not really indented... although you still have a point position > there to infer desired indentation for the new line. > > Maybe this should be made a customizable option. > > What do you think? I'll try to submit a patch later today. > > >