From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ergus Newsgroups: gmane.emacs.devel Subject: Re: A few questions about c++-ts-mode. Date: Wed, 08 May 2024 23:05:10 +0200 Message-ID: References: <865xvoa0jr.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15207"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org, Eli Zaretskii , Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed May 08 23:06:32 2024 Return-path: Envelope-to: ged-emacs-devel@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 1s4oUi-0003pI-5Z for ged-emacs-devel@m.gmane-mx.org; Wed, 08 May 2024 23:06:32 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s4oTp-0008UA-CI; Wed, 08 May 2024 17:05:37 -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 1s4oTh-0008Sd-Sw for emacs-devel@gnu.org; Wed, 08 May 2024 17:05:32 -0400 Original-Received: from sonic317-27.consmr.mail.bf2.yahoo.com ([74.6.129.82]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s4oTf-0001bF-Sk for emacs-devel@gnu.org; Wed, 08 May 2024 17:05:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1715202324; bh=639QY5M6jcebTKJuA8zD+34S+PXftKATZHJyTRxU2Lo=; h=Date:From:To:Subject:In-Reply-To:References:From:Subject:Reply-To; b=KK3iPaMd2++bfm+Qp8okh6S8qnkrnri6O497CNVHMLXQ5JqfwyTM1AlcDtrZrm3Xv6gZDmMeMXDmvEH2pfEb8q57QJEZSiQ30l985F2x/ZQ+BBSkEej+VRBEqZ71+AR0JYQjz9bNsoV+f6BuI+IHO0Au3fmMuU8OfAPdFhmaVqtdjmtZSNHsbuCkoFEyFkcGzCC9zViRAGpI6h1vtev4eQW+7FNIwYdyGYi6ZBhFY77+AT3NJsu676gldg3l0VuJLNg9kzRRkCMOsVIioGpV+BLIpFmQv5JEfapnArA82yIu+8+rLVXMKm4A++9egq0qZpkl7pPiM6icXzWZ/7QDgg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1715202324; bh=BFc3GD0bs8Y8vZ8zZ6PTc8ygxi1D/UANvVCc96gpV0Q=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=aY8CGlfaRfR8A1SFHpZNnh7ZbB5vMQ27f2U8z3TH+DbmvRVftHK2bC4xMwaoHHGGCZBdyiNPtkT2aUDXYLoHFV1CMjBzwx17QoQSz7ysu8nMXYbRUboR8dnk672JMIBbeyfUVw3Jf6dsFl05OwSwFP+ZndOCwz38FwkP1vT9Ei6KffvzmksPgVVFqS2F1xImuvk2Z8NqXuPsyF/HgbzFqJ1JWXpY9VbZ0o/N9DaFx12uKZtywM+CaQR+ntSn224a8yOKR+JemSkWEjOb5VvBXVrmD0YbBZb9/wXx64G9vplv472PKHDa3ZbEh3qIrQ5lemamJPmFPVu0168UcWmGrA== X-YMail-OSG: WD5Qgu0VM1kZp0byo6N06AeYLftwl2MPJlYtf6Vz4YEnWViePdVbeCauK7QVfIY SydgT2o6ULzCdwgGsevDb.SpLoM3lrmufyJFq_SApTcvcVRFm9Z5agV0ok._8SHJwM.nza2IV3oT GtW4MwhAqKOMKFd8V_CIgQysiBmATciO8Mclxh4hKGzLc_Ok65FD4GrzOIWnmfZCDlgWE09jU1Qo TduMiZktPpIaQ_QpouBr8HORS0NZnGRPfDaRiJyed9yjRhL8DVPRTrGjmyiSJvvsB1P8lDMKbKZt QV9BzmgpF5ydkmNm7uZ.H7npeLvwl2DEImvDWpDsL2NMDLU.js2Vcxx0lwrpz_jm7ZbuFlpFK1Rs sizzp_htZ2TXtbNsH5sT15JcVAbIJsN9xS6PIw9pye4dKYcsEHE_YTXCoR_2tRfpKp050cYdtbUP D9JomARBFlqt1oMdmByToVon4JW7dJTgNbDi4h8iXltKG3RJvDVK0vYcNKnMqKn2FxZTcsxcGreo LPwKvLX2yBo3rki_12pfOUsXLhuzI.1T5pGmQVRUNrIFhQ8xtnvRVUisnC9c5DIkkzx6yMHpJFKL qGLTFNzOsGYTK0lagTEThWFcUC1jQEhP9SRXe30cvoKOfSvJDp6ARvrqHiuoGjppH..WKu_ih4_s Fie7zHiwmRrw2cQ1csyP1Qav6oGNy36Ze8Vm0rfQCm0e.qGH4iU50Qe2HVJtiplM76D0fcRdQ5aE 3NCCHdUYfsKnIW9SM9cnF5c2Wyj47zlAYUFkT09VHj0DcliJAto1XvbCv4hxS5XNi_H4AUEmrRT9 cpadzO.mElPo3XCoEN3TCdbQ7C_FfTk4e1AuxIb8_Q X-Sonic-MF: X-Sonic-ID: de7e75d6-62d2-4be8-84a7-036c2eb0605b Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic317.consmr.mail.bf2.yahoo.com with HTTP; Wed, 8 May 2024 21:05:24 +0000 Original-Received: by hermes--production-ir2-7b99fc9bb6-mz6k9 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID c06aa45395bf6e852412411b3c87dcdb; Wed, 08 May 2024 21:05:19 +0000 (UTC) In-Reply-To: <865xvoa0jr.fsf@gnu.org> X-Mailer: WebService/1.1.22321 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol Received-SPF: pass client-ip=74.6.129.82; envelope-from=spacibba@aol.com; helo=sonic317-27.consmr.mail.bf2.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:319025 Archived-At: Hi Eli and Yuan On May 8, 2024 3:35:52 PM GMT+02:00, Eli Zaretskii wrote: >> From: Yuan Fu >> Date: Tue, 7 May 2024 17:19:53 -0700 >> Cc: emacs-devel@gnu=2Eorg >>=20 >> > 1=2E namespaces are not fontified like in c-mode (i=2Ee in std::strin= g the >> > `std` used to have font-lock-constant-face while `string` used to ha= ve >> > font-lock-type-face)=2E It seems like tresitter identifies properly = them >> > like (namespace_identifier) and (type_identifier) >>=20 >> Then we probably want to fontify namespaces in constant face=2E Or perh= aps add a namespace-face that inherits from constant face=2E > >I think using font-lock-constant-face is fine=2E Patches welcome=2E > >> > 2=2E Doc string comments are fontified like normal comments=2E It loo= ks like >> > treesiter does not recognize them at all=2E Is this something we nee= d to >> > report to treesitter or we need to workaround it in emacs side? >>=20 >> I=E2=80=99m working on that=2E I think the best way is to workaround it= in Emacs=2E > >Please note that some of those specially-formatted comments are >explicitly supported by the grammar=2E > It looks like tree sitter already supports this using language injection: I am not sure if we can handle this same way in emacs=2E Or if it is a bet= ter or worst approach than using a made in home workaround=2E >> > 3=2E macros like `#if defined(something)` fontifies the whole macro w= ith >> > same font (the `identifier` used to have no colors in c++-mode) >>=20 >> We should update the fontification to leave out the identifier=2E > >We seem to have the technology already, but we are overwriting it? >Observe: > > (preproc_defined) @font-lock-preprocessor-face > (preproc_defined (identifier) @font-lock-variable-name-face) > [,@c-ts-mode--preproc-keywords] @font-lock-preprocessor-face) > --=20 Sent from my Android device with K-9 Mail=2E Please excuse my brevity=2E