[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: Fri, 28 Aug 2015 08:30:26 +0200
User-agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>>> and call `fill-paragraph-function' on them.
>> Can't see that. May you point me at?
> fill-region doesn't (and more importantly can't) delegate to
> fill-paragraph-function since fill-paragraph-function doesn't take
> begin/end arguments.

Are you saying that there would be a problem if the region starts in the
middle of a paragraph and/or ends in the middle of another paragraph?

I didn't test but I think that case could be solved by narrowing to the
region before doing the filling.  But of course, then the first and last
line would probably be filled beyond fill-column if the region
starts/ends in the middle of a line.  So the region could be extended or
shrunken to complete lines before narrowing with the negative effect
that two partial lines are either not filled or filled too much.

So yes, it seems to be not possible to get it completely right.  But
IMHO that solution is still better than simply ignoring
`fill-paragraph-function' and filling in a way which may break the
syntax of the text.


reply via email to

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