GNU bug report logs - #63790
30.0.50; prog-fill-reindent-defun regression

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Juri Linkov <juri@HIDDEN>; merged with #81281; Done: Juri Linkov <juri@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
bug marked as fixed in version 32.0.50, send any further explanations to 63790 <at> debbugs.gnu.org and Juri Linkov <juri@HIDDEN> Request was from Juri Linkov <juri@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 63790 <at> debbugs.gnu.org:


Received: (at 63790) by debbugs.gnu.org; 30 Jun 2026 15:54:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jun 30 11:54:25 2026
Received: from localhost ([127.0.0.1]:52671 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1wean2-0001DB-Vd
	for submit <at> debbugs.gnu.org; Tue, 30 Jun 2026 11:54:25 -0400
Received: from mout-p-202.mailbox.org ([2001:67c:2050:0:465::202]:60968)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>)
 id 1wean0-0001Cr-V2; Tue, 30 Jun 2026 11:54:23 -0400
Received: from smtp202.mailbox.org (smtp202.mailbox.org
 [IPv6:2001:67c:2050:b231:465::202])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4gqSPg5W9Vz9tvv;
 Tue, 30 Jun 2026 17:54:15 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linkov.net; s=MBO0001; 
 t=1782834855;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=3nzaDnfykPw7nMxaPxY1rP1vMj9ugV5PQhvXQhxh8BQ=;
 b=FVp8MqJeJviJxEEkllBd9sjcYi7RiMO/9Eqf2RkRVX6wNXcqSPuiV1JOQJCUB6lsTT4tZE
 zOYLFzwEKOHG80SrZ0IRofkvlw+Hg35ivFYYGCZvIcoZ1Nmr7oSx9H8WjELPPi+Bzh5+Ii
 EZ0MMbz4vEap6U/WNQAtdfdMbWmyILQzUyMRBvbomK2DCcBeIRA9NSxL8e4fcHQx/UGS69
 3+hL2olYZ7OAW88NUwYN7TmtrzaucDUnyu/1/KBj4AHmU2829JMe0BDsDiaPltIQnhEgTl
 kPBUpzfEY70JTzz+DTSQ+Bhl9kZ26e7x4KEaQZs3KW91rJyV6XkKcg+5aZnL4g==
Authentication-Results: outgoing_mbo_mout; dkim=none;
 spf=pass (outgoing_mbo_mout: domain of juri@HIDDEN designates
 2001:67c:2050:b231:465::202 as permitted sender)
 smtp.mailfrom=juri@HIDDEN
From: Juri Linkov <juri@HIDDEN>
To: Dmitry Gutov <dmitry@HIDDEN>
Subject: Re: bug#63790: 30.0.50; prog-fill-reindent-defun regression
In-Reply-To: <87ldbyrb1e.fsf@HIDDEN>
Organization: LINKOV.NET
References: <864jnv6pf8.fsf@HIDDEN>
 <382ab3bd-b9ed-ea18-1ae5-9458ffb1b85c@HIDDEN>
 <86r0qrtaig.fsf@HIDDEN>
 <cecc72f5-adc1-a4cf-c085-d96bb82e5eb7@HIDDEN>
 <87fr29b92n.fsf@HIDDEN> <87ldbyrb1e.fsf@HIDDEN>
Date: Tue, 30 Jun 2026 18:53:00 +0300
Message-ID: <87v7b0yqhv.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Rspamd-Queue-Id: 4gqSPg5W9Vz9tvv
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 63790
Cc: 63790 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

close 63790 32.0.50
thanks

> Here is a complete patch that fixes both
> bug#63790 and bug#81281.

Now the fix is pushed to master and closed.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#63790; Package emacs. Full text available.

Message received at 63790 <at> debbugs.gnu.org:


