Subject: Re: bug#60360: 30.0.50; prog-fill-reindent-defun doesn't use region

From: Juri Linkov <[email-masked]>
Date: Wed, 28 Dec 2022 19:22:26 +0200

close 60360 30.0.50
thanks

>> After selecting the region in a docstring, M-q used to fill the region,
>> but new prog-fill-reindent-defun doesn't do this.  The original
>> function had the argument REGION for that, described thusly:
>
> Thanks, does the below patch solve your problem?  If so, feel free to
> install it, as I can't :-)

Thanks for the patch.  I confirmed that it works,
and then pushed to master.

> @@ -164,10 +164,8 @@ prog-fill-reindent-defun
> ...
> +              (re-search-forward "^\\s<" (line-end-position) t))
> +          (fill-paragraph argument (region-active-p))

Usually use-region-p would be a better choice, but in this case
region-active-p is fine since it follows the logic used by
the REGION arg of fill-paragraph.