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: Fri, 09 Dec 2022 22:20:05 +0200 Message-ID: <834ju4z5vu.fsf@gnu.org> References: <5B538888-E454-4F75-B3B8-AB20E10B3E89@gmail.com> <4d605e69-7df9-6480-c1c5-dcb22abd3bde@yandex.ru> <83y1ri2wnj.fsf@gnu.org> <875yemz55b.fsf@thornhill.no> <83r0xa2tc4.fsf@gnu.org> <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> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24519"; 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 Fri Dec 09 21:21:18 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 1p3jry-00065J-B1 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 09 Dec 2022 21:21:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p3jrk-0005Ic-UM; Fri, 09 Dec 2022 15:21: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 1p3jrj-0005I9-27 for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2022 15:21: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 1p3jri-0000rU-O3 for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2022 15:21:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p3jri-0002qE-5M for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2022 15:21: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: Fri, 09 Dec 2022 20:21: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.167061722510883 (code B ref 59662); Fri, 09 Dec 2022 20:21:02 +0000 Original-Received: (at 59662) by debbugs.gnu.org; 9 Dec 2022 20:20:25 +0000 Original-Received: from localhost ([127.0.0.1]:38257 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3jr4-0002pT-2S for submit@debbugs.gnu.org; Fri, 09 Dec 2022 15:20:25 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:54652) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3jr1-0002pL-3s for 59662@debbugs.gnu.org; Fri, 09 Dec 2022 15:20:20 -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 1p3jqu-00061G-9e; Fri, 09 Dec 2022 15:20:12 -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=+TEHDMR29P3j/lXVP6JAme/rkgtIHT1PjVdNN6WrywQ=; b=Q7fmUdGhFzk7 QvsdjbMnhkCHEQF+giwEhCFjlEjkypdz6afEyYuFZs5wTNYIFtqVvl0XbMMFOPyoOGWaQftZyiqCc dL4PbkYnUzwdV4A3icBVHZyQA+fbxT6Ur0V3pe6dX/uthq+a+q15rLZciuUZzlFeXvuf81yABOw1q 5bi9PUBOmLU4ouwSLfDfZ3+D6tnOlRtua2eMsBXCOGlzGQoIC0oAYDArcUKgwmTVGm+SIqsaJ+L6T SuCFarVWrvUbpiAPj3jj5QFGFEHtGeJvBFzRi5DM+HDNtF+5AJEPP2Kqdi8Abxe+3z2Uzr2uqM7cv Yc42DWwAH17LGaOR7XUbrw==; 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 1p3jqt-0004bQ-Of; Fri, 09 Dec 2022 15:20:12 -0500 In-Reply-To: <87wn70injy.fsf@thornhill.no> (message from Theodor Thornhill on Fri, 09 Dec 2022 16:50:25 +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:250447 Archived-At: > From: Theodor Thornhill > Cc: larsi@gnus.org, 59662@debbugs.gnu.org, casouri@gmail.com, > monnier@iro.umontreal.ca > Date: Fri, 09 Dec 2022 16:50:25 +0100 > > diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi > index ba8475e86a..cc06a003e2 100644 > --- a/doc/emacs/programs.texi > +++ b/doc/emacs/programs.texi > @@ -409,6 +409,14 @@ Multi-line Indent > @table @kbd > @item C-M-q > Reindent all the lines within one parenthetical grouping. > +@item M-q > +Major modes that derive from @code{prog-mode} can reindent all the > +lines within a defun around point using > +@code{prog-mode-fill-reindent-defun}. The bounds of of a defun is > +decided by @code{beginning-of-defun-function} and > +@code{end-of-defun-function}. If point is inside a comment or a > +doc-string, refill that paragraph instead, using > +@code{fill-paragraph-function}. The 2 variables you mention should have @vindex entries. Also, please add a cross-reference to the mode in elisp manual where these two variables are described. > +*** New command 'prog-fill-reindent-defun' > +This command either fills a single paragraph in a defun, such as a > +doc-string, or a comment. If point is inside normal code, it > +(re)indents the surrounding defun. These two sentences should be one sentence, otherwise that 'either" is out of place. Something like This command either fills a single paragraph in a defun, such as a doc-string, or a comment, or (re)indents the surrounding defun if point is not in a comment or a string. > Bound by default in > +'prog-mode-map' to 'M-q'. "It is by default bound to 'M-q' in 'prog-mode' and all its descendants." > +(defun prog-fill-reindent-defun (&optional argument) > + "Refill paragraph or reindent the definition that the point is on. > + > +If the point is in a string, or in a comment, or there is a > +comment on the current line, fill the paragraph that the point is > +in or is on the same line. I don't understand the difference between "point is in a string, or in a comment" and "there is a comment on the current line". > +Otherwise, reindent the definition around or below point." Likewise this one is confusing.