Subject: bug#77295: 30.1.50; (comment-beginning) returns wrong, or errors, in org-mode

From: Stefan Monnier <[email-masked]>
Date: Wed, 09 Apr 2025 15:18:48 -0400

>> >> I'm reporting this bug to Emacs rather than the Org mode mailing list
>> >> because the following code from org-setup-comments-handling is
>> >> actually enough to trigger the return value bug in a fundamental-mode
>> >> buffer (but not the wrong-type-argument error), so it seems like it
>> >> might be a bug in newcomment.el:
>> >> 
>> >>   (setq-local comment-use-syntax nil)
>> >>   (setq-local comment-start "# ")
>> >>   (setq-local comment-start-skip "^\\s-*#\\(?: \\|$\\)")
>> >
>> > Stefan, do you agree this is a problem in newcomment.el?
>> 
>> Yes.
>
> Any ideas or suggestions for how to fix that?

Haven't touched the code is too long, so no.  Can't think offhand of
a reason why it should be hard to fix, tho.

        Stefan