From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#63790: 30.0.50; prog-fill-reindent-defun regression Date: Sun, 04 Jun 2023 20:14:47 +0300 Organization: LINKOV.NET Message-ID: <86r0qrtaig.fsf@mail.linkov.net> References: <864jnv6pf8.fsf@mail.linkov.net> <382ab3bd-b9ed-ea18-1ae5-9458ffb1b85c@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35270"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: 63790@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 04 19:23:26 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q5rRu-00094d-9e for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 04 Jun 2023 19:23:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q5rRY-0002Qw-6q; Sun, 04 Jun 2023 13:23:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q5rRW-0002QZ-Ne for bug-gnu-emacs@gnu.org; Sun, 04 Jun 2023 13:23:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q5rRW-0004i9-Es for bug-gnu-emacs@gnu.org; Sun, 04 Jun 2023 13:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q5rRW-0008RY-8T for bug-gnu-emacs@gnu.org; Sun, 04 Jun 2023 13:23:02 -0400 X-Loop: help-debbugs@gnu.org 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 Original-Received: via spool by 63790-submit@debbugs.gnu.org id=B63790.168589933232377 (code B ref 63790); Sun, 04 Jun 2023 17:23:02 +0000 Original-Received: (at 63790) by debbugs.gnu.org; 4 Jun 2023 17:22:12 +0000 Original-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 Original-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 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id EB24BC0005; Sun, 4 Jun 2023 17:22:01 +0000 (UTC) In-Reply-To: <382ab3bd-b9ed-ea18-1ae5-9458ffb1b85c@gutov.dev> (Dmitry Gutov's message of "Sat, 3 Jun 2023 05:40:47 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:262981 Archived-At: >> 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'?