[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#63790: 30.0.50; prog-fill-reindent-defun regression
From: |
Juri Linkov |
Subject: |
bug#63790: 30.0.50; prog-fill-reindent-defun regression |
Date: |
Tue, 06 Jun 2023 21:55:49 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) |
>>>> 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.