|
From: | Dmitry Gutov |
Subject: | bug#59662: 29.0.50; [PATCH] Add treesit--indent-defun |
Date: | Thu, 8 Dec 2022 03:37:54 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 |
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
Description: Text Data
[Prev in Thread] | Current Thread | [Next in Thread] |