From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#60034: comment character for org and python includes a space Date: Sun, 10 Sep 2023 11:47:47 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33683"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60034@debbugs.gnu.org, Stefan Monnier To: Heime Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 10 20:49:08 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qfPUa-0008al-2S for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 10 Sep 2023 20:49:08 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qfPUS-0007pV-2O; Sun, 10 Sep 2023 14:49:00 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qfPUR-0007pA-5p for bug-gnu-emacs@gnu.org; Sun, 10 Sep 2023 14:48:59 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qfPUQ-0002Hq-UI for bug-gnu-emacs@gnu.org; Sun, 10 Sep 2023 14:48:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qfPUU-0000mR-Fn for bug-gnu-emacs@gnu.org; Sun, 10 Sep 2023 14:49:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Sep 2023 18:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60034 X-GNU-PR-Package: emacs Original-Received: via spool by 60034-submit@debbugs.gnu.org id=B60034.16943716822769 (code B ref 60034); Sun, 10 Sep 2023 18:49:02 +0000 Original-Received: (at 60034) by debbugs.gnu.org; 10 Sep 2023 18:48:02 +0000 Original-Received: from localhost ([127.0.0.1]:51299 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfPTV-0000iU-7F for submit@debbugs.gnu.org; Sun, 10 Sep 2023 14:48:01 -0400 Original-Received: from mail-lj1-x22d.google.com ([2a00:1450:4864:20::22d]:62841) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfPTR-0000hO-Ia for 60034@debbugs.gnu.org; Sun, 10 Sep 2023 14:47:59 -0400 Original-Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2bcda0aaf47so57950961fa.1 for <60034@debbugs.gnu.org>; Sun, 10 Sep 2023 11:47:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694371668; x=1694976468; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=jnWrN5b5LNBLLAgfaAHUzi36iXtCMWVDDFh+6lqgb7E=; b=cLdLTNpmhT/TNiAaF2v2s1pE3hp3OepYdcpx5GAxYCONZgqM+J1qiR0NphhfltACSO dT11931Yo0RnxCFKTAQQkTOOj0OiSgW+08dDP5dN9xamVbxbw947IqcXjo4KqLzFRKtB FK0MqALNiGZHNPHCYYvMx1K1Q4GJf3t4MYRp86v3bIx5C3HQEzGVNhNOPUQXrmkmGyL/ tce1hIfpyktWE/Jda7Wt3ds045MaP7bNG4eUy/Prwv6oYkw7xr/LA1B0ZwthdRsI4ozj ylK/LP5P161qt2X0E1tNTAIP09DNhBclsXdmcvRWYujMUSkRTeAvbogb0KndMbDFaoa0 H8jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694371668; x=1694976468; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jnWrN5b5LNBLLAgfaAHUzi36iXtCMWVDDFh+6lqgb7E=; b=WjQ0DwX8Nm24Db1h9jIjCsqCh26eEZx9LEDyd3yftO7VRFY1jrjA6wvTG9VS9F+Wuj 2sO4SJ8v/RARyJ75DsR6rF3ID1FS5gtUI8cn2FKNyS2kfubKErKAYICxHyUuGZqErcFu cUik5BbBm5r0dMofAC5YNUwoMlc3YHqCp2hYdXfVEvc5LWdTXiCVXqJBYX3o3ieo3mlH LfJ8ETx0sGhn0tXxN9ou04HMdJfuOr2e+8L5GEJVRxFjXmLeGPVpnoKwDcNFxIIZznS9 NLlKCcrZklY7G6VsRA4G7roYn6QUp7sI7TWeNlwN9H3nUgWsQXtHeIWnlPaTNyHwav9N WRTA== X-Gm-Message-State: AOJu0YzNrH0+mwIRdJKjhZp3X4QjkXY6Tgblpmq4l+e3cIJKT5bms+PP SLThF0I8qMxv8HiVq9606my666iJDt34fYfGskm9uAJ7 X-Google-Smtp-Source: AGHT+IHJvxkHidUiZ663fwEr/mjZOM6vC4No5pnDKQcmE4hUOWRBlEffayoTuxkrt5j/B+Q1w2ITg0B9e+cXTuGQYUw= X-Received: by 2002:a2e:b992:0:b0:2bf:7e69:9846 with SMTP id p18-20020a2eb992000000b002bf7e699846mr1073109ljp.9.1694371667763; Sun, 10 Sep 2023 11:47:47 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 10 Sep 2023 11:47:47 -0700 In-Reply-To: (Heime's message of "Wed, 14 Dec 2022 02:35:40 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:269995 Archived-At: Heime writes: >> Heime via "Bug reports for GNU Emacs, the Swiss army knife of text >> editors" bug-gnu-emacs@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\\(\\[.+\\]\\).*$"))))