From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: Re: A few questions about c++-ts-mode. Date: Wed, 8 May 2024 17:16:11 -0700 Message-ID: References: <865xvoa0jr.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6.1.1\)) 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="33774"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "Ergus via Emacs development discussions." , Eli Zaretskii To: Ergus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu May 09 02:17:14 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 1s4rTG-0008je-09 for ged-emacs-devel@m.gmane-mx.org; Thu, 09 May 2024 02:17:14 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s4rSZ-00056g-RW; Wed, 08 May 2024 20:16:31 -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 1s4rSV-00055a-1a for emacs-devel@gnu.org; Wed, 08 May 2024 20:16:27 -0400 Original-Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s4rST-0000yn-8p; Wed, 08 May 2024 20:16:26 -0400 Original-Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1eeb1a4c10aso1647865ad.3; Wed, 08 May 2024 17:16:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715213783; x=1715818583; darn=gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=aMo6rM1C1BKs3oWxKFqvoVUx4Wy9VjaS8gtHy3NZr64=; b=j2EK2K+iZRjFBmecut0Tq43kYQUF1TlBn6+AOq1XsqQAl3ZkpQE6evR8dgFhXHjd4o jcxIL5tcGHjkO5z5nyJfy5AnwXxECtkNp+y+C1ObXAgXDZQOY7a0RK7Tav85XpxelA9a 897VTsNSWoyi0WPNryjLNbDgaK7ftzih6YqRdarZVCXKtgd+7RKlboiitMUBS5nYFopc U6P66O8yTI+ZRIQhkNdxjvIvz86NZmdEZMvHWiyG+wocbB61u9fR2/9aGRFaP0m4GzC/ s5z++qDIlnA6VohkE4o20uC9Y+EMAJveUR+WyICsr+Boew0NHXZWpb9hiYFRayubafop 2Ohg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715213783; x=1715818583; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aMo6rM1C1BKs3oWxKFqvoVUx4Wy9VjaS8gtHy3NZr64=; b=RbzDTt4MJ1svW58CS9Jw3hYRsRZh1X0cCHneiD4TXuMfelX+kyIZ7SrOmzIy7mEDp0 PbClQLVTTaUQVDvJMboiCta0UChuMyq+d4S1G39ByllmR8RoUUSDJ/PW0yrOtKU5/nlB Z/FZOUmGMSehEztujea83Qf4KnABtw1QvkgyqdTDQer+mHuz1vhyZrMYs6TM+BxqtrSA q9Q2+BqKvLm4WXqqNhFm4oEW5BW9vLgb8dD2avb5dsorDD7eIHN7Qy+ZhLD0gVOFs88d sKZ9rDDTblLYjJZJr52UA7vrJOYSOLmZGhysawSLyRc2uvlogWQSm1YhgOxih0qLvxgJ KxuQ== X-Forwarded-Encrypted: i=1; AJvYcCWHVoZnaw8AdI1liddYD666yENV+qhGm/fmGQrW6aLGP5yK31mOsAdcZ/3C4U9rf9Ly/9HObbN9GRrNHn4= X-Gm-Message-State: AOJu0YyP/Vv/UbBT5P5IBbFnJ7xi/LPjJrL/n9ySCrfEKq/lSvks/qlI plwjkw/rRvaniPJ+uS0c9yUlmFr4+XdmnsQXDkOP6Luw7lC3JWL0 X-Google-Smtp-Source: AGHT+IH9yd8UqbwWiAoa9j/Uax64kCqpb0M1v5/Q4R2HkUkppXjis7pAfvnfuQoKgPLF8OuYb9foOw== X-Received: by 2002:a17:902:e5cb:b0:1e4:48a6:968b with SMTP id d9443c01a7336-1eeb0195107mr44124705ad.13.1715213783128; Wed, 08 May 2024 17:16:23 -0700 (PDT) Original-Received: from smtpclient.apple ([2601:641:300:4910:38af:f15:5ce3:fab2]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1ef0b9d4278sm1371095ad.12.2024.05.08.17.16.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 May 2024 17:16:22 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.3731.700.6.1.1) Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=casouri@gmail.com; helo=mail-pl1-x62b.google.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, 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:319028 Archived-At: > On May 8, 2024, at 2:05 PM, Ergus wrote: >=20 > Hi Eli and Yuan >=20 > 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.org >>>=20 >>>> 1. namespaces are not fontified like in c-mode (i.e in std::string = the >>>> `std` used to have font-lock-constant-face while `string` used to = have >>>> font-lock-type-face). It seems like tresitter identifies properly = them >>>> like (namespace_identifier) and (type_identifier) >>>=20 >>> Then we probably want to fontify namespaces in constant face. Or = perhaps add a namespace-face that inherits from constant face. >>=20 >> I think using font-lock-constant-face is fine. Patches welcome. >>=20 >>>> 2. Doc string comments are fontified like normal comments. It looks = like >>>> treesiter does not recognize them at all. Is this something we need = to >>>> report to treesitter or we need to workaround it in emacs side? >>>=20 >>> I=E2=80=99m working on that. I think the best way is to workaround = it in Emacs. >>=20 >> Please note that some of those specially-formatted comments are >> explicitly supported by the grammar. >>=20 >=20 > It looks like tree sitter already supports this using language = injection: >=20 > >=20 > I am not sure if we can handle this same way in emacs. Or if it is a = better or worst approach than using a made in home workaround. Emacs supports language injection (in the name of embedded parser), see = 38.7 Parsing Text in Multiple Languages in elisp manual. The workaround we were talking about is just fontifynig the /** comments = with font-lock-doc-face, nothing fancy. For more elaborate effect = you=E2=80=99d need doxygen grammar.=20 Yuan