GNU bug report logs - #60034
comment character for org and python includes a space

Previous Next

Package: emacs;

Reported by: Heime <heimeborgia <at> protonmail.com>

Date: Tue, 13 Dec 2022 15:29:02 UTC

Severity: normal

Tags: notabug, wontfix

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


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

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Heime <heimeborgia <at> protonmail.com>
Cc: 60034 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> gnu.org>
Subject: Re: bug#60034: comment character for org and python includes a space
Date: Sun, 10 Sep 2023 11:47:47 -0700
Heime <heimeborgia <at> protonmail.com> writes:

>> Heime via "Bug reports for GNU Emacs, the Swiss army knife of text
>> editors" bug-gnu-emacs <at> gnu.org writes:
>>
>> > How is it that the comment character for org and python include a
>> > space "# ", when for all other languages it is only a single
>> > character?
>>
>> Could you explain which variable(s) you are looking at?
>>
>> Are you reporting a bug in the behavior of python-mode and org-mode?
>> If so, what is it?
>
> It is about "comment-start".  I am constructing a "regexp" for use
> with hi-lock mode to highlight certain comments.
>
> For elisp I am matching ";; [Text] More"
>
> The regex is adapted for the particular programming mode.

It seems like we do it both ways in our sources, so I'm not sure if it
matters, or what is the correct way.  It's not documented in the
`comment-start' docstring either.

Perhaps it's better to just leave it out unless it is a part of the
language grammar, but I don't know if it would have any adverse effects.

Stefan, what do you think?

> Another difficulty has been that in "c-mode", "comment-start" returns
> "/*" with no possibility to get the alternative "//".

Please report this as a separate bug report, and include the use case
you're looking at with all the details.

> (defun tegor ()
>   "TODO."  (interactive)
>   (let ( (fm (format "%s%s" comment-start comment-start)) )
>     (message "fm: %s" fm) (message "kmcategor: %s"
>        (format "%s%s%s" "^\s*" fm "\s\\(\\[.+\\]\\).*$"))))




This bug report was last modified 1 year and 252 days ago.

Previous Next


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