From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ergus via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#71070: 30.0.50; c++-ts-mode namespace wrong fontification. Date: Sun, 19 May 2024 23:36:41 +0200 Message-ID: References: <87h6et6550.fsf.ref@aol.com> <87h6et6550.fsf@aol.com> <86wmnpabu0.fsf@gnu.org> <86v839aa3a.fsf@gnu.org> Reply-To: Ergus Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22202"; mail-complaints-to="usenet@ciao.gmane.io" Cc: casouri@gmail.com, 71070@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 19 23:37:24 2024 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 1s8oDb-0005VH-Mm for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 19 May 2024 23:37:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s8oDE-0005nd-Mm; Sun, 19 May 2024 17:37: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 1s8oDC-0005nN-LN for bug-gnu-emacs@gnu.org; Sun, 19 May 2024 17:36:58 -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 1s8oDC-0004pi-Ce for bug-gnu-emacs@gnu.org; Sun, 19 May 2024 17:36:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s8oDG-00071w-9m for bug-gnu-emacs@gnu.org; Sun, 19 May 2024 17:37:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ergus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 19 May 2024 21:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71070 X-GNU-PR-Package: emacs Original-Received: via spool by 71070-submit@debbugs.gnu.org id=B71070.171615461827014 (code B ref 71070); Sun, 19 May 2024 21:37:02 +0000 Original-Received: (at 71070) by debbugs.gnu.org; 19 May 2024 21:36:58 +0000 Original-Received: from localhost ([127.0.0.1]:38164 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s8oDC-00071e-EB for submit@debbugs.gnu.org; Sun, 19 May 2024 17:36:58 -0400 Original-Received: from sonic317-27.consmr.mail.bf2.yahoo.com ([74.6.129.82]:43510) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s8oDB-00071U-B3 for 71070@debbugs.gnu.org; Sun, 19 May 2024 17:36:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1716154607; bh=m97GL8SPtCOD+MnFVvKP2dIQ8D6kO1rwRI5Lmuzzrqg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject:Reply-To; b=sRvwVMUdxnZKU4VrmNQq657fNqVJa4jTWL0GJq0FOpjX+h0yOis6pNn7iOlZraRJWnoPDRT7fiik1/C8qKe58AAMYnqb+v0IR1dR3Q53ubW/eavkgL72d/rCYb+6Gwj5k2Ozr0J26R8ooj2W2R78287D6j0ethXtZrvZqi/p9Wv9K8rMbfPHq10YAyrDFOgYr7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qcihreaRumtGCve3QuNtnq7DPMaHfXV 10pOpg2iRJGj5RfHAu5ezTgqQjcNkYMd8XuqeZW5g8bTuV31O4CvyI5AutY.8Vssv69YFA.xatS5 n0gOIu2B4tHqMQTV1T5JAfCK372zcbYOaMvHwV5pw9cSw_MMZBhnoM3fHVz80vYKTp3Spqql6t7D wIXjmZjumNdm3P_sfayqYvsyuSd5kYT.CWWF9RurGOw6x_Cm0cA9Hz1xVEISZ3YqOfObTDNWTG1H CXr2_kSMU24NB4IjN3Hv0RQO9fdkSVpmCg1T9WDCqeUZ0in9fxpKiDggKKTu_LJXia2ZtEwia7nU hR1i0OghXaJyK7lKggiQQ0DzZBT4bAQbR8DtzGR_qXuBc..OumQj4ITk9YlYJZawAwCkiGzuoPVo FsjT68jf_GfpnQsA3v0lZd7y.kjuqD39YfQSiBJq6A X-Sonic-MF: X-Sonic-ID: ee1f30a1-1af8-4ea1-b4c1-301272aa100b Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic317.consmr.mail.bf2.yahoo.com with HTTP; Sun, 19 May 2024 21:36:47 +0000 Original-Received: by hermes--production-ir2-7b99fc9bb6-6hqsm (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 6b76da5b4acd84170fb945a69bb47b06; Sun, 19 May 2024 21:36:43 +0000 (UTC) Content-Disposition: inline In-Reply-To: <86v839aa3a.fsf@gnu.org> X-Mailer: WebService/1.1.22356 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol 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:285450 Archived-At: On Sun, May 19, 2024 at 10:13:45PM GMT, Eli Zaretskii wrote: >> Date: Sun, 19 May 2024 21:00:42 +0200 >> From: Ergus >> Cc: Yuan Fu , 71070@debbugs.gnu.org >> >> >Why do you think std should be in font-lock-constant-face? The name >> >of a namespace is not a constant, it's an identifier. >> >> Hi Eli: >> >> That's how namespaces are fontified in the c++-mode. Not telling it is >> correct, wrong or if needs improvement; just that c++-ts-mode is not >> doing in the same way. >> >> Try this: >> >> ```main.cpp >> >> const std::string a; >> >> class myclass { >> std::time::timespec var; >> }; >> >> int main() >> { >> std::string b = 1; >> >> >> } >> ``` >> >> and then M-x c++-ts-mode you will see the difference. > >No one said that what c++-mode does is necessarily correct. maybe it >is, maybe it isn't. > >How do other C++ IDEs fontify namespace names? Hi Eli: Every editor-ide has its own approach for this. But emacs has it own flavor and the ts-* intention was to keep it as close as possible to the status-quo; that's why I am reporting it here. There are many details missing in the c/c++-ts-mode compared to c-mode... but I understand that some of them are WIP while others are just too complex to port. My main concern here is that this seemed like a simple issue considering that treesitter recognizes the namespace correctly. But the Yuan's fix didn't work; so maybe there is a detail we are missing here, or that needs extra documentation? Or in the worst case some detail/issue broken in the ts api? Best, Ergus