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: Sun, 04 Dec 2022 14:40:17 +0200 Message-ID: <83359vbavi.fsf@gnu.org> References: <5B538888-E454-4F75-B3B8-AB20E10B3E89@gmail.com> <83o7sniokt.fsf@gnu.org> <56840149-5EB9-4C22-841F-45F410BFC885@thornhill.no> <83edtjimyo.fsf@gnu.org> <875yet975l.fsf@thornhill.no> <87y1rp7dw2.fsf@thornhill.no> <87o7sjcpr4.fsf@thornhill.no> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28101"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 59662@debbugs.gnu.org, casouri@gmail.com, mardani29@yahoo.es To: Theodor Thornhill Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 04 13:41:13 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 1p1oIz-0007Bf-GM for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 04 Dec 2022 13:41:13 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p1oIq-0000Hm-Qc; Sun, 04 Dec 2022 07:41:04 -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 1p1oIp-0000GX-2q for bug-gnu-emacs@gnu.org; Sun, 04 Dec 2022 07:41:03 -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 1p1oIn-0006k9-Ty for bug-gnu-emacs@gnu.org; Sun, 04 Dec 2022 07:41:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p1oIn-0007VV-OE for bug-gnu-emacs@gnu.org; Sun, 04 Dec 2022 07:41:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 04 Dec 2022 12:41:01 +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 X-Debbugs-Original-Cc: bug-gnu-emacs@gnu.org, 59662@debbugs.gnu.org, casouri@gmail.com, mardani29@yahoo.es Original-Received: via spool by submit@debbugs.gnu.org id=B.167015764128829 (code B ref -1); Sun, 04 Dec 2022 12:41:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 4 Dec 2022 12:40:41 +0000 Original-Received: from localhost ([127.0.0.1]:57371 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1oIS-0007Uv-NE for submit@debbugs.gnu.org; Sun, 04 Dec 2022 07:40:41 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:33402) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1oIP-0007Up-OM for submit@debbugs.gnu.org; Sun, 04 Dec 2022 07:40:38 -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 1p1oIO-00008x-Ta for bug-gnu-emacs@gnu.org; Sun, 04 Dec 2022 07:40:37 -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 1p1oIO-00066E-Hw; Sun, 04 Dec 2022 07:40:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=5N2jd/7sgLi07jMKZDkVhXdPO9c12vdbk113hirm7pQ=; b=MxGrY//9eNoi4vfkS3UZ xst85TTNuavlweI7LlZ/zIOG9DPus1lVgvrxraHs2FQ7mYNMce/zdGfmAoFkZythX/OtLHWdXHK+O Oit+O9/ZMiL0kLc6VL8mfzlEveWC4z5p9Z67BMOul0+A6V0Is2pkhbZXeIXj9GZ1rgGpmf64ZrFBG MRHmy62DOaY0knKRi+GBR+/N2f/D6XWbSWzQ6wAGrNgqiFxc4idf1+Ns07eMq1trC452OA+rm1Gxy g3b+86LlkAxtMqGcXdjCojlGUWvmmczazvHrGJjVxT0nvKtC2bs6u6EQ+PKO48gWZ3QyTggM/q4hs v7A+O6qRTZx9DQ==; 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 1p1oIN-00064u-WE; Sun, 04 Dec 2022 07:40:36 -0500 In-Reply-To: <87o7sjcpr4.fsf@thornhill.no> (message from Theodor Thornhill on Sun, 04 Dec 2022 13:33:35 +0100) 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:249930 Archived-At: > From: Theodor Thornhill > Cc: "Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife > of text editors" , Eli Zaretskii , > casouri@gmail.com, 59662@debbugs.gnu.org > Date: Sun, 04 Dec 2022 13:33:35 +0100 > > Theodor Thornhill writes: > > > On 2 December 2022 22:09:55 CET, "Daniel Martín" wrote: > >>Theodor Thornhill 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. IMO, it is better not to set the mark, indeed.