Subject: bug#60034: comment character for org and python includes a space

From: Heime <[email-masked]>
Date: Wed, 14 Dec 2022 02:35:40 +0000

------- Original Message -------
On Tuesday, December 13th, 2022 at 6:36 PM, Stefan Kangas <[email-masked]> wrote:

> tags 60034 + moreinfo
> thanks
> 
> Heime via "Bug reports for GNU Emacs, the Swiss army knife of text
> editors" [email-masked] 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.  Another difficulty has been that in "c-mode", "comment-start" returns "/*" with no possibility to get the alternative "//". 

(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\\(\\[.+\\]\\).*$"))))