Subject: Re: bug#8141: 23.2.94; python-fill-paragraph

From: Andreas Röhler <[email-masked]>
Date: Tue, 01 Mar 2011 11:45:56 +0100

Am 01.03.2011 03:59, schrieb Christoph Scholtes:
> Andreas Röhler<[email-masked]>  writes:
>
>> attached a test file, revealing a bug in python-fill-paragraph already
>> reported at lp, which pertains to python.el and python-mode.el
>> likewise.
>>
>> Patch attached.
>
> Thanks for the bug report and the patch.
>
> However, I would like to understand first what the problem is/was. The
> initial bug report on Launchpad included a file (kn.py), whose
> doc-string caused problems, right?
>
> I can open this file and use python-fill-paragraph and fill-paragraph
> with no problem in emacs 23.2 and the latest trunk. There is no error
> and the doc string looks formatted correctly, also.
>
> What is the problem with the code in python.el/python-mode.el?
>
> Regards,
> Christoph
>

Hi,

with M-q resp. fill-paragraph it's fine here too.

python-fill-paragraph displays the bug.

Did you try the test delivered?

AFAIS bug basically might reside in
fill-paragraph, where

    ;; 2. Try fill-paragraph-function.
    (and (not (eq fill-paragraph-function t))
         (or fill-paragraph-function
             (and (minibufferp (current-buffer))
                  (= 1 (point-min))))
         (let ((function (or fill-paragraph-function

should be written like

(cond (fill-paragraph-function
        DTRT)

       (t everything else

Unless I'm wrong...

Thanks

Andreas