From unknown Thu Jun 19 16:22:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#63790: 30.0.50; prog-fill-reindent-defun regression Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 29 May 2023 17:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 63790 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 63790@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16853800727175 (code B ref -1); Mon, 29 May 2023 17:08:02 +0000 Received: (at submit) by debbugs.gnu.org; 29 May 2023 17:07:52 +0000 Received: from localhost ([127.0.0.1]:59040 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3gLY-0001rf-9i for submit@debbugs.gnu.org; Mon, 29 May 2023 13:07:52 -0400 Received: from lists.gnu.org ([209.51.188.17]:40716) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3gLR-0001rH-5M for submit@debbugs.gnu.org; Mon, 29 May 2023 13:07:45 -0400 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 1q3gLQ-00044R-VL for bug-gnu-emacs@gnu.org; Mon, 29 May 2023 13:07:44 -0400 Received: from relay6-d.mail.gandi.net ([2001:4b98:dc4:8::226]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q3gLP-0001oU-Bp for bug-gnu-emacs@gnu.org; Mon, 29 May 2023 13:07:44 -0400 X-GND-Sasl: juri@linkov.net Received: by mail.gandi.net (Postfix) with ESMTPSA id D9D0EC0004 for ; Mon, 29 May 2023 17:07:40 +0000 (UTC) From: Juri Linkov Organization: LINKOV.NET Date: Mon, 29 May 2023 19:53:07 +0300 Message-ID: <864jnv6pf8.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2001:4b98:dc4:8::226; envelope-from=juri@linkov.net; helo=relay6-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) This regression is in master, not in emacs-29. 0. emacs-30 -Q 1. add to the beginning of the *scratch* buffer a list, so that *scratch* looks like this: (+ 1 2 3) ;; This buffer is for text that is not saved, and for Lisp evaluation. ;; To create a file, visit it with C-x C-f and enter text in its buffer. 2. Activate the region with the beginning at the start of the line with the first comment, and the region end with point at the end of the buffer. 3. Type 'M-q' (prog-fill-reindent-defun) It indents the list instead of the comment. But when point is at the region beginning then 'M-q' correctly indents the comments. From unknown Thu Jun 19 16:22:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#63790: 30.0.50; prog-fill-reindent-defun regression Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 03 Jun 2023 02:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63790 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov , 63790@debbugs.gnu.org Received: via spool by 63790-submit@debbugs.gnu.org id=B63790.168576006231674 (code B ref 63790); Sat, 03 Jun 2023 02:42:02 +0000 Received: (at 63790) by debbugs.gnu.org; 3 Jun 2023 02:41:02 +0000 Received: from localhost ([127.0.0.1]:41136 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5HCQ-0008Ed-2I for submit@debbugs.gnu.org; Fri, 02 Jun 2023 22:41:02 -0400 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:39529) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5HCM-0008E8-Qp for 63790@debbugs.gnu.org; Fri, 02 Jun 2023 22:41:00 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 09B63320084E; Fri, 2 Jun 2023 22:40:50 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Fri, 02 Jun 2023 22:40:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1685760050; x=1685846450; bh=w7F1pFxPw/y4dU/y/fEBt4Lfc4RWvHaZVMU dK1IG2F4=; b=koNgrP8gVrfd33+3acZz+iljRc8lKYFFW7kdO3+h1gaK8Fm3vQZ DuwESF7R/ZGv1QBHsuf7p9D6ThuTheITOQg9mTo04AQ/nMaZBeNilSynMLS1ukeC vFHaLwMAWr/zVyVDTu7OjjEthrH7bUWRd8GxGEU7ILCjJYyF0dG3FdmPJFfnSnIE AaqCRAVRyBaJzVCmMS/ET/dgJFx8xrzkLGgt9tMCcciWJrkMuegAULasrn2q3n2P UawHN7/VEA0z7NaaOz3xRFCEakrNyeVhFYUz39EZSS36jT9qfjNVHZT9zgwIuwLF CHX6sL0OY8xuHMOnJhrSCtncmRfD55t2FxA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1685760050; x= 1685846450; bh=w7F1pFxPw/y4dU/y/fEBt4Lfc4RWvHaZVMUdK1IG2F4=; b=m v02MOkG32XbRJ7u2kn/nTVOFCIDfSZOM2dW2u1fKzXh7QT/8toQ/PZ9xOpYWlbfR teySGocQWeZnH3RkFvvgoMCFk1HwEO8+1jEMt9H9nfOwiG3g5DjAE4qzv4W7p0IM ax4k+NA3Ao/NwlERmJn6+Govv9D7NUK8O0Yi6x/OnpfwS/OUxMyW8Ikp5x2Miyln PQVql8L16UV04REhC6Lxu5gl8xESZebT0M8zFmYQgwoIzgpOS5fM3K76lN3ZY1w+ JMoWA2AQVK2iPotlT0tMyj1qR54WDHkdYs2bK0RC+x3cDC6sOj6fN1p7IVV0bhX5 KoY9h/27y3brd6fDO2qRw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeelgedgiedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvfhfhjggtgfesthejredttdefjeenucfhrhhomhepffhmihht rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth gvrhhnpeeghedthedujeeiteeutddtjeekheejteeukeehffdutdejuedvfeevueeviedu udenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumh hithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 2 Jun 2023 22:40:49 -0400 (EDT) Message-ID: <382ab3bd-b9ed-ea18-1ae5-9458ffb1b85c@gutov.dev> Date: Sat, 3 Jun 2023 05:40:47 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Content-Language: en-US References: <864jnv6pf8.fsf@mail.linkov.net> From: Dmitry Gutov In-Reply-To: <864jnv6pf8.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -1.9 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.9 (--) On 29/05/2023 19:53, Juri Linkov wrote: > This regression is in master, not in emacs-29. If it is a regression, then compared to what? emacs-29 doesn't have this function. Compared to some earlier revision? > 0. emacs-30 -Q > 1. add to the beginning of the *scratch* buffer a list, so that > *scratch* looks like this: > > (+ > 1 > 2 > 3) > > ;; This buffer is for text that is not saved, and for Lisp evaluation. > ;; To create a file, visit it with C-x C-f and enter text in its buffer. > > 2. Activate the region with the beginning at the start of the line with > the first comment, and the region end with point at the end of the buffer. > > 3. Type 'M-q' (prog-fill-reindent-defun) > > It indents the list instead of the comment. > > But when point is at the region beginning then 'M-q' correctly indents > the comments. This happens because in this scenario point ends up outside of the comment (at eob). So when the function is called, in looks for a defun. Did we at some point add (or decide to add) a condition when, if a region is active, it should only refill and not reindent? From unknown Thu Jun 19 16:22:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#63790: 30.0.50; prog-fill-reindent-defun regression Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 04 Jun 2023 17:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63790 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dmitry Gutov Cc: 63790@debbugs.gnu.org Received: via spool by 63790-submit@debbugs.gnu.org id=B63790.168589933232377 (code B ref 63790); Sun, 04 Jun 2023 17:23:02 +0000 Received: (at 63790) by debbugs.gnu.org; 4 Jun 2023 17:22:12 +0000 Received: from localhost ([127.0.0.1]:47062 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5rQh-0008Q9-IN for submit@debbugs.gnu.org; Sun, 04 Jun 2023 13:22:11 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:57819) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5rQf-0008Pu-3r for 63790@debbugs.gnu.org; Sun, 04 Jun 2023 13:22:09 -0400 X-GND-Sasl: juri@linkov.net X-GND-Sasl: juri@linkov.net Received: by mail.gandi.net (Postfix) with ESMTPSA id EB24BC0005; Sun, 4 Jun 2023 17:22:01 +0000 (UTC) From: Juri Linkov In-Reply-To: <382ab3bd-b9ed-ea18-1ae5-9458ffb1b85c@gutov.dev> (Dmitry Gutov's message of "Sat, 3 Jun 2023 05:40:47 +0300") Organization: LINKOV.NET References: <864jnv6pf8.fsf@mail.linkov.net> <382ab3bd-b9ed-ea18-1ae5-9458ffb1b85c@gutov.dev> Date: Sun, 04 Jun 2023 20:14:47 +0300 Message-ID: <86r0qrtaig.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> This regression is in master, not in emacs-29. > > If it is a regression, then compared to what? emacs-29 doesn't have this > function. Compared to some earlier revision? Sorry, the subject was not precise. This is more elaborate: the new function 'prog-fill-reindent-defun' caused a regression for 'M-q' compared to emacs-29 where 'M-q' was bound to 'fill-paragraph'. >> 0. emacs-30 -Q >> 1. add to the beginning of the *scratch* buffer a list, so that >> *scratch* looks like this: >> (+ >> 1 >> 2 >> 3) >> ;; This buffer is for text that is not saved, and for Lisp evaluation. >> ;; To create a file, visit it with C-x C-f and enter text in its buffer. >> 2. Activate the region with the beginning at the start of the line with >> the first comment, and the region end with point at the end of the buffer. >> 3. Type 'M-q' (prog-fill-reindent-defun) >> It indents the list instead of the comment. >> But when point is at the region beginning then 'M-q' correctly indents >> the comments. > > This happens because in this scenario point ends up outside of the comment > (at eob). So when the function is called, in looks for a defun. > > Did we at some point add (or decide to add) a condition when, if a region > is active, it should only refill and not reindent? Maybe the logic of region detecting/handling could be copied from 'fill-paragraph' to 'prog-fill-reindent-defun'? From unknown Thu Jun 19 16:22:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#63790: 30.0.50; prog-fill-reindent-defun regression Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 06 Jun 2023 01:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63790 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov Cc: 63790@debbugs.gnu.org Received: via spool by 63790-submit@debbugs.gnu.org id=B63790.16860157259051 (code B ref 63790); Tue, 06 Jun 2023 01:43:02 +0000 Received: (at 63790) by debbugs.gnu.org; 6 Jun 2023 01:42:05 +0000 Received: from localhost ([127.0.0.1]:50610 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q6Li0-0002Lv-Nf for submit@debbugs.gnu.org; Mon, 05 Jun 2023 21:42:05 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:55753) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q6Lhy-0002LR-AL for 63790@debbugs.gnu.org; Mon, 05 Jun 2023 21:42:03 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 42F3E5C00FB; Mon, 5 Jun 2023 21:41:57 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 05 Jun 2023 21:41:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1686015717; x=1686102117; bh=VwGYl0jTEy4rwy9pwwppCt8L6ii6j9sb9wc zK4+NvLY=; b=fxbJ3RGukcgSPbtf1ulmJg2aggQ7w5EapQWrYUIann9ja2BBsEA +yxG9PZKEaZsPgkWtW5TYGDoPpBp1D/0Z5Iz81wl9eELc1EO0zNaYzNPmqa6gH3v KQtK+36LWhY+VA+S06SzhWJOCS1xnV28rfFHxakUqG9MpZXYm+0JfHRL0NOcomlC BN/nfniRDFQn+pBdx4Vqg1UAvVJrvV9dHezHudD6rXfqyZEnBWvjVEjeCer5XDY/ D5/LdY3s2q4iHuvZzNrBh6dFTUoUcy0wftMLrPSYFAIvQ6OpdIaO0+ijizrxzaNw LZV1S0OKW1iPw70uS1UX9RXnC81diCry5dA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1686015717; x=1686102117; bh=VwGYl0jTEy4rwy9pwwppCt8L6ii6j9sb9wc zK4+NvLY=; b=dBYwzbELI6y3ICEXdjmnGY7IyjXqsftcyujmfKpBhbtYNmrMrg/ atmTMXsz9uug45/NuY7n7eEKoAAD08ds3qTurC8RHxPq9wzDnN0swFZDe90+2Xrg Jj7nkUTUMpaWx82m/qbJt2XxSrQ8uA2EeQx7IWEAe1/93SIeVAni1Z52bg4Tpdf4 u7ZQ9w0Rt02Lt4trfSwhrkk/9B+N0QlwWL9JA8zRe1RLiTWimAex6hhRVC6O8BrI oo7zJXz+IZ6DO8XWEPWKTsdcxeXylXj1AqEXoooXPDvOeHFE0GaHvV/vyeZPoy7i 3afTCBq9KyyVWmmPRwi/K4C0/ejrwU4vIeA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgedttddggeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 5 Jun 2023 21:41:56 -0400 (EDT) Message-ID: Date: Tue, 6 Jun 2023 04:41:55 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Content-Language: en-US References: <864jnv6pf8.fsf@mail.linkov.net> <382ab3bd-b9ed-ea18-1ae5-9458ffb1b85c@gutov.dev> <86r0qrtaig.fsf@mail.linkov.net> From: Dmitry Gutov In-Reply-To: <86r0qrtaig.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -1.8 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.8 (--) On 04/06/2023 20:14, Juri Linkov wrote: >>> This regression is in master, not in emacs-29. >> If it is a regression, then compared to what? emacs-29 doesn't have this >> function. Compared to some earlier revision? > Sorry, the subject was not precise. This is more elaborate: > the new function 'prog-fill-reindent-defun' caused a regression for > 'M-q' compared to emacs-29 where 'M-q' was bound to 'fill-paragraph'. Thanks for the clarification. >>> 0. emacs-30 -Q >>> 1. add to the beginning of the*scratch* buffer a list, so that >>> *scratch* looks like this: >>> (+ >>> 1 >>> 2 >>> 3) >>> ;; This buffer is for text that is not saved, and for Lisp evaluation. >>> ;; To create a file, visit it with C-x C-f and enter text in its buffer. >>> 2. Activate the region with the beginning at the start of the line with >>> the first comment, and the region end with point at the end of the buffer. >>> 3. Type 'M-q' (prog-fill-reindent-defun) >>> It indents the list instead of the comment. >>> But when point is at the region beginning then 'M-q' correctly indents >>> the comments. >> This happens because in this scenario point ends up outside of the comment >> (at eob). So when the function is called, in looks for a defun. >> >> Did we at some point add (or decide to add) a condition when, if a region >> is active, it should only refill and not reindent? > Maybe the logic of region detecting/handling could be copied from > 'fill-paragraph' to 'prog-fill-reindent-defun'? Makes sense. Do you want to suggest a patch? From unknown Thu Jun 19 16:22:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#63790: 30.0.50; prog-fill-reindent-defun regression Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 06 Jun 2023 18:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63790 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dmitry Gutov Cc: 63790@debbugs.gnu.org Received: via spool by 63790-submit@debbugs.gnu.org id=B63790.16860778536293 (code B ref 63790); Tue, 06 Jun 2023 18:58:02 +0000 Received: (at 63790) by debbugs.gnu.org; 6 Jun 2023 18:57:33 +0000 Received: from localhost ([127.0.0.1]:53019 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q6bs4-0001dR-Si for submit@debbugs.gnu.org; Tue, 06 Jun 2023 14:57:33 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:58299) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q6bs2-0001dA-C2 for 63790@debbugs.gnu.org; Tue, 06 Jun 2023 14:57:32 -0400 X-GND-Sasl: juri@linkov.net X-GND-Sasl: juri@linkov.net Received: by mail.gandi.net (Postfix) with ESMTPSA id 4A8B11BF203; Tue, 6 Jun 2023 18:57:22 +0000 (UTC) From: Juri Linkov In-Reply-To: (Dmitry Gutov's message of "Tue, 6 Jun 2023 04:41:55 +0300") Organization: LINKOV.NET References: <864jnv6pf8.fsf@mail.linkov.net> <382ab3bd-b9ed-ea18-1ae5-9458ffb1b85c@gutov.dev> <86r0qrtaig.fsf@mail.linkov.net> Date: Tue, 06 Jun 2023 21:55:49 +0300 Message-ID: <86sfb513m2.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >>>> 3. Type 'M-q' (prog-fill-reindent-defun) >>>> It indents the list instead of the comment. >>>> But when point is at the region beginning then 'M-q' correctly indents >>>> the comments. >>> This happens because in this scenario point ends up outside of the comment >>> (at eob). So when the function is called, in looks for a defun. >>> >>> Did we at some point add (or decide to add) a condition when, if a region >>> is active, it should only refill and not reindent? >> Maybe the logic of region detecting/handling could be copied from >> 'fill-paragraph' to 'prog-fill-reindent-defun'? > > Makes sense. Do you want to suggest a patch? Sorry, can't do, because I don't understand what this line is intended to do, and there are no comments with explanations: (re-search-forward "\\s-*\\s<" (line-end-position) t) It's nil in the reported case, so 'fill-paragraph' is not called. From unknown Thu Jun 19 16:22:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#63790: 30.0.50; prog-fill-reindent-defun regression Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 08 Jun 2023 00:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63790 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov Cc: 63790@debbugs.gnu.org Received: via spool by 63790-submit@debbugs.gnu.org id=B63790.168618455420098 (code B ref 63790); Thu, 08 Jun 2023 00:36:02 +0000 Received: (at 63790) by debbugs.gnu.org; 8 Jun 2023 00:35:54 +0000 Received: from localhost ([127.0.0.1]:55210 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q73d4-0005E5-11 for submit@debbugs.gnu.org; Wed, 07 Jun 2023 20:35:54 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:53909) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q73cz-0005Dq-T0 for 63790@debbugs.gnu.org; Wed, 07 Jun 2023 20:35:53 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 9661D5C01AF; Wed, 7 Jun 2023 20:35:44 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Wed, 07 Jun 2023 20:35:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1686184544; x=1686270944; bh=56mbOFuCrCHlkxl7PsOHyQ7Twp7xzWTU8Nw DkKJA4vQ=; b=QuPZKIhqkkmjRxqRCTlzL2XP2PrLs+2D9nEz0j/6jXy5JVqAJGa 7jq0X6nO6h5nJj6S+Q9eQB0yfZZyf7Z0K7/s1AF070ql7RJQ9mf2Ah3iG2GnYy5C r0sy5UF2UmCJXUpvsrQFL92MOQzz6IXnBK6qIQN1+8zX/aw2XKBfIShGugUqJHJa io0xDtywxMRMbf3RaOqEYPLeIEoc01hbYmxj9JySXySa2pw6IVgXGmX/PaJklp6a IYuCRk51qCM7GNDmKd8cpJX5+siUYCOtNerpvhduG4SP6gtRKU6gnEk0W0y+tduW Y0PCtf6kHoqLX7fJEvm6LejKYPEACidFoBQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1686184544; x=1686270944; bh=56mbOFuCrCHlkxl7PsOHyQ7Twp7xzWTU8Nw DkKJA4vQ=; b=YsP1YXeOSWnEj3fVmaTwxWLo3/zzZuBup4qNVf7xmpv4C0yJrFo +K6sTw+LGAt+jInoYfPfDIIYZQtmgSDU7lrVa24fgM2zbgqJ4iQ5jyb1akKgoL4b AL7IA5birGBn8NnKGqV1/Jx+nXyV44mHIfte2SmIJv0VmneK3eXAMEx4PaXHFZX2 Bcp+pYwbP/BTQ691mCB3j0nwASXC/SrFiSLkxUOmrJ9mv0D86I2MrozXW0o9S124 LiaqPCXbetStzJalGvrFNY2qTZEonpEHbN1t05U2Ji6Jq9LKSA6iof+W+sJfwHfG SYzg+ymam++IJ6HPBtwMbQ8ZFJ+Qz+P2+BQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgedthedgfeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 7 Jun 2023 20:35:43 -0400 (EDT) Message-ID: <476b767a-2126-50c3-6aa9-6877982ed509@gutov.dev> Date: Thu, 8 Jun 2023 03:35:41 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Content-Language: en-US References: <864jnv6pf8.fsf@mail.linkov.net> <382ab3bd-b9ed-ea18-1ae5-9458ffb1b85c@gutov.dev> <86r0qrtaig.fsf@mail.linkov.net> <86sfb513m2.fsf@mail.linkov.net> From: Dmitry Gutov In-Reply-To: <86sfb513m2.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -1.8 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.8 (--) On 06/06/2023 21:55, Juri Linkov wrote: >>>>> 3. Type 'M-q' (prog-fill-reindent-defun) >>>>> It indents the list instead of the comment. >>>>> But when point is at the region beginning then 'M-q' correctly indents >>>>> the comments. >>>> This happens because in this scenario point ends up outside of the comment >>>> (at eob). So when the function is called, in looks for a defun. >>>> >>>> Did we at some point add (or decide to add) a condition when, if a region >>>> is active, it should only refill and not reindent? >>> Maybe the logic of region detecting/handling could be copied from >>> 'fill-paragraph' to 'prog-fill-reindent-defun'? >> Makes sense. Do you want to suggest a patch? > Sorry, can't do, because I don't understand what this line is intended to do, > and there are no comments with explanations: > > (re-search-forward "\\s-*\\s<" (line-end-position) t) It's looking for a comment that begins after point (possibly preceded by whitespace). There is no comment after point in the presented scenario. > It's nil in the reported case, so 'fill-paragraph' is not called. I guess when there is an active region, we would force the behavior to "refill" the region, no matter whether it is inside a comment, or contains a comment, or outside of any comments and simply contains code? From unknown Thu Jun 19 16:22:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#63790: 30.0.50; prog-fill-reindent-defun regression Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 08 Jun 2023 17:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63790 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dmitry Gutov Cc: 63790@debbugs.gnu.org Received: via spool by 63790-submit@debbugs.gnu.org id=B63790.168624406931427 (code B ref 63790); Thu, 08 Jun 2023 17:08:01 +0000 Received: (at 63790) by debbugs.gnu.org; 8 Jun 2023 17:07:49 +0000 Received: from localhost ([127.0.0.1]:57419 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q7J6y-0008Ap-No for submit@debbugs.gnu.org; Thu, 08 Jun 2023 13:07:48 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:38515) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q7J6w-0008AZ-5z for 63790@debbugs.gnu.org; Thu, 08 Jun 2023 13:07:47 -0400 X-GND-Sasl: juri@linkov.net X-GND-Sasl: juri@linkov.net Received: by mail.gandi.net (Postfix) with ESMTPSA id 61620FF80A; Thu, 8 Jun 2023 17:07:37 +0000 (UTC) From: Juri Linkov In-Reply-To: <476b767a-2126-50c3-6aa9-6877982ed509@gutov.dev> (Dmitry Gutov's message of "Thu, 8 Jun 2023 03:35:41 +0300") Organization: LINKOV.NET References: <864jnv6pf8.fsf@mail.linkov.net> <382ab3bd-b9ed-ea18-1ae5-9458ffb1b85c@gutov.dev> <86r0qrtaig.fsf@mail.linkov.net> <86sfb513m2.fsf@mail.linkov.net> <476b767a-2126-50c3-6aa9-6877982ed509@gutov.dev> Date: Thu, 08 Jun 2023 19:59:53 +0300 Message-ID: <86o7lpsxdi.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> (re-search-forward "\\s-*\\s<" (line-end-position) t) > > It's looking for a comment that begins after point (possibly preceded by > whitespace). There is no comment after point in the presented scenario. > >> It's nil in the reported case, so 'fill-paragraph' is not called. > > I guess when there is an active region, we would force the behavior to > "refill" the region, no matter whether it is inside a comment, or contains > a comment, or outside of any comments and simply contains code? While 'prog-fill-reindent-defun' doesn't support indentation of an arbitrary region of code and indents only the top-level list (defun), it looks like the right thing is to fill the region. I still don't understand why 'M-q' now does the same what 'C-M-q' was doing all the time with code indentation? Also why 'prog-fill-reindent-defun' can't indent the region of code, but only the region of comments? Shouldn't 'M-q' only refill comments, and 'C-M-q' only indent code, as before? From unknown Thu Jun 19 16:22:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#63790: 30.0.50; prog-fill-reindent-defun regression Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Jun 2023 01:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63790 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov Cc: 63790@debbugs.gnu.org Received: via spool by 63790-submit@debbugs.gnu.org id=B63790.168627593019892 (code B ref 63790); Fri, 09 Jun 2023 01:59:01 +0000 Received: (at 63790) by debbugs.gnu.org; 9 Jun 2023 01:58:50 +0000 Received: from localhost ([127.0.0.1]:57939 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q7ROs-0005Am-1S for submit@debbugs.gnu.org; Thu, 08 Jun 2023 21:58:50 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:53823) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q7ROn-0005AW-FA for 63790@debbugs.gnu.org; Thu, 08 Jun 2023 21:58:49 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id DCC1D5C016A; Thu, 8 Jun 2023 21:58:39 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 08 Jun 2023 21:58:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1686275919; x=1686362319; bh=3xhMThtVprq+1VFauk31zTAo/lmehQzfJum zHX9my20=; b=yJgV/rj0/9FMKDjHywLshNdZPJE2U9Ehu8HyppFdQJZN10H7eEs RxTp30gniSos43EzM+eUcgZP1TKK2trp928Xzw0kNjHC0pYxZAXNS/DRO9qEmpyH EMQJiSuaRPwhY4TDgUbRfmFDgsD6NIYk05bf0blkR1TwaGOhoeED1/evM0AfOXeE Us3mry2kZxmw2Fd+tbe3D0uXgvIuFwMZKEDkmP0hUYufiaYaYNlN9wnLkigS2dVT QAvv1ZINuZMTr/WYWaWpbZWeNaZb/IjCqj/lMibeL/F6Gr6S5CbcahYo0yoi/Vem izGwEObYUq0vv0A+3P4myE/F4apbGakv0Bw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1686275919; x=1686362319; bh=3xhMThtVprq+1VFauk31zTAo/lmehQzfJum zHX9my20=; b=cmT+yZaWUmLe5+X0qzJdpRckRGGX/s38g5F3mOAmJrsxBHjbIU6 lbyLNxrvZF1Bje2XhLzfmdhVlmOUynndWRc9by6mJGXA3M4gOJCgxJZqGA25fr+e cCTtCkQ0IwZbNVBs90EmB+9PPeEUO0RFzb3DKOEncOquZ5z5Qy22xCwSQvoyiT1Z vOUjpfNiiVkTM9Tit3xRbQe6QQt/lBIWNdWSYuedlg8UZB7HGvLvtT34x5zWLZdU bhKQMAo8D3xXTNvEVii9n7hZ33lDFU3YGBEhxdNguZHTpA4aTMQFYy3mUL6dIEtT EVZR8cekFBCeOJgYGKM2Ej2heBs1Yc6r3Rg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgedtjedghedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 8 Jun 2023 21:58:38 -0400 (EDT) Message-ID: <83a2971d-b855-e45e-44ae-65b693f0f4bc@gutov.dev> Date: Fri, 9 Jun 2023 04:58:35 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Content-Language: en-US References: <864jnv6pf8.fsf@mail.linkov.net> <382ab3bd-b9ed-ea18-1ae5-9458ffb1b85c@gutov.dev> <86r0qrtaig.fsf@mail.linkov.net> <86sfb513m2.fsf@mail.linkov.net> <476b767a-2126-50c3-6aa9-6877982ed509@gutov.dev> <86o7lpsxdi.fsf@mail.linkov.net> From: Dmitry Gutov In-Reply-To: <86o7lpsxdi.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -1.9 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.9 (--) On 08/06/2023 19:59, Juri Linkov wrote: >>> (re-search-forward "\\s-*\\s<" (line-end-position) t) >> >> It's looking for a comment that begins after point (possibly preceded by >> whitespace). There is no comment after point in the presented scenario. >> >>> It's nil in the reported case, so 'fill-paragraph' is not called. >> >> I guess when there is an active region, we would force the behavior to >> "refill" the region, no matter whether it is inside a comment, or contains >> a comment, or outside of any comments and simply contains code? > > While 'prog-fill-reindent-defun' doesn't support indentation of an > arbitrary region of code and indents only the top-level list (defun), > it looks like the right thing is to fill the region. Okay? > I still don't understand why 'M-q' now does the same what 'C-M-q' was > doing all the time with code indentation? C-M-q (indent-pp-sexp) reindents the list that follows point. Not the same thing. And it's only available in Lisp. > Also why 'prog-fill-reindent-defun' > can't indent the region of code, but only the region of comments? Do you want it to? > Shouldn't 'M-q' only refill comments, and 'C-M-q' only indent code, as before? Up until now, we thought that making two actions on one key binding available is a good thing, given that the context usually helps to disambiguate. This one seems like an exception, but IMHO not a strong enough one to roll back the change. From unknown Thu Jun 19 16:22:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#63790: 30.0.50; prog-fill-reindent-defun regression Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Jun 2023 17:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63790 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dmitry Gutov Cc: 63790@debbugs.gnu.org Received: via spool by 63790-submit@debbugs.gnu.org id=B63790.168633264212140 (code B ref 63790); Fri, 09 Jun 2023 17:45:02 +0000 Received: (at 63790) by debbugs.gnu.org; 9 Jun 2023 17:44:02 +0000 Received: from localhost ([127.0.0.1]:60300 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q7g9Z-00039V-DJ for submit@debbugs.gnu.org; Fri, 09 Jun 2023 13:44:01 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:42101) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q7g9X-00039I-2k for 63790@debbugs.gnu.org; Fri, 09 Jun 2023 13:43:59 -0400 X-GND-Sasl: juri@linkov.net X-GND-Sasl: juri@linkov.net Received: by mail.gandi.net (Postfix) with ESMTPSA id D1E05FF804; Fri, 9 Jun 2023 17:43:51 +0000 (UTC) From: Juri Linkov In-Reply-To: <83a2971d-b855-e45e-44ae-65b693f0f4bc@gutov.dev> (Dmitry Gutov's message of "Fri, 9 Jun 2023 04:58:35 +0300") Organization: LINKOV.NET References: <864jnv6pf8.fsf@mail.linkov.net> <382ab3bd-b9ed-ea18-1ae5-9458ffb1b85c@gutov.dev> <86r0qrtaig.fsf@mail.linkov.net> <86sfb513m2.fsf@mail.linkov.net> <476b767a-2126-50c3-6aa9-6877982ed509@gutov.dev> <86o7lpsxdi.fsf@mail.linkov.net> <83a2971d-b855-e45e-44ae-65b693f0f4bc@gutov.dev> Date: Fri, 09 Jun 2023 20:37:04 +0300 Message-ID: <86r0qkk05b.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >>>> (re-search-forward "\\s-*\\s<" (line-end-position) t) >>> >>> It's looking for a comment that begins after point (possibly preceded by >>> whitespace). There is no comment after point in the presented scenario. >>> >>>> It's nil in the reported case, so 'fill-paragraph' is not called. >>> >>> I guess when there is an active region, we would force the behavior to >>> "refill" the region, no matter whether it is inside a comment, or contains >>> a comment, or outside of any comments and simply contains code? >> While 'prog-fill-reindent-defun' doesn't support indentation of an >> arbitrary region of code and indents only the top-level list (defun), >> it looks like the right thing is to fill the region. > > Okay? Unless it's possible to make 'M-q' more predictable. >> I still don't understand why 'M-q' now does the same what 'C-M-q' was >> doing all the time with code indentation? > > C-M-q (indent-pp-sexp) reindents the list that follows point. Not the same > thing. And it's only available in Lisp. I tried in emacs-28 and in ruby-mode 'C-M-q' reindents the code. This is from the Help window: C-M-q runs the command prog-indent-sexp (found in ruby-mode-map), which is an interactive byte-compiled Lisp function in ‘prog-mode.el’. It is bound to C-M-q, . (prog-indent-sexp &optional DEFUN) Indent the expression after point. When interactively called with prefix, indent the enclosing defun instead. >> Also why 'prog-fill-reindent-defun' >> can't indent the region of code, but only the region of comments? > > Do you want it to? It would be nice, and it's easy to implement just by calling 'indent-region'. >> Shouldn't 'M-q' only refill comments, and 'C-M-q' only indent code, as before? > > Up until now, we thought that making two actions on one key binding > available is a good thing, given that the context usually helps to > disambiguate. This one seems like an exception, but IMHO not a strong > enough one to roll back the change. Before the change, the distinction was clear: 'C-M-q' reindents code, 'M-q' refills text in comments. Whereas I admit that 'M-q' is useless on code, now the distinction is blurred, and DWIM is not reliable.