all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: npostavs@users.sourceforge.net
To: 24809@debbugs.gnu.org
Cc: Jules Tamagnan <jtamagnan@gmail.com>
Subject: bug#24809: 25.1; Python.el improper indention after backslash-assignment-continuation
Date: Mon, 22 May 2017 20:26:29 -0400	[thread overview]
Message-ID: <8760gsfmfe.fsf@users.sourceforge.net> (raw)
In-Reply-To: <871sz1ih58.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 62 bytes --]

[Please use "Reply All" to keep 24809@debbugs.gnu.org on Cc]


[-- Attachment #2: Type: message/rfc822, Size: 2195 bytes --]

From: Jules Tamagnan <jtamagnan@gmail.com>
To: npostavs@users.sourceforge.net
Subject: Re: bug#24809: 25.1; Python.el improper indention after backslash-assignment-continuation
Date: Mon, 22 May 2017 11:46:32 -0700
Message-ID: <87tw4cbugn.fsf@gmail.com>

npostavs@users.sourceforge.net writes:

> Jules Tamagnan <jtamagnan@gmail.com> writes:
>
>> The bug is quite simple.
>>   - Open a python file.
>>   - Type:
>>     hello = \
>>   - C-m ; newline
>>
>> The point will now be directly under the backslash character. This is
>> indented incorrectly according to the pep8 style guide and the
>> pycodestyle checker, it should instead be indented
>> `python-indent-offset` further than the previous line.
>
> So the patch works (additionally the python-indent-after-backslash-4
> test would need to be updated) but I'm not sure if it's correct.
> Currently, the pep8 style guide doesn't really say anything about
> indentation following backslash, it just recommends using parens
> instead.

I can update the test. Yeah it is a sort of gray zone because the style
guide isn't explicit. I think that the goal of putting a backslash after
the equal sign would be to split a line that was too long. The current
way that emacs chooses to split a line is not really consistent that
goal or with the outcome of using an open paren. I think that the
following long line:

an_overly_long_variable_name = some_object.some_method(some_argument_to_some_method)

could be split like this:

an_overly_long_variable_name = (
    some_object.some_method(some_argument_to_some_method))

or if someone wanted to use a backslash like this:

an_overly_long_variable_name = \
    some_object.some_method(some_argument_to_some_method)

instead of like:

an_overly_long_variable_name = \
                               some_object.some_method(some_argument_to_some_method)

  parent reply	other threads:[~2017-05-23  0:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-27 22:03 bug#24809: 25.1; Python.el improper indention after backslash-assignment-continuation Jules Tamagnan
2017-05-22 15:31 ` npostavs
2017-05-23  0:26 ` npostavs [this message]
2017-05-23  0:47   ` npostavs
2017-05-29  3:36     ` npostavs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8760gsfmfe.fsf@users.sourceforge.net \
    --to=npostavs@users.sourceforge.net \
    --cc=24809@debbugs.gnu.org \
    --cc=jtamagnan@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.