From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#59662: 29.0.50; [PATCH] Add treesit--indent-defun Date: Thu, 08 Dec 2022 09:16:00 +0200 Message-ID: <83y1ri2wnj.fsf@gnu.org> References: <5B538888-E454-4F75-B3B8-AB20E10B3E89@gmail.com> <83o7sniokt.fsf@gnu.org> <4D5A1640-4F0F-4C21-8ED6-770B88A870EA@thornhill.no> <83r0xhdluq.fsf@gnu.org> <3e25eadb-3f2b-f92d-8b18-bf1daca91b64@yandex.ru> <83wn78cqz4.fsf@gnu.org> <4d605e69-7df9-6480-c1c5-dcb22abd3bde@yandex.ru> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24203"; mail-complaints-to="usenet@ciao.gmane.io" Cc: casouri@gmail.com, 59662@debbugs.gnu.org, theo@thornhill.no, casouri@gmail.org To: Dmitry Gutov , Stefan Monnier , Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 08 08:17:24 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p3B9n-00064c-N1 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 08 Dec 2022 08:17:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p3B9Y-00082X-21; Thu, 08 Dec 2022 02:17:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p3B9S-000808-RA for bug-gnu-emacs@gnu.org; Thu, 08 Dec 2022 02:17:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p3B9S-0006HR-JP for bug-gnu-emacs@gnu.org; Thu, 08 Dec 2022 02:17:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p3B9S-000500-ED for bug-gnu-emacs@gnu.org; Thu, 08 Dec 2022 02:17:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 08 Dec 2022 07:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59662 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 59662-submit@debbugs.gnu.org id=B59662.167048378419204 (code B ref 59662); Thu, 08 Dec 2022 07:17:02 +0000 Original-Received: (at 59662) by debbugs.gnu.org; 8 Dec 2022 07:16:24 +0000 Original-Received: from localhost ([127.0.0.1]:54928 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3B8p-0004zg-GS for submit@debbugs.gnu.org; Thu, 08 Dec 2022 02:16:23 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:57902) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3B8n-0004za-7D for 59662@debbugs.gnu.org; Thu, 08 Dec 2022 02:16:21 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p3B8f-0003G1-JI; Thu, 08 Dec 2022 02:16:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=r1K29HVj5o59kbsbLv1XIFxoFoxlSlau60qm4d1gooM=; b=fx9BBWhzz7pH FrI+S802cjUqSASitDXFmw295gpap/WCB/uXwooWm3PS+cD4pOzG01EuNEkDNP8iOfT/n7KdMnbDf j0kTy1OOEddClIFfEhlVULzvZ7iDU5W9XFGI9UrXV3hN0U/jsmSPAzC9Cgq0ffghF841wTjTmR0uv gU3sQWnauNEwYLAK9OEwznxIUaXmXyB+ZR7kQhkRQvtwOU1HIOX+JwNhPXm2dsqRWBU6QILMk3Za9 j5dsqoKUz9TClfKq78f5b53x8EvEyhPTrZxZiMY4iXhLMmnJDh4YuwhcZxMgYw+gqxdwWBcbz6eFp 0qCM94PTjmcekC3CxR57IA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p3B8d-0002I8-N3; Thu, 08 Dec 2022 02:16:13 -0500 In-Reply-To: <4d605e69-7df9-6480-c1c5-dcb22abd3bde@yandex.ru> (message from Dmitry Gutov on Thu, 8 Dec 2022 03:37:54 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:250245 Archived-At: > Date: Thu, 8 Dec 2022 03:37:54 +0200 > Cc: theo@thornhill.no, casouri@gmail.com, 59662@debbugs.gnu.org, > casouri@gmail.org > From: Dmitry Gutov > > >> 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.