Subject: bug#78561: [PATCH] Add semantic linefeed support for paragraph filling

From: Stefan Monnier <[email-masked]>
Date: Mon, 26 May 2025 12:21:15 -0400

>> Please try and separate it into a `fill-region-semlf` function and then
>> another one which applies it to a paragraph, so that it can also be used
>> to fill a specific user-specified region (or the whole buffer).
> I'm not sure about this one.  The idea is that `fill-paragraph-semlf'
> can be assigned as a value for `fill-paragraph-function' (I also
> included a mention to this in the doc string) or it can be called
> directly.  The thing is that `fill-paragraph' docs say:

Sadly, we don't currently have anything like a `fill-region-function`,
but that's "a bug, not a feature", so we should write new code such that
this misfeature is easier rather than harder to fix in the future.

> I agree that it would be useful to apply `fill-paragraph-semlf' on
> a region or the whole buffer.  But, the same could be said about any
> other `fill-paragraph-function'.

Yes, I've had this in my TODO for many years.  🙁

> So, do we really want a specific `fill-region-semlf' function?

Actually, I think I want a `fill-region-as-paragraph-semlf'.
And maybe then some way to tell the `fill.el` code to use that instead
of the default `fill-region-as-paragraph`.

        Stefan