GNU bug report logs -
#59662
29.0.50; [PATCH] Add treesit--indent-defun
Previous Next
Reported by: Theodor Thornhill <theo <at> thornhill.no>
Date: Mon, 28 Nov 2022 19:33:01 UTC
Severity: wishlist
Tags: patch
Found in version 29.0.50
Done: Yuan Fu <casouri <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #145 received at 59662 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On 03/12/2022 19:54, Eli Zaretskii wrote:
>> paredit-reindent-defun, like I described, does all that too. But when
>> outside strings and comments, it reindents the current defun.
> So maybe paredit-reindent-defun doesn't need any fixes, but using it as a
> role model for the C-like languages is not TRT, since in C these are two
> separate commands with two different key bindings.
It's not a given that the current state of things must automatically be
optimal. But of course I can't vouch whether this behavior is optimal
for every language.
And major modes will continue to be able to rebind these key sequences.
>> 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.
[prog-reindent-defun.diff (text/x-patch, attachment)]
This bug report was last modified 2 years and 158 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.