> fill-region-as-paragraph is an interactive function.
> It is very strange for me that calling it interactively requires the
> user to select region within a single paragraph and nothing
> else.
I think even the above statement is the result of a misunderstanding:
the region passed to `fill-region-as-paragraph` can be *anything*.
It should just correspond to what the user wants to treat as
a single paragraph. IOW, it's used specifically when the "builtin"
notion of paragraph doesn't match what the user needs.
> Especially "regardless what ... human brain looking at this may think".
> If Emacs command is counter-intuitive, what kind of command is it?
What behavior would you find more intuitive?
IOW, how would you change its behavior to make it more intuitive?
AFAIK, it's fairly unusual to call `fill-region-as-paragraph`
interactively, comparing to uses of `fill-region` or `fill-paragraph`.
> The fact that fill-region-as-paragraph-semlf explicitly says that is
> might be called on multiple paragraphs does not help either.
>
> (defun fill-region-as-paragraph-semlf (from to &optional justify
> nosqueeze squeeze-after)
> "Fill the region using semantic linefeeds as if it were a single
> paragraph.
> This command removes any paragraph breaks in the region and extra
> newlines at the end, and fills lines within the region.
I can't see anywhere here where it says it "might be called on multiple
paragraphs". Maybe you're referring to the last two lines, which are
just copied over from
(defun fill-region-as-paragraph-default (from to &optional justify
nosqueeze squeeze-after)
"Fill the region FROM ... TO as one paragraph.
It removes any paragraph breaks in the region and extra newlines at the end,
indents and fills lines between the margins given by the
`current-left-margin' and `current-fill-column' functions.
[...]
I don't know exactly why those lines are there in
`fill-region-as-paragraph-default`, but I agree they're misleading
and I'd remove them (it's just newlines that are removed: non-empty lines
that match `paragraph-separator` aren't removed, AFAIK).
=== Stefan