bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#36056: 26.2; Python Documentation String Indent In Auto Fill Mode


From: Basil L. Contovounesios
Subject: bug#36056: 26.2; Python Documentation String Indent In Auto Fill Mode
Date: Mon, 03 Jun 2019 01:57:45 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

ricercar <ricercar@lycos.com> writes:

> There is some peculiar behavior when using auto-fill-mode editing Python
> code. For example if I start typing the following:
>
> def some_function(keyword_argument0, keyword_argument1,
>                   keyword_argument2='foobar'):
>     """
>     Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod 
> tempor incididunt ut labore et dolore magna aliqua.
>
>
> and press Enter, it will look like this:
>
> def some_function(keyword_argument0, keyword_argument1,
>                   keyword_argument2='foobar'):
>     """
>     Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
>                   eiusmod tempor incididunt ut labore et dolore magna
>                   aliqua.
>
> That is, the subsequent lines of the documentation string are indented
> as to match the indentation of the second line of the list of keyword
> arguments, rather than four columns as I would expect.

I'm not familiar with this part of Emacs or python.el, and I don't know
what else this may break, but from stepping through do-auto-fill I
discovered the following setting gives the desired auto-fill behaviour:

  (add-hook 'python-mode-hook
            (lambda ()
              (setq-local fill-indent-according-to-mode t)))

HTH,

-- 
Basil





reply via email to

[Prev in Thread] Current Thread [Next in Thread]