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


View this message in rfc822 format

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




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.