Subject: Re: bug#77823: 31.0.50; M-j regression since commit 4c6b1712a4d

From: Elijah Gabe Pérez <[email-masked]>
Date: Tue, 15 Apr 2025 18:55:50 -0600

Sean Whitton <[email-masked]> writes:

> reopen 77823
> thanks
>
> Hello,
>
> On Tue 15 Apr 2025 at 04:15pm +03, Eli Zaretskii wrote:
>
>> This has been fixed by a followup changeset that Elijah sent.
>>
>> So I'm closing this bug.
>
> It's still present, just replace 'M-x emacs-lisp-mode' with
> 'M-x lisp-mode' in my recipe.  M-j for editing Common Lisp is broken.
>
> Possibly Elijah's original commit has just uncovered an existing
> problem, but either way it's a bug.
>
> Elijah, can you take a look at the lisp-mode issue, please?

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))

-- 
                                          - E.G via GNU Emacs and Org.