Received: (at 63790) by debbugs.gnu.org; 28 Jun 2026 15:24:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jun 28 11:24:49 2026
Received: from localhost ([127.0.0.1]:59400 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1wdrNH-0000IS-3c
	for submit <at> debbugs.gnu.org; Sun, 28 Jun 2026 11:24:49 -0400
Received: from mout-p-101.mailbox.org ([2001:67c:2050:0:465::101]:35830)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1wdrN0-0000G5-63
 for 63790 <at> debbugs.gnu.org; Sun, 28 Jun 2026 11:24:36 -0400
Received: from smtp202.mailbox.org (smtp202.mailbox.org
 [IPv6:2001:67c:2050:b231:465::202])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4gpCr62K8Cz9tZS;
 Sun, 28 Jun 2026 17:24:22 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linkov.net; s=MBO0001; 
 t=1782660262;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=6DH8B+S8du03x0XJdFaxylvuzvVUtI+u1adUrDm7DZI=;
 b=A+TRFmQUE8Zxs3P7afqSJlq9QJbGsxjt9GB8nu38tpDS11qycwALsc8fXyJvkf9dMLjBHd
 sYvqEAb819cW2bjh2oIXWmcaMRUEsotPMhVnBRY3IOmSW0q688z+DIXFRj+4hjmzw8Xrg0
 5ffFykY016j0r2dRbQUzJq1D29mVZlduZRCqxXsm+XjTN+O8OuGRBoWTGNe+Bdl+Mps/zf
 ZQqEQjQUoamLyRRGaL1fdKJk5iLy/KI9MW3HzcjaRFRnikZF2eh2I72EjoaJR+zVY/9JeY
 iOZxPAydDPOqVMDcgwbHl/6d8p4qCxNGBzATpmUPHn6SsQ4+s/yoQxq2IRhjjA==
Authentication-Results: outgoing_mbo_mout; dkim=none;
 spf=pass (outgoing_mbo_mout: domain of juri@HIDDEN designates
 2001:67c:2050:b231:465::202 as permitted sender)
 smtp.mailfrom=juri@HIDDEN
From: Juri Linkov <juri@HIDDEN>
To: Dmitry Gutov <dmitry@HIDDEN>
Subject: Re: bug#63790: 30.0.50; prog-fill-reindent-defun regression
In-Reply-To: <87fr29b92n.fsf@HIDDEN>
Organization: LINKOV.NET
References: <864jnv6pf8.fsf@HIDDEN>
 <382ab3bd-b9ed-ea18-1ae5-9458ffb1b85c@HIDDEN>
 <86r0qrtaig.fsf@HIDDEN>
 <cecc72f5-adc1-a4cf-c085-d96bb82e5eb7@HIDDEN>
 <87fr29b92n.fsf@HIDDEN>
Date: Sun, 28 Jun 2026 18:23:57 +0300
Message-ID: <87ldbyrb1e.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Rspamd-Queue-Id: 4gpCr62K8Cz9tZS
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 63790
Cc: 63790 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

--=-=-=
Content-Type: text/plain

> Maybe something like this to check if other
> region's end is inside the comment:

Here is a complete patch that fixes both
bug#63790 and bug#81281.

Is it suitable for the release branch or safer for master?


--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline; filename=prog--text-at-point-or-region-p.patch

diff --git a/lisp/treesit.el b/lisp/treesit.el
index dbb39b19226..b5c7f2852d8 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -58,7 +58,7 @@
 (require 'cl-lib)
 (require 'font-lock)
 (require 'seq)
-(require 'prog-mode) ; For `prog--text-at-point-p'.
+(require 'prog-mode) ; For `prog--text-at-point-or-region-p'.
 
 ;;; Function declarations
 
@@ -4165,7 +4165,7 @@ treesit-fill-reindent-defun
 JUSTIFY is the same as in `fill-paragraph'."
   (interactive "P")
   (save-excursion
-    (if (prog--text-at-point-p)
+    (if (prog--text-at-point-or-region-p)
         (fill-paragraph justify (region-active-p))
       (let* ((treesit-defun-tactic 'parent-first)
              (node (treesit-defun-at-point)))
diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el
index afa18d9958b..a1cc32d3601 100644
--- a/lisp/progmodes/prog-mode.el
+++ b/lisp/progmodes/prog-mode.el
@@ -166,6 +166,14 @@ prog--text-at-point-p
         (and (re-search-forward "\\s-*\\s<" (line-end-position) t)
              (nth 8 (syntax-ppss))))))
 
+(defun prog--text-at-point-or-region-p ()
+  "Return non-nil if point or region's other end are in text."
+  (or (prog--text-at-point-p)
+      (and (use-region-p)
+           (save-excursion
+             (goto-char (mark))
+             (prog--text-at-point-p)))))
+
 (defvar prog-fill-reindent-defun-function
   #'prog-fill-reindent-defun-default
   "Function called by `prog-fill-reindent-defun' to do the actual work.
@@ -176,7 +184,7 @@ prog-fill-reindent-defun-default
 JUSTIFY is the same as in `fill-paragraph'."
   (interactive "P")
   (save-excursion
-    (if (prog--text-at-point-p)
+    (if (prog--text-at-point-or-region-p)
         (fill-paragraph justify (region-active-p))
       (beginning-of-defun)
       (let ((start (point)))

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#63790; Package emacs. Full text available.

Message received at 63790 <at> debbugs.gnu.org:


Received: (at 63790) by debbugs.gnu.org; 26 Jun 2026 15:46:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jun 26 11:46:07 2026
Received: from localhost ([127.0.0.1]:44000 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1wd8kl-00038o-KO
	for submit <at> debbugs.gnu.org; Fri, 26 Jun 2026 11:46:07 -0400
Received: from mout-p-201.mailbox.org ([2001:67c:2050:0:465::201]:42462)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1wd8kc-000377-Je
 for 63790 <at> debbugs.gnu.org; Fri, 26 Jun 2026 11:45:58 -0400
Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4gn0Ph6KWsz9v3Q;
 Fri, 26 Jun 2026 17:45:44 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linkov.net; s=MBO0001; 
 t=1782488744;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=UiSgTPy8SX6siDwLCLy7mbKqHtgSSKnd1Rfnfa0MFYQ=;
 b=B+ZedM+xjTNcyGP82489XT1SBBPSsj1IZ9OeoWL745gUJbQuBpro8ddlcTLm5qTB5ROt7G
 Cp2jJY8AE96ylCRL0kbQw+YIsW8X3GHmRFfHUJFW6JsjuniA4XH4Ei8sRSyt8hBblIyjYS
 9ZdvMpgCobtRbL2qrWp4F0mMc3IIq2yMwDO0Bm4btgSAdm7+svyE3AhIfa9qvfBOpF5Tja
 U0YKO0M9m7QsUZBntXtIennKpNGcINQRx9WM96rWYGiLAJlXP3qOFLejusHvdaU5HvUy7e
 mD/olhK85rdGll6aE9Ekyf/bCYQFP21iok71TqpDNiqF2289xPvk31WgBGWlIw==
From: Juri Linkov <juri@HIDDEN>
To: Dmitry Gutov <dmitry@HIDDEN>
Subject: Re: bug#63790: 30.0.50; prog-fill-reindent-defun regression
In-Reply-To: <cecc72f5-adc1-a4cf-c085-d96bb82e5eb7@HIDDEN>
Organization: LINKOV.NET
References: <864jnv6pf8.fsf@HIDDEN>
 <382ab3bd-b9ed-ea18-1ae5-9458ffb1b85c@HIDDEN>
 <86r0qrtaig.fsf@HIDDEN>
 <cecc72f5-adc1-a4cf-c085-d96bb82e5eb7@HIDDEN>
Date: Fri, 26 Jun 2026 18:44:16 +0300
Message-ID: <87fr29b92n.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 63790
Cc: 63790 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

--=-=-=
Content-Type: text/plain

>>> 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?

Maybe something like this to check if other
region's end is inside the comment:


--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline; filename=prog-fill-reindent-defun-default.patch

diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el
index afa18d9958b..89b0485c5e6 100644
--- a/lisp/progmodes/prog-mode.el
+++ b/lisp/progmodes/prog-mode.el
@@ -176,7 +176,11 @@ prog-fill-reindent-defun-default
 JUSTIFY is the same as in `fill-paragraph'."
   (interactive "P")
   (save-excursion
-    (if (prog--text-at-point-p)
+    (if (or (prog--text-at-point-p)
+            (and (use-region-p)
+                 (save-excursion
+                   (goto-char (mark))
+                   (prog--text-at-point-p))))
         (fill-paragraph justify (region-active-p))
       (beginning-of-defun)
       (let ((start (point)))

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#63790; Package emacs. Full text available.

Message received at 63790 <at> debbugs.gnu.org:


Received: (at 63790) by debbugs.gnu.org; 25 Jun 2026 16:11:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jun 25 12:11:01 2026
Received: from localhost ([127.0.0.1]:34049 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1wcmfL-0007xz-Tx
	for submit <at> debbugs.gnu.org; Thu, 25 Jun 2026 12:11:01 -0400
Received: from mout-p-201.mailbox.org ([2001:67c:2050:0:465::201]:43756)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1wcmfH-0007x6-E7
 for 63790 <at> debbugs.gnu.org; Thu, 25 Jun 2026 12:10:57 -0400
Received: from smtp1.mailbox.org (smtp1.mailbox.org
 [IPv6:2001:67c:2050:b231:465::1])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4gmP131klsz9v5P;
 Thu, 25 Jun 2026 18:10:47 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linkov.net; s=MBO0001; 
 t=1782403847;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=vP3JyRflRti4SiKIJ483fAiEEmcW7ViqPecWR0Vpq9o=;
 b=p4wECJwz4y0fyEl4D6we8fQMyOF9iCq8Osj75kRHb7hUWz6TfyelMIlW1nDtODXhLYo020
 9HjRfsEgw4HBsbLpeHrUHeCs4QesaPR44qi9PZwVrMPaBgSyH7AwhrC+n3cj1MjThSiXL/
 8QnoJTpMrg58rk2UXhTeuruNHVS6VEhY8QV4OgAmnx/yDf1dfp+UPEz4WivWTq+E9VgzQU
 lIs0Xc8epduLHuHYLnAznDrD+21bSbqkc43LrpIQbRrPsKQOQTtCag/ChmaV0NR6t9PSJS
 IsQYiDyTkzOMSRr8i5jXoPreaqu8/+b1+Fpm0ofcfNkIpKAcMuXnVdAQHmFSxQ==
Authentication-Results: outgoing_mbo_mout; dkim=none;
 spf=pass (outgoing_mbo_mout: domain of juri@HIDDEN designates
 2001:67c:2050:b231:465::1 as permitted sender) smtp.mailfrom=juri@HIDDEN
From: Juri Linkov <juri@HIDDEN>
To: Dmitry Gutov <dmitry@HIDDEN>
Subject: Re: bug#63790: 30.0.50; prog-fill-reindent-defun regression
In-Reply-To: <382ab3bd-b9ed-ea18-1ae5-9458ffb1b85c@HIDDEN>
Organization: LINKOV.NET
References: <864jnv6pf8.fsf@HIDDEN>
 <382ab3bd-b9ed-ea18-1ae5-9458ffb1b85c@HIDDEN>
Date: Thu, 25 Jun 2026 18:58:40 +0300
Message-ID: <87bjcyr4a8.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Rspamd-Queue-Id: 4gmP131klsz9v5P
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 63790
Cc: 63790 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

> 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.

Now in 'prog--text-at-point-p' we can use the new variable
'comment-start-line-regexp' from bug#80837 to detect the case
when point is at BOL after the line comment that can count
as the comment end.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#63790; Package emacs. Full text available.
Forcibly Merged 63790 81281. Request was from Juri Linkov <juri@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 63790 <at> debbugs.gnu.org:


Received: (at 63790) by debbugs.gnu.org; 9 Jun 2023 17:44:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jun 09 13:44:01 2023
Received: from localhost ([127.0.0.1]:60300 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1q7g9Z-00039V-DJ
	for submit <at> 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 <juri@HIDDEN>) id 1q7g9X-00039I-2k
 for 63790 <at> debbugs.gnu.org; Fri, 09 Jun 2023 13:43:59 -0400
X-GND-Sasl: juri@HIDDEN
X-GND-Sasl: juri@HIDDEN
Received: by mail.gandi.net (Postfix) with ESMTPSA id D1E05FF804;
 Fri,  9 Jun 2023 17:43:51 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Dmitry Gutov <dmitry@HIDDEN>
Subject: Re: bug#63790: 30.0.50; prog-fill-reindent-defun regression
In-Reply-To: <83a2971d-b855-e45e-44ae-65b693f0f4bc@HIDDEN> (Dmitry Gutov's
 message of "Fri, 9 Jun 2023 04:58:35 +0300")
Organization: LINKOV.NET
References: <864jnv6pf8.fsf@HIDDEN>
 <382ab3bd-b9ed-ea18-1ae5-9458ffb1b85c@HIDDEN>
 <86r0qrtaig.fsf@HIDDEN>
 <cecc72f5-adc1-a4cf-c085-d96bb82e5eb7@HIDDEN>
 <86sfb513m2.fsf@HIDDEN>
 <476b767a-2126-50c3-6aa9-6877982ed509@HIDDEN>
 <86o7lpsxdi.fsf@HIDDEN>
 <83a2971d-b855-e45e-44ae-65b693f0f4bc@HIDDEN>
Date: Fri, 09 Jun 2023 20:37:04 +0300
Message-ID: <86r0qkk05b.fsf@HIDDEN>
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-Debbugs-Envelope-To: 63790
Cc: 63790 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
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, <menu-bar> <ruby> <Indent Sexp-9>.

  (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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#63790; Package emacs. Full text available.

Message received at 63790 <at> debbugs.gnu.org:


Received: (at 63790) by debbugs.gnu.org; 9 Jun 2023 01:58:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jun 08 21:58:50 2023
Received: from localhost ([127.0.0.1]:57939 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1q7ROs-0005Am-1S
	for submit <at> 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 <dmitry@HIDDEN>) id 1q7ROn-0005AW-FA
 for 63790 <at> 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: <xms:T4eCZPWROqdRmszUgrRw5wIMfFb_Kkv9RSSg57WlxMey_9Jlj0JifA>
 <xme:T4eCZHlf5B7-g50oqmdvlCyOTZ8vXAhA0YHkhwPb2GsPyg7MkUyH2Je08zCvsm7dF
 JJR0FW7I_AGgbyBAO8>
X-ME-Received: <xmr:T4eCZLa07z3km4KjVMbkr2I1p817jMfOmS9OH6qUS39f3Da-gP0zP6uiGHngUa4>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgedtjedghedvucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi
 thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth
 htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel
 vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug
 hmihhtrhihsehguhhtohhvrdguvghv
X-ME-Proxy: <xmx:T4eCZKXhFmz52jKtH-_EhIWam1QG8IWE8Ol6JfpLrYtDc5fMcdQusg>
 <xmx:T4eCZJkV2OrDok8D1whwbj2rVW8XnjIIyH41vmMeyKVNXBZZka5p3w>
 <xmx:T4eCZHdEWzl9N4_-pxI8tw2P0hOxEKXyBp8viNc6Y0By1wnNJwSsWg>
 <xmx:T4eCZItyvi3K6rqfUjZCr16F7B1TIUNQHyk4hZRF3OGatO4KxkbeMw>
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@HIDDEN>
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
Subject: Re: bug#63790: 30.0.50; prog-fill-reindent-defun regression
Content-Language: en-US
To: Juri Linkov <juri@HIDDEN>
References: <864jnv6pf8.fsf@HIDDEN>
 <382ab3bd-b9ed-ea18-1ae5-9458ffb1b85c@HIDDEN>
 <86r0qrtaig.fsf@HIDDEN>
 <cecc72f5-adc1-a4cf-c085-d96bb82e5eb7@HIDDEN>
 <86sfb513m2.fsf@HIDDEN>
 <476b767a-2126-50c3-6aa9-6877982ed509@HIDDEN>
 <86o7lpsxdi.fsf@HIDDEN>
From: Dmitry Gutov <dmitry@HIDDEN>
In-Reply-To: <86o7lpsxdi.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -1.9 (-)
X-Debbugs-Envelope-To: 63790
Cc: 63790 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#63790; Package emacs. Full text available.

Message received at 63790 <at> debbugs.gnu.org:


Received: (at 63790) by debbugs.gnu.org; 8 Jun 2023 17:07:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jun 08 13:07:49 2023
Received: from localhost ([127.0.0.1]:57419 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1q7J6y-0008Ap-No
	for submit <at> 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 <juri@HIDDEN>) id 1q7J6w-0008AZ-5z
 for 63790 <at> debbugs.gnu.org; Thu, 08 Jun 2023 13:07:47 -0400
X-GND-Sasl: juri@HIDDEN
X-GND-Sasl: juri@HIDDEN
Received: by mail.gandi.net (Postfix) with ESMTPSA id 61620FF80A;
 Thu,  8 Jun 2023 17:07:37 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Dmitry Gutov <dmitry@HIDDEN>
Subject: Re: bug#63790: 30.0.50; prog-fill-reindent-defun regression
In-Reply-To: <476b767a-2126-50c3-6aa9-6877982ed509@HIDDEN> (Dmitry Gutov's
 message of "Thu, 8 Jun 2023 03:35:41 +0300")
Organization: LINKOV.NET
References: <864jnv6pf8.fsf@HIDDEN>
 <382ab3bd-b9ed-ea18-1ae5-9458ffb1b85c@HIDDEN>
 <86r0qrtaig.fsf@HIDDEN>
 <cecc72f5-adc1-a4cf-c085-d96bb82e5eb7@HIDDEN>
 <86sfb513m2.fsf@HIDDEN>
 <476b767a-2126-50c3-6aa9-6877982ed509@HIDDEN>
Date: Thu, 08 Jun 2023 19:59:53 +0300
Message-ID: <86o7lpsxdi.fsf@HIDDEN>
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-Debbugs-Envelope-To: 63790
Cc: 63790 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
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?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#63790; Package emacs. Full text available.

Message received at 63790 <at> debbugs.gnu.org:


Received: (at 63790) by debbugs.gnu.org; 8 Jun 2023 00:35:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jun 07 20:35:54 2023
Received: from localhost ([127.0.0.1]:55210 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1q73d4-0005E5-11
	for submit <at> 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 <dmitry@HIDDEN>) id 1q73cz-0005Dq-T0
 for 63790 <at> 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: <xms:YCKBZNCK661p17asPAxF-kGXpL1ofhAaX21nMfGZcOSEqRGjAgIoPA>
 <xme:YCKBZLgWt0u86ttNCHMJcuGNXYG9158v3-TuZqIwJ-aTizDRje82T8hv65iHPl9Bs
 -0j8prjTok25MyeK9c>
X-ME-Received: <xmr:YCKBZIlUXjR0PI6o85kIx99LLlXRq16-zWMgjpNvrSu-Hf4YAbP40SMtWWpSD9U>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgedthedgfeeiucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi
 thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth
 htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel
 vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug
 hmihhtrhihsehguhhtohhvrdguvghv
X-ME-Proxy: <xmx:YCKBZHyATA3VjW02u5RtomN288-dmHbEK0t09_9MFlCrLm0dpqPp4A>
 <xmx:YCKBZCThlZu1mz8WwdbKmB1L48qmNlLt9fU29jfTCmF41Qb3LD2QwA>
 <xmx:YCKBZKbQLS2TID20MbQO4iEpwMhFjpjon6hLuGxRdXbw8MbJzXFXEw>
 <xmx:YCKBZL4ZxM3HPqOl52HprQxO1at4RfjO_y6co9YgiMr0NqAeV14oRA>
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@HIDDEN>
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
Subject: Re: bug#63790: 30.0.50; prog-fill-reindent-defun regression
Content-Language: en-US
To: Juri Linkov <juri@HIDDEN>
References: <864jnv6pf8.fsf@HIDDEN>
 <382ab3bd-b9ed-ea18-1ae5-9458ffb1b85c@HIDDEN>
 <86r0qrtaig.fsf@HIDDEN>
 <cecc72f5-adc1-a4cf-c085-d96bb82e5eb7@HIDDEN>
 <86sfb513m2.fsf@HIDDEN>
From: Dmitry Gutov <dmitry@HIDDEN>
In-Reply-To: <86sfb513m2.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -1.8 (-)
X-Debbugs-Envelope-To: 63790
Cc: 63790 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
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?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#63790; Package emacs. Full text available.

Message received at 63790 <at> debbugs.gnu.org:


Received: (at 63790) by debbugs.gnu.org; 6 Jun 2023 18:57:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jun 06 14:57:33 2023
Received: from localhost ([127.0.0.1]:53019 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1q6bs4-0001dR-Si
	for submit <at> 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 <juri@HIDDEN>) id 1q6bs2-0001dA-C2
 for 63790 <at> debbugs.gnu.org; Tue, 06 Jun 2023 14:57:32 -0400
X-GND-Sasl: juri@HIDDEN
X-GND-Sasl: juri@HIDDEN
Received: by mail.gandi.net (Postfix) with ESMTPSA id 4A8B11BF203;
 Tue,  6 Jun 2023 18:57:22 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Dmitry Gutov <dmitry@HIDDEN>
Subject: Re: bug#63790: 30.0.50; prog-fill-reindent-defun regression
In-Reply-To: <cecc72f5-adc1-a4cf-c085-d96bb82e5eb7@HIDDEN> (Dmitry Gutov's
 message of "Tue, 6 Jun 2023 04:41:55 +0300")
Organization: LINKOV.NET
References: <864jnv6pf8.fsf@HIDDEN>
 <382ab3bd-b9ed-ea18-1ae5-9458ffb1b85c@HIDDEN>
 <86r0qrtaig.fsf@HIDDEN>
 <cecc72f5-adc1-a4cf-c085-d96bb82e5eb7@HIDDEN>
Date: Tue, 06 Jun 2023 21:55:49 +0300
Message-ID: <86sfb513m2.fsf@HIDDEN>
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-Debbugs-Envelope-To: 63790
Cc: 63790 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#63790; Package emacs. Full text available.

Message received at 63790 <at> debbugs.gnu.org:


Received: (at 63790) by debbugs.gnu.org; 6 Jun 2023 01:42:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 05 21:42:05 2023
Received: from localhost ([127.0.0.1]:50610 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1q6Li0-0002Lv-Nf
	for submit <at> 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 <dmitry@HIDDEN>) id 1q6Lhy-0002LR-AL
 for 63790 <at> 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: <xms:5Y5-ZJwT-IOI8If3PxnMzYB2PqKcVauLlWqh9iR7fTXqwDJuJwxw_g>
 <xme:5Y5-ZJSdBLYchzAeuQWxwLcUdzvPZLN7CXeKZQ-u5FYxBZL8Urj9LekDMGIkluOqg
 xQqcWKp2QyNwgClVeE>
X-ME-Received: <xmr:5Y5-ZDVoWjkYh-A2FNr-o1CRcY2AKSzsWW4acfIBhuiy_4aLvZwFRcwlw8ISgsA>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgedttddggeejucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi
 thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth
 htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel
 vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug
 hmihhtrhihsehguhhtohhvrdguvghv
X-ME-Proxy: <xmx:5Y5-ZLho3fBFWE3wQY_KOJe_hTRCOtl99VZGiBJRxXVnKKTUERXj2A>
 <xmx:5Y5-ZLCqPtAiXHwdvwcU4hRT0ro14csRPj6aJ5iP8rv4CW1E70Idiw>
 <xmx:5Y5-ZEJpL3MBBKjwHhhqNj5wAww5xPhi5s_r--ggpBVX1EK-ZJqYYw>
 <xmx:5Y5-ZOp2Vq4L6XvW87YrW0ObUfOzSXgVTKNd1egDiI8XOwYUnPAD1g>
Feedback-ID: i0e71465a:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon,
 5 Jun 2023 21:41:56 -0400 (EDT)
Message-ID: <cecc72f5-adc1-a4cf-c085-d96bb82e5eb7@HIDDEN>
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
Subject: Re: bug#63790: 30.0.50; prog-fill-reindent-defun regression
Content-Language: en-US
To: Juri Linkov <juri@HIDDEN>
References: <864jnv6pf8.fsf@HIDDEN>
 <382ab3bd-b9ed-ea18-1ae5-9458ffb1b85c@HIDDEN>
 <86r0qrtaig.fsf@HIDDEN>
From: Dmitry Gutov <dmitry@HIDDEN>
In-Reply-To: <86r0qrtaig.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -1.8 (-)
X-Debbugs-Envelope-To: 63790
Cc: 63790 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
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?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#63790; Package emacs. Full text available.

Message received at 63790 <at> debbugs.gnu.org:


Received: (at 63790) by debbugs.gnu.org; 4 Jun 2023 17:22:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jun 04 13:22:11 2023
Received: from localhost ([127.0.0.1]:47062 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1q5rQh-0008Q9-IN
	for submit <at> 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 <juri@HIDDEN>) id 1q5rQf-0008Pu-3r
 for 63790 <at> debbugs.gnu.org; Sun, 04 Jun 2023 13:22:09 -0400
X-GND-Sasl: juri@HIDDEN
X-GND-Sasl: juri@HIDDEN
Received: by mail.gandi.net (Postfix) with ESMTPSA id EB24BC0005;
 Sun,  4 Jun 2023 17:22:01 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Dmitry Gutov <dmitry@HIDDEN>
Subject: Re: bug#63790: 30.0.50; prog-fill-reindent-defun regression
In-Reply-To: <382ab3bd-b9ed-ea18-1ae5-9458ffb1b85c@HIDDEN> (Dmitry Gutov's
 message of "Sat, 3 Jun 2023 05:40:47 +0300")
Organization: LINKOV.NET
References: <864jnv6pf8.fsf@HIDDEN>
 <382ab3bd-b9ed-ea18-1ae5-9458ffb1b85c@HIDDEN>
Date: Sun, 04 Jun 2023 20:14:47 +0300
Message-ID: <86r0qrtaig.fsf@HIDDEN>
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-Debbugs-Envelope-To: 63790
Cc: 63790 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
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'?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#63790; Package emacs. Full text available.

Message received at 63790 <at> debbugs.gnu.org:


Received: (at 63790) by debbugs.gnu.org; 3 Jun 2023 02:41:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jun 02 22:41:02 2023
Received: from localhost ([127.0.0.1]:41136 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1q5HCQ-0008Ed-2I
	for submit <at> 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 <dmitry@HIDDEN>) id 1q5HCM-0008E8-Qp
 for 63790 <at> 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: <xms:Mqh6ZDr9TcshFNQZ0noEYVA_xa0SAgCAnkq3DCrZJPM03Y3y6jvbCQ>
 <xme:Mqh6ZNoJJaend_xAPcdfwIpW9aoGjV-zZ4QZK6YLzwES-JxYqdnBd3dMFIfWuVwKk
 OHhyEbrSwKtIKtmhSE>
X-ME-Received: <xmr:Mqh6ZANm94mr3BBD1MGh1Bq9Qdc4O7pNZStbqX6Ed0Rj-sdcJiDsscjlKTPgjc0>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeelgedgiedvucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhepkfffgggfuffvfhfhjggtgfesthejredttdefjeenucfhrhhomhepffhmihht
 rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth
 gvrhhnpeeghedthedujeeiteeutddtjeekheejteeukeehffdutdejuedvfeevueeviedu
 udenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumh
 hithhrhiesghhuthhovhdruggvvh
X-ME-Proxy: <xmx:Mqh6ZG6NpO1p5ZojeEYJHktI-yBFm8IkY9H8BtqF1ol-3iR1v2h3uw>
 <xmx:Mqh6ZC7QzAcx1T-r-VgoOuOsUxfm-F6b_WId9e2HZJtxQEAPXJm-fA>
 <xmx:Mqh6ZOiTjKRfzWgrbepEiYw8IgJ8diPP0gfK25x55d0iI_1BMo2g6A>
 <xmx:Mqh6ZHgg_DQVOyQi31iImVvvp2JR31vHKOmV5gS3-FF-qYsWHIZZtQ>
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@HIDDEN>
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
Subject: Re: bug#63790: 30.0.50; prog-fill-reindent-defun regression
Content-Language: en-US
To: Juri Linkov <juri@HIDDEN>, 63790 <at> debbugs.gnu.org
References: <864jnv6pf8.fsf@HIDDEN>
From: Dmitry Gutov <dmitry@HIDDEN>
In-Reply-To: <864jnv6pf8.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -1.9 (-)
X-Debbugs-Envelope-To: 63790
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
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?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#63790; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 29 May 2023 17:07:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon May 29 13:07:52 2023
Received: from localhost ([127.0.0.1]:59040 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1q3gLY-0001rf-9i
	for submit <at> 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 <juri@HIDDEN>) id 1q3gLR-0001rH-5M
 for submit <at> 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 <juri@HIDDEN>) id 1q3gLQ-00044R-VL
 for bug-gnu-emacs@HIDDEN; 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 <juri@HIDDEN>) id 1q3gLP-0001oU-Bp
 for bug-gnu-emacs@HIDDEN; Mon, 29 May 2023 13:07:44 -0400
X-GND-Sasl: juri@HIDDEN
Received: by mail.gandi.net (Postfix) with ESMTPSA id D9D0EC0004
 for <bug-gnu-emacs@HIDDEN>; Mon, 29 May 2023 17:07:40 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 30.0.50; prog-fill-reindent-defun regression
Organization: LINKOV.NET
Date: Mon, 29 May 2023 19:53:07 +0300
Message-ID: <864jnv6pf8.fsf@HIDDEN>
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@HIDDEN; 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-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
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.




Acknowledgement sent to Juri Linkov <juri@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#63790; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 30 Jun 2026 16:00:03 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.