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, 11 Dec 2022 10:11:58 +0200 Message-ID: <83edt6uzox.fsf@gnu.org> References: <5B538888-E454-4F75-B3B8-AB20E10B3E89@gmail.com> <87zgbyxohf.fsf@thornhill.no> <837cz22bgd.fsf@gnu.org> <2C2420B5-A0BE-4A81-A924-0F40DD57F211@thornhill.no> <877cz1d7vq.fsf@thornhill.no> <83ilil1wot.fsf@gnu.org> <877E42C0-4FDD-4ED7-933D-AB2199BBCEF3@thornhill.no> <83edt917z5.fsf@gnu.org> <87o7scww07.fsf@thornhill.no> <40acda30-cf00-b419-b726-2794206c96e9@yandex.ru> <87ilikws6a.fsf@thornhill.no> <87edt8wqyo.fsf@thornhill.no> <64801406-62b9-c691-da3e-b8dbcee203be@yandex.ru> <87wn70injy.fsf@thornhill.no> <834ju4z5vu.fsf@gnu.org> <87mt7wi8sp.fsf@thornhill.no> <83r0x7wdtm.fsf@gnu.org> <87y1rfxb4u.fsf@thornhill.no> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37585"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, 59662@debbugs.gnu.org, casouri@gmail.com, monnier@iro.umontreal.ca, dgutov@yandex.ru To: Theodor Thornhill Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 11 09:13:20 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 1p4HSa-0009bF-Jf for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 11 Dec 2022 09:13:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p4HSL-0003e7-5p; Sun, 11 Dec 2022 03:13:05 -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 1p4HSI-0003ds-VK for bug-gnu-emacs@gnu.org; Sun, 11 Dec 2022 03:13: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 1p4HSI-0006Uj-NP for bug-gnu-emacs@gnu.org; Sun, 11 Dec 2022 03:13:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p4HSI-0006hN-5W for bug-gnu-emacs@gnu.org; Sun, 11 Dec 2022 03:13: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: Sun, 11 Dec 2022 08:13: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.167074633625733 (code B ref 59662); Sun, 11 Dec 2022 08:13:02 +0000 Original-Received: (at 59662) by debbugs.gnu.org; 11 Dec 2022 08:12:16 +0000 Original-Received: from localhost ([127.0.0.1]:46200 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4HRY-0006gz-2I for submit@debbugs.gnu.org; Sun, 11 Dec 2022 03:12:16 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:54336) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4HRT-0006gp-4w for 59662@debbugs.gnu.org; Sun, 11 Dec 2022 03:12:14 -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 1p4HRL-0006QA-9O; Sun, 11 Dec 2022 03:12:04 -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=RFJIdSG22gd7sKpGKB5KDmFR4aeeHbeAsRJTh01TggM=; b=CqaKQ8spv56j dQtsWnmWyXKrABG6/+FeyfdlNQjAcF0sNoN9EFSIQcstrnELxwQS4Bc0/mG2VulYC+EnzAoSrGeep 3x0A9VrYBYE7JLFmE75bNm+/asZgrN3yRSaBt4wlMUrrMr9IcDyZqbpo49euKLGc3GC33jkFx2sJj i6smfkiaBf+3s6NLIrgTvhrxw5tfEfXMNP/+r2n/N3/zBU6oeMDv3WlWNhIHo3AH+Oct7f/SS3HjW twjKMDD3wgbEWtsJG1DkFMMVd0Igb4jfiNnjrkevgFkF0UPanLha+NlUfhymJsOKj5UOdKoinWexI fsZKoZxDWiIjohv/cxaH7Q==; 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 1p4HRJ-0003f8-0F; Sun, 11 Dec 2022 03:12:01 -0500 In-Reply-To: <87y1rfxb4u.fsf@thornhill.no> (message from Theodor Thornhill on Sat, 10 Dec 2022 21:21:53 +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:250581 Archived-At: > From: Theodor Thornhill > Cc: dgutov@yandex.ru, larsi@gnus.org, 59662@debbugs.gnu.org, > casouri@gmail.com, monnier@iro.umontreal.ca > Date: Sat, 10 Dec 2022 21:21:53 +0100 > > I made another attempt - I think it's a little clearer. What I want to > say is something like this (| denotes point): > > 1. If point is inside a comment, refill the paragraph: > // foo bar | baz > > 2. If point is before a comment, refill the paragraph: > | // foo bar baz > > 3. If point is inside code, reindent the defun: > int > main(void) > { > int i; // <-- This will be reindented > /* Some very long comment that will _not_ be refilled in this case. */ > for(;;) > { > | int x; > } > } What if point is after a comment, like this: /* foo bar baz */ | > +@code{fill-paragraph-function} (@pxref{List Motion,,, elisp, The Emacs > +Lisp Reference Manual} or @ref{Filling,,, elisp, The Emacs Lisp > +Reference Manual} for more information). The @pxref should be "see @ref", and please add a comma after the closing brace (some old versions of makeinfo insist on that). @pxref is only appropriate if its closing brace immediately precedes the closing parenthesis. Otherwise LGTM, thanks.