Subject: bug#67462: 30.0.50; prog-fill-reindent-defun does not respect buffer-local fill-paragraph-function

From: Eli Zaretskii <[email-masked]>
Date: Mon, 27 Nov 2023 14:16:14 +0200

> Cc: [email-masked]
> Date: Sun, 26 Nov 2023 23:52:00 +0100
> From:  Jens Schmidt via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> Dmitry Gutov <[email-masked]> writes:
> 
> > Maybe makefile-mode-map should simply rebind "M-q" back to 'fill-paragraph'.
> 
> I tried a cursory grep '(defun .*-fill-paragraph' in lisp/progmodes/.el.
> The following functions all seem to work outside of comments:
> 
>   cfengine-fill-paragraph
>   f90-fill-paragraph
>   fortran-fill-paragraph
>   makefile-fill-paragraph
>   octave-fill-paragraph
> 
> I could be wrong with that list, though, and I cannot tell how useful
> these functions are outside of comments.  I just looked at docstrings or
> for a prominent
> 
>   (or (fill-comment-paragraph justify)
>       (do-something ...))
> 
> pattern.

What would it take to teach prog-fill-reindent-defun to DTRT outside
comments and strings?