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

From: Theodor Thornhill <[email-masked]>
Date: Sun, 04 Dec 2022 13:33:35 +0100

Theodor Thornhill <[email-masked]> writes:

> On 2 December 2022 22:09:55 CET, "Daniel Martín" <[email-masked]> wrote:
>>Theodor Thornhill <[email-masked]> writes:
>>
>>> Right - thanks.  However, this makes me wonder - should we really be
>>> setting mark here? I see that c-indent-defun does not, and it feels
>>> weird that indenting adds to the mark ring.  What do you think?  My
>>> first patch used
>>>
>>> (indent-region
>>>   (treesit-node-start node)
>>>   (treesit-node-end node))
>>>
>>> Which behaves similarly to c-indent-defun.
>>>
>>> See attached patch.
>>
>>I don't have a strong opinion, but if we can indent without setting the
>>mark, I think it'd be a cleaner command.  Specially if c-indent-defun
>>doesn't set the mark either.
>
> Yeah, we don't need to set the mark. Thanks for the feedback :)
> Theo

Eli, do you have any opinion on this matter? Should we implement this
function without using marks?  That will make the function a smidge
bigger, but would not mess up the mark-ring.  I think that's desirable,
at least.

Theo