GNU bug report logs - #77823
31.0.50; M-j regression since commit 4c6b1712a4d

Previous Next

Package: emacs;

Reported by: Sean Whitton <spwhitton <at> spwhitton.name>

Date: Tue, 15 Apr 2025 11:29:02 UTC

Severity: normal

Found in version 31.0.50

Done: Sean Whitton <spwhitton <at> spwhitton.name>

Bug is archived. No further changes may be made.

Full log


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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Sean Whitton <spwhitton <at> spwhitton.name>
Cc: eliz <at> gnu.org, 77823 <at> debbugs.gnu.org,
 Elijah Gabe Pérez
 <eg642616 <at> gmail.com>
Subject: Re: bug#77823: 31.0.50; M-j regression since commit 4c6b1712a4d
Date: Wed, 16 Apr 2025 20:35:41 -0400
>> I found the issue, `comment-indent' was using both block-comment
>> variables first than `comment-start' and `comment-end', this must fix it.
>>
>> diff --git a/lisp/newcomment.el b/lisp/newcomment.el
>> index eb36f91104d..3e20da816b9 100644
>> --- a/lisp/newcomment.el
>> +++ b/lisp/newcomment.el
>> @@ -722,9 +722,9 @@ comment-indent
>>    (let* ((empty (save-excursion (beginning-of-line)
>>  				(looking-at "[ \t]*$")))
>>  	 (starter (or (and continue comment-continue)
>> -		      (and empty block-comment-start) comment-start))
>> +		      comment-start (and empty block-comment-start)))
>>  	 (ender (or (and continue comment-continue "")
>> -		    (and empty block-comment-end) comment-end)))
>> +		    comment-end (and empty block-comment-end))))
>>      (unless starter (error "No comment syntax defined"))
>>      (beginning-of-line)
>>      (let* ((eolpos (line-end-position))
>
> Thanks!  I don't know the comment code well; Stefan, would you mind
> giving this a quick look?

My understanding is that the `newcomment.el` code (and its predecessor
which lived in `simple.el`) never really knew what
`block-comment-start/end` were for so it's used inconsistently and I'd
be surprised if there aren't more misbehaviors linked to them,

Of course, maybe the `simple.el` code did know and it's the guy who
rewrote it into `newcomment.el` who messed it all up.  🙂

In any case, the above is equivalent to just removing the `(and empty
block-comment-start/end)` because `comment-start/end` should never be
nil anyway, so it's probably worthwhile thinking about what we want to
do with `block-comment-start/end` here.
Maybe "nothing" is the right answer, of course.


        Stefan "really not a fan of `block-comment-start/end`"





This bug report was last modified 24 days ago.

Previous Next


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