GNU bug report logs - #60322
30.0.50; [PATCH]: Search for comment at bol in prog-fill-reindent-defun

Previous Next

Package: emacs;

Reported by: Theodor Thornhill <theo <at> thornhill.no>

Date: Sun, 25 Dec 2022 21:55:02 UTC

Severity: normal

Tags: patch

Merged with 60360

Fixed in version 30.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 60322 in the body.
You can then email your comments to 60322 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#60322; Package emacs. (Sun, 25 Dec 2022 21:55:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Theodor Thornhill <theo <at> thornhill.no>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 25 Dec 2022 21:55:02 GMT) Full text and rfc822 format available.

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

From: Theodor Thornhill <theo <at> thornhill.no>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; [PATCH]: Search for comment at bol in
 prog-fill-reindent-defun
Date: Sun, 25 Dec 2022 22:54:44 +0100
[Message part 1 (text/plain, inline)]
Hi!

Attached is a small adjustment to the regex used in
prog-fill-reindent-defun.  The point is that we shouldn't consider lines
where comments come after actual code as inside a comment.


Theo

[0001-Search-for-comment-at-bol-in-prog-fill-reindent-defu.patch (text/x-diff, attachment)]

Forcibly Merged 60322 60360. Request was from Juri Linkov <juri <at> linkov.net> to control <at> debbugs.gnu.org. (Wed, 28 Dec 2022 17:26:01 GMT) Full text and rfc822 format available.

bug marked as fixed in version 30.0.50, send any further explanations to 60360 <at> debbugs.gnu.org and Juri Linkov <juri <at> linkov.net> Request was from Juri Linkov <juri <at> linkov.net> to control <at> debbugs.gnu.org. (Wed, 28 Dec 2022 17:28:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#60322; Package emacs. (Thu, 29 Dec 2022 09:03:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Theodor Thornhill <theo <at> thornhill.no>, Dmitry Gutov <dgutov <at> yandex.ru>,
 Yuan Fu <casouri <at> gmail.com>
Cc: 60322 <at> debbugs.gnu.org
Subject: Re: bug#60322: 30.0.50;
 [PATCH]: Search for comment at bol in prog-fill-reindent-defun
Date: Thu, 29 Dec 2022 11:02:35 +0200
> Date: Sun, 25 Dec 2022 22:54:44 +0100
> From:  Theodor Thornhill via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> Attached is a small adjustment to the regex used in
> prog-fill-reindent-defun.  The point is that we shouldn't consider lines
> where comments come after actual code as inside a comment.

Dmitry, Yuan, any comments?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#60322; Package emacs. (Thu, 29 Dec 2022 10:49:02 GMT) Full text and rfc822 format available.

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

From: Theodor Thornhill <theo <at> thornhill.no>
To: Eli Zaretskii <eliz <at> gnu.org>, Dmitry Gutov <dgutov <at> yandex.ru>, Yuan Fu
 <casouri <at> gmail.com>
Cc: 60322 <at> debbugs.gnu.org
Subject: Re: bug#60322: 30.0.50; [PATCH]: Search for comment at bol in
 prog-fill-reindent-defun
Date: Thu, 29 Dec 2022 11:48:10 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

>> Date: Sun, 25 Dec 2022 22:54:44 +0100
>> From:  Theodor Thornhill via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
>> 
>> Attached is a small adjustment to the regex used in
>> prog-fill-reindent-defun.  The point is that we shouldn't consider lines
>> where comments come after actual code as inside a comment.
>
> Dmitry, Yuan, any comments?

This is adressed in f9a22cf78d1a7f6472b09c3046c6a7f6984bc2d2, so This
can be closed :-)

Theo




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#60322; Package emacs. (Thu, 29 Dec 2022 11:13:02 GMT) Full text and rfc822 format available.

Message #18 received at 60322-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Theodor Thornhill <theo <at> thornhill.no>
Cc: casouri <at> gmail.com, 60322-done <at> debbugs.gnu.org, dgutov <at> yandex.ru
Subject: Re: bug#60322: 30.0.50; [PATCH]: Search for comment at bol in
 prog-fill-reindent-defun
