GNU bug report logs - #8141
23.2.94; python-fill-paragraph

Previous Next

Package: emacs;

Reported by: Andreas Röhler <andreas.roehler <at> easy-emacs.de>

Date: Mon, 28 Feb 2011 20:53:02 UTC

Severity: minor

Found in version 23.2.94

Done: Fabián Ezequiel Gallina <fabian <at> anue.biz>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 8141 in the body.
You can then email your comments to 8141 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8141; Package emacs. (Mon, 28 Feb 2011 20:53:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Andreas Röhler <andreas.roehler <at> easy-emacs.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 28 Feb 2011 20:53:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Andreas Röhler <andreas.roehler <at> easy-emacs.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 23.2.94; python-fill-paragraph
Date: Mon, 28 Feb 2011 21:56:16 +0100
[Message part 1 (text/plain, inline)]
Hi,

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.

Andreas

--
https://code.launchpad.net/~a-roehler/python-mode/python-mode-components
https://code.launchpad.net/s-x-emacs-werkstatt/
[fill-paragraph-problems-lp710373-test.el (text/x-emacs-lisp, attachment)]
[python.el.diff (text/x-patch, attachment)]

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8141; Package emacs. (Tue, 01 Mar 2011 03:00:02 GMT) Full text and rfc822 format available.

Message #8 received at 8141 <at> debbugs.gnu.org (full text, mbox):

From: Christoph Scholtes <cschol2112 <at> googlemail.com>
To: Andreas Röhler <andreas.roehler <at> easy-emacs.de>
Cc: 8141 <at> debbugs.gnu.org
Subject: Re: bug#8141: 23.2.94; python-fill-paragraph
Date: Mon, 28 Feb 2011 19:59:16 -0700
Andreas Röhler <andreas.roehler <at> easy-emacs.de> 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




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8141; Package emacs. (Tue, 01 Mar 2011 10:42:02 GMT) Full text and rfc822 format available.

Message #11 received at 8141 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Röhler <andreas.roehler <at> easy-emacs.de>
To: Christoph Scholtes <cschol2112 <at> googlemail.com>
Cc: 8141 <at> debbugs.gnu.org
Subject: Re: bug#8141: 23.2.94; python-fill-paragraph
Date: Tue, 01 Mar 2011 11:45:56 +0100
Am 01.03.2011 03:59, schrieb Christoph Scholtes:
> Andreas Röhler<andreas.roehler <at> easy-emacs.de>  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




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8141; Package emacs. (Tue, 08 Mar 2011 02:09:02 GMT) Full text and rfc822 format available.

Message #14 received at 8141 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Andreas Röhler <andreas.roehler <at> easy-emacs.de>
Cc: Christoph Scholtes <cschol2112 <at> googlemail.com>, 8141 <at> debbugs.gnu.org
Subject: Re: bug#8141: 23.2.94; python-fill-paragraph
Date: Mon, 07 Mar 2011 21:08:15 -0500
> with M-q resp. fill-paragraph it's fine here too.
> python-fill-paragraph displays the bug.
[...]
> AFAIS bug basically might reside in
> fill-paragraph, where

If calling fill-paragraph works while python-fill-paragraph doesn't, it
would rather seem to indicate that the bug is in python-fill-paragraph
(maybe the bug is that python-fill-paragraph should never be called
directly as a command, for example).

>    ;; 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

No, the current definition is on purpose.  As the docstring of
fill-paragraph-function indicates:

   ...
   If the function returns nil, then `fill-paragraph' does its normal work.
   ...


-- Stefan




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8141; Package emacs. (Tue, 08 Mar 2011 12:22:01 GMT) Full text and rfc822 format available.

Message #17 received at 8141 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Röhler <andreas.roehler <at> easy-emacs.de>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Christoph Scholtes <cschol2112 <at> googlemail.com>, 8141 <at> debbugs.gnu.org
Subject: Re: bug#8141: 23.2.94; python-fill-paragraph
Date: Tue, 08 Mar 2011 13:26:17 +0100
Am 08.03.2011 03:08, schrieb Stefan Monnier:
>> with M-q resp. fill-paragraph it's fine here too.
>> python-fill-paragraph displays the bug.
> [...]
>> AFAIS bug basically might reside in
>> fill-paragraph, where
>
> If calling fill-paragraph works while python-fill-paragraph doesn't, it
> would rather seem to indicate that the bug is in python-fill-paragraph
> (maybe the bug is that python-fill-paragraph should never be called
> directly as a command, for example).
>
>>     ;; 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
>
> No, the current definition is on purpose.


Hi Stefan,

IMHO that introduces complexity, even if there are reasons for.
If modes introduce their own fill-function, it's better to leave them 
than. If the modes need some later stuff from fill.el, they may take it.


Andreas





  As the docstring of
> fill-paragraph-function indicates:
>
>     ...
>     If the function returns nil, then `fill-paragraph' does its normal work.
>     ...
>
>
> -- Stefan
>





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8141; Package emacs. (Tue, 08 Mar 2011 21:19:01 GMT) Full text and rfc822 format available.

Message #20 received at 8141 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Andreas Röhler <andreas.roehler <at> easy-emacs.de>
Cc: Christoph Scholtes <cschol2112 <at> googlemail.com>, 8141 <at> debbugs.gnu.org
Subject: Re: bug#8141: 23.2.94; python-fill-paragraph
Date: Tue, 08 Mar 2011 16:18:08 -0500
>> No, the current definition is on purpose.

> IMHO that introduces complexity, even if there are reasons for.
> If modes introduce their own fill-function, it's better to leave them
> than. If the modes need some later stuff from fill.el, they may take it.

What complexity?  If the mode's fill function wants to do it all itself,
than it just needs to return a non-nil value.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#8141; Package emacs. (Tue, 19 Jun 2012 02:23:01 GMT) Full text and rfc822 format available.

Message #23 received at 8141 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 8141 <at> debbugs.gnu.org
Subject: Re: bug#8141: 23.2.94; python-fill-paragraph
Date: Mon, 18 Jun 2012 22:19:23 -0400
I have no idea what this report was supposed to be about.

It may have been about filling the following:

"""
triple-quoted string containing "quotation" marks.
triple-quoted string containing "quotation" marks.
triple-quoted string containing "quotation" marks.
triple-quoted string containing "quotation" marks.
triple-quoted string containing "quotation" marks.
"""

In 24.1, using M-x fill-paragraph and M-x python-fill-paragraph give
slightly different results.

In the current trunk, using M-x fill-paragraph and M-x
python-fill-paragraph-function (why is this interactive?) obviously give
the same results. However, the result is not the same as either form in
24.1. It looks like this, with an empty line at the end that presumably
should not be there?

"""triple-quoted string containing "quotation" marks.  triple-quoted
string containing "quotation" marks.  triple-quoted string containing
"quotation" marks.  triple-quoted string containing "quotation" marks.
triple-quoted string containing "quotation" marks.

"""





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#8141; Package emacs. (Sun, 07 Oct 2012 13:27:02 GMT) Full text and rfc822 format available.

Message #26 received at 8141 <at> debbugs.gnu.org (full text, mbox):

From: Fabián Ezequiel Gallina <fabian <at> anue.biz>
To: 8141 <at> debbugs.gnu.org
Subject: 23.2.94; python-fill-paragraph
Date: Sun, 07 Oct 2012 10:26:17 -0300
This works fine on current trunk, notice there's a new option that allow 
users to set the style for docstrings.




bug closed, send any further explanations to 8141 <at> debbugs.gnu.org and Andreas Röhler <andreas.roehler <at> easy-emacs.de> Request was from Fabián Ezequiel Gallina <fabian <at> anue.biz> to control <at> debbugs.gnu.org. (Sun, 07 Oct 2012 13:27:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 05 Nov 2012 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 223 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.