Stefan Monnier [22/Jun 8:25am -04] wrote: >>> Join lines of this paragraph and fix up whitespace at joins. >>> Interactively, if the region is active, join lines of each paragraph in >>> the region. >>> >>> Why not calling fill-paragraph-function in a loop on each paragraph in >>> region? > > For the same reason `fill-region` doesn't do that: the caller of > `fill-paragraph-function` has too little control over the region that it > should fill. > >> AFAIU, unfill-paragraph should produce a single paragraph, so looping >> over several paragraphs and filling each one might not produce the >> same result. >> >> Stefan, WDYT? > > When BEG..END are not provided, I guess it could make sense to make it > rely on `fill-paragraph-function`, to make it more like > `fill-paragraph`. > > When BEG..END are provided, its current working (i.e. to call > `fill-region`) makes a lot of sense, and it should work just as well or > as poorly as `fill-region`. > > `fill-region` suffers from a lack of hooks for use by major modes, but > we've lived with that for eons so it seems good enough for the > corresponding use case of `unfill-paragraph`.
Thanks. Do you have an opinion about the case when ARG is not 1? Which path should we take then? I'm a bit apprehensive about having it use completely different filling functions depending on whether BEG or END are supplied, tbh. -- Sean Whitton
