From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#63790: 30.0.50; prog-fill-reindent-defun regression Date: Thu, 8 Jun 2023 03:35:41 +0300 Message-ID: <476b767a-2126-50c3-6aa9-6877982ed509@gutov.dev> References: <864jnv6pf8.fsf@mail.linkov.net> <382ab3bd-b9ed-ea18-1ae5-9458ffb1b85c@gutov.dev> <86r0qrtaig.fsf@mail.linkov.net> <86sfb513m2.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1095"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Cc: 63790@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 08 02:36:28 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 1q73dc-000AeT-3Q for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 08 Jun 2023 02:36:28 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q73dG-0005I2-0D; Wed, 07 Jun 2023 20:36:06 -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 1q73dD-0005He-9s for bug-gnu-emacs@gnu.org; Wed, 07 Jun 2023 20:36:03 -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 1q73dC-000887-Rs for bug-gnu-emacs@gnu.org; Wed, 07 Jun 2023 20:36:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q73dC-0005EV-83 for bug-gnu-emacs@gnu.org; Wed, 07 Jun 2023 20:36:02 -0400 X-Loop: help-debbugs@gnu.org 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 Original-Received: via spool by 63790-submit@debbugs.gnu.org id=B63790.168618455420098 (code B ref 63790); Thu, 08 Jun 2023 00:36:02 +0000 Original-Received: (at 63790) by debbugs.gnu.org; 8 Jun 2023 00:35:54 +0000 Original-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 Original-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 Original-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) Original-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 Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 7 Jun 2023 20:35:43 -0400 (EDT) Content-Language: en-US In-Reply-To: <86sfb513m2.fsf@mail.linkov.net> 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:263093 Archived-At: 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?