Subject: bug#59662: 29.0.50; [PATCH] Add treesit--indent-defun

From: Eli Zaretskii <[email-masked]>
Date: Thu, 08 Dec 2022 09:16:00 +0200

> Date: Thu, 8 Dec 2022 03:37:54 +0200
> Cc: [email-masked], [email-masked], [email-masked],
>  [email-masked]
> From: Dmitry Gutov <[email-masked]>
> 
> >> AFAICT, these behaviors are quite compatible. But paredit's binding
> >> seems to be useful in more contexts.
> > I'm fine with trying something like that on master, to see whether users
> > like this conflation, but not on the release branch.
> 
> Here's a patch that people can try. From my brief testing, seems useful 
> enough. I suppose some might dislike it, though, in some codebases where 
> the methods/functions are consistently longer than a screenful. I do 
> like this binding in Emacs Lisp too, though.

Stefan, Lars: any comments?

I'm okay with installing this on master, but please rename the new
function to something like prog-fill-reindent; the "fill" part should
appear in the name, to explain why we have both prog-indent and this
function.

Also, a NEWS entry and some addition to the "Multi-line Indent" node
of the Emacs user manual would be nice.

Bonus points for adding something that could use treesit.el
capabilities, when those are available, instead of syntax-ppss, to
determine when we are in a comment or in a string.  Or maybe Theo or
Yuan could suggest such an addition.

Thanks.