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

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Mon, 29 May 2023 17:08:02 UTC

Severity: normal

Found in version 30.0.50

Full log


Message #20 received at 63790 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Juri Linkov <juri <at> linkov.net>
Cc: 63790 <at> debbugs.gnu.org
Subject: Re: bug#63790: 30.0.50; prog-fill-reindent-defun regression
Date: Thu, 8 Jun 2023 03:35:41 +0300
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?




This bug report was last modified 2 years and 10 days ago.

Previous Next


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