[Top][All Lists]

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

Re: fill-paragraph ill designed

From: Tassilo Horn
Subject: Re: fill-paragraph ill designed
Date: Wed, 26 Aug 2015 14:40:05 +0200
User-agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (gnu/linux)

Andreas Röhler <address@hidden> writes:

>>>> There is a lot of ugliness in the way fill-paragraph works, but
>>>> developing a replacement that works ok in practice is harder than it
>>>> looks.  I recall a time that we tried.
>>> What would prevent switching the clauses as suggested?
>> IMO, it makes completely sense that `fill-paragraph' delegates to
>> `fill-region' if the region is active so that not every mode-specific
>> `fill-paragraph-function' has to do that on its own.
> Let's assume region is up to or inside a documentation-string in
> Python.
> Then fill-region will be called instead of fill-paragraph-function.
> But how should fill-region get access or know about Python docu-string
> styles?

`fill-region' would utilize `fill-forward-paragraph-function' to move
over the paragraphs in that region and call `fill-paragraph-function' on
them.  Then you as a mode author are free to define what a paragraph in
python means and how to properly fill it, e.g., every function
definition is a "paragraph", and when filling a paragraph, your
`fill-paragraph-function' actually only fills the documentation string
of the function.


reply via email to

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