Date: Thu, 29 Dec 2022 13:12:26 +0200
> From: Theodor Thornhill <theo <at> thornhill.no>
> Cc: 60322 <at> debbugs.gnu.org
> Date: Thu, 29 Dec 2022 11:48:10 +0100
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> Date: Sun, 25 Dec 2022 22:54:44 +0100
> >> From:  Theodor Thornhill via "Bug reports for GNU Emacs,
> >>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> >> 
> >> Attached is a small adjustment to the regex used in
> >> prog-fill-reindent-defun.  The point is that we shouldn't consider lines
> >> where comments come after actual code as inside a comment.
> >
> > Dmitry, Yuan, any comments?
> 
> This is adressed in f9a22cf78d1a7f6472b09c3046c6a7f6984bc2d2, so This
> can be closed :-)

Thanks, done.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#60322; Package emacs. (Thu, 29 Dec 2022 16:05:01 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Theodor Thornhill <theo <at> thornhill.no>, 60322 <at> debbugs.gnu.org
Subject: Re: bug#60322: 30.0.50; [PATCH]: Search for comment at bol in
 prog-fill-reindent-defun
Date: Thu, 29 Dec 2022 18:04:18 +0200
On 25/12/2022 23:54, Theodor Thornhill via Bug reports for GNU Emacs, 
the Swiss army knife of text editors wrote:
> Attached is a small adjustment to the regex used in
> prog-fill-reindent-defun.  The point is that we shouldn't consider lines
> where comments come after actual code as inside a comment.

How about we allow indentation?

And allow to be called not from BOL too?

(re-search-forward "\\s-*\\s<" (line-end-position) t)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#60322; Package emacs. (Thu, 29 Dec 2022 19:24:02 GMT) Full text and rfc822 format available.

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

From: Theodor Thornhill <theo <at> thornhill.no>
To: Dmitry Gutov <dgutov <at> yandex.ru>, 60322 <at> debbugs.gnu.org
Subject: Re: bug#60322: 30.0.50; [PATCH]: Search for comment at bol in
 prog-fill-reindent-defun
Date: Thu, 29 Dec 2022 20:23:08 +0100
[Message part 1 (text/plain, inline)]
Dmitry Gutov <dgutov <at> yandex.ru> writes:

> On 25/12/2022 23:54, Theodor Thornhill via Bug reports for GNU Emacs, 
> the Swiss army knife of text editors wrote:
>> Attached is a small adjustment to the regex used in
>> prog-fill-reindent-defun.  The point is that we shouldn't consider lines
>> where comments come after actual code as inside a comment.
>
> How about we allow indentation?
>
> And allow to be called not from BOL too?
>
> (re-search-forward "\\s-*\\s<" (line-end-position) t)

Sure!

Will you install it for me?

Theo

[0001-Allow-for-indentation-in-prog-fill-reindent-defun.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#60322; Package emacs. (Thu, 29 Dec 2022 19:27:02 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Theodor Thornhill <theo <at> thornhill.no>, 60322 <at> debbugs.gnu.org
Subject: Re: bug#60322: 30.0.50; [PATCH]: Search for comment at bol in
 prog-fill-reindent-defun
Date: Thu, 29 Dec 2022 21:25:58 +0200
On 29/12/2022 21:23, Theodor Thornhill wrote:
> Dmitry Gutov <dgutov <at> yandex.ru> writes:
> 
>> On 25/12/2022 23:54, Theodor Thornhill via Bug reports for GNU Emacs,
>> the Swiss army knife of text editors wrote:
>>> Attached is a small adjustment to the regex used in
>>> prog-fill-reindent-defun.  The point is that we shouldn't consider lines
>>> where comments come after actual code as inside a comment.
>>
>> How about we allow indentation?
>>
>> And allow to be called not from BOL too?
>>
>> (re-search-forward "\\s-*\\s<" (line-end-position) t)
> 
> Sure!
> 
> Will you install it for me?

Sure, done.

I've also refilled the commit message a little.





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 27 Jan 2023 12:24:07 GMT) Full text and rfc822 format available.

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

Previous Next


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