GNU bug report logs - #78003
31.0.50; comment-indent misbehaves in multiline comments

Previous Next

Package: emacs;

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

Date: Wed, 23 Apr 2025 03:19:01 UTC

Severity: normal

Found in version 31.0.50

Fixed in version 31.1

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

Bug is archived. No further changes may be made.

Full log


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

From: Sean Whitton <spwhitton <at> spwhitton.name>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 78003-done <at> debbugs.gnu.org
Subject: Re: bug#78003: 31.0.50; comment-indent misbehaves in multiline
 comments
Date: Fri, 25 Apr 2025 09:15:23 +0800
Version: 31.1

Hello,

On Thu 24 Apr 2025 at 02:58pm -04, Stefan Monnier wrote:

>> We could fix this within comment-dwim.
>
> I don't think we could because `comment-indent` is also a command.
> Maybe we could make `comment-dwim` do something more useful than calling
> `comment-indent` in that case, but that's "another problem".

Right.

> AFAICT we don't need to check (< (nth 8 st) (point)).
> Am I missing something?

I think you are correct that it does not need to be checked because this
call to `<' could only return nil in the case that
comment-search-forward returned non-nil, in which case we would not be
calling syntax-ppss at all.

> Also, I think the bug will still bite when
> `comment-insert-comment-function` is set.

Yes, I was thinking that handling it in that case is going to have to be
the responsibility of whatever function is set.  But it ought to know
what's going on better than comment-indent does.

> BTW, the patch looks simple in terms of the diff, but it makes the
> control flow (which is already not great) even more complicated.
>
> How 'bout the one below?

Thanks for reviewing, and for reworking it.  Installed the change.

There are other bugs nearby that I hope to fix soon but nothing
actionable remaining here, so closing the bug.

-- 
Sean Whitton




This bug report was last modified 27 days ago.

Previous Next


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