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.bugs Subject: bug#64830: 30.0.50 C++ treesitter mode no coloration Date: Sat, 24 Aug 2024 11:35:36 -0700 Message-ID: <3C502C2B-829D-42C3-A74A-2A783F5880CE@gmail.com> References: <868qwy8ii9.fsf@gnu.org> <86o75s5pu0.fsf@gnu.org> <86mslc5plq.fsf@gnu.org> <86h6bk5nnu.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_C5D7C714-4C08-408D-AD88-16E5A22C1B0B" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16288"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 64830@debbugs.gnu.org, Alan Mackenzie To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 24 20:37:51 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 1shve2-00045B-Vl for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 24 Aug 2024 20:37:51 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1shvdX-0004x6-54; Sat, 24 Aug 2024 14:37:19 -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 1shvdS-0004wn-75 for bug-gnu-emacs@gnu.org; Sat, 24 Aug 2024 14:37:14 -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 1shvdR-0004hj-TF for bug-gnu-emacs@gnu.org; Sat, 24 Aug 2024 14:37:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:Date:Mime-Version:From:To:Subject; bh=NsQu3Ate/i2XoiHUGGYwRVqQ5tulxOkJFL4vNlu402U=; b=jbXuaF/kWNyAMyQkcx49EbYUOHG5rReI7hpb4GoZYkQ0/ogSTMWxa1kHyBBS6oSZA0Ny3cmMNl/PNvjkZ3R3k5aAjT9BDuaaV4gJzpDaiUkHt/s4CgD0EPWgajPSH6E8WO3a4mjrHXUbbHA0b2FUhFzFKf8jgooCi4DfL7G68/YbegJcL0a0/JewE+fCQt80CD2KcQ8MSK2q2nEZG+Kb9SZZ7IAN8zngFkecaZM8qT6F7ER045VVcFvctBII69pd55pr7/KZMQTko2N9Rchd4ojTKRVf3P9A3ch5tEDlThrlFRNpXIQcW88xXKfBciLYOIOvYQ/Yoh8NVDBPQENdIw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1shveE-0007fE-FQ for bug-gnu-emacs@gnu.org; Sat, 24 Aug 2024 14:38:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Aug 2024 18:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64830 X-GNU-PR-Package: emacs Original-Received: via spool by 64830-submit@debbugs.gnu.org id=B64830.172452466829435 (code B ref 64830); Sat, 24 Aug 2024 18:38:02 +0000 Original-Received: (at 64830) by debbugs.gnu.org; 24 Aug 2024 18:37:48 +0000 Original-Received: from localhost ([127.0.0.1]:41889 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1shve0-0007eh-62 for submit@debbugs.gnu.org; Sat, 24 Aug 2024 14:37:48 -0400 Original-Received: from mail-pf1-f169.google.com ([209.85.210.169]:44216) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1shvdv-0007eN-91 for 64830@debbugs.gnu.org; Sat, 24 Aug 2024 14:37:46 -0400 Original-Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-71446fefddfso1281406b3a.0 for <64830@debbugs.gnu.org>; Sat, 24 Aug 2024 11:36:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724524548; x=1725129348; darn=debbugs.gnu.org; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=NsQu3Ate/i2XoiHUGGYwRVqQ5tulxOkJFL4vNlu402U=; b=iFIw6ZwRRZIhyZ9i7w0+RBE5WU8g5x/lOno1/rbKcVR3ZcDYGox8m6md/uzS0dwXUf HSY7TFEm5Ryu2GAP/OGfFI+tfh/riJT4+sguZ5S9kWIlTV4IwGgiYswYn6RDXZX0LJbR Yt2+ETR2WcpiW06UWxHGDe7uRyo/7Fe3Or+6Iyaq5AYw3lXOFeURkl3Xc0IqjZzSG726 l7SdUsNAtQa9r/0ygPJd7wqTKiydg4KYRpQbkJQEgalk39h73Ynxl+YZRNgsz8S4wslW KvQpR56Xhtq1F6edngxZSZAMtO/Nb3hURuPFlMT+YED69/PlkIJsJmWyB1b9WJDGETfM TfoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724524548; x=1725129348; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NsQu3Ate/i2XoiHUGGYwRVqQ5tulxOkJFL4vNlu402U=; b=ep2uE3QylpvvJ6XigawvY7vCBywZlnHZg3undxJkFHfOOdmi5FukseFTuKue5biJvY PvNntp08t9fdFbyK2KQRIe4j4e4c0DFIk6hXVpDkIGYCuag1TYNHEVWY4Rb5guPk5hRM 3hicdeyoBOcjDoWyAXbGW5+cGl0OFk653YW1Hu+0p2dlFAhSRl/yeux47nqLKLf+W6zc sZeMqS1ZMixvnMqGmf1bXHL+CVb10ObwBrSWBfpCyP9s4eSIIWCkXalxPL8sTwh6MFOe GXNmgZVgjcdCw7Q2TML96FGEwwiTwZVhqAWBYGnl2vOOelcUYnceEwT6Lsq/j6/mROjx U5Kw== X-Forwarded-Encrypted: i=1; AJvYcCUJenw9Xdoay9yDD61Q4aEd15qgL0McVArNpV7ru+roGHfCTfuaavcfPCg+Z9/5TPENpFNc7Q==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzIpxbJRl2E0tJ89BKXPnyo8rg8BE1SII28agQujPCZLWeuV8Wl KZJ11z1d3LwFEMVWT9NnEgdzPLXT2RyxHAmVkk/lFV2jyk642Wh1vsNABA== X-Google-Smtp-Source: AGHT+IE1EnaLb0jILoSjpHvjrxoXUI/6r2BcZ0moU8UMUMKGrlbUuBY8ivElpFbG+3mNSrV5kd5WZQ== X-Received: by 2002:a05:6a00:948c:b0:706:6408:7917 with SMTP id d2e1a72fcca58-714458b0117mr6725712b3a.26.1724524548232; Sat, 24 Aug 2024 11:35:48 -0700 (PDT) Original-Received: from smtpclient.apple ([2601:646:8f81:6120:411:bac0:461c:7bfe]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71434309676sm4942961b3a.174.2024.08.24.11.35.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Aug 2024 11:35:47 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.3776.700.51) 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:290688 Archived-At: --Apple-Mail=_C5D7C714-4C08-408D-AD88-16E5A22C1B0B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Aug 19, 2024, at 8:46=E2=80=AFPM, Yuan Fu = wrote: >=20 >=20 >=20 >> On Aug 16, 2024, at 11:27=E2=80=AFAM, Eli Zaretskii = wrote: >>=20 >>> Date: Fri, 16 Aug 2024 18:06:31 +0000 >>> Cc: 64830@debbugs.gnu.org, casouri@gmail.com, acm@muc.de >>> From: Alan Mackenzie >>>=20 >>>> Maybe your Emacs 30 build is old? >>>=20 >>> No. I updated it on Wednesday, the most recent commit I have being: >>>=20 >>> commit 9bedb957bebdca99b1bb96f58ea790e20ed48dee (HEAD -> emacs-30, >>> origin/emacs-30) >>> Author: Eli Zaretskii >>> Date: Wed Aug 14 11:35:48 2024 +0300 >>>=20 >>> Improve documentation of time-parsing functions >>>=20 >>> .. I will update it right now and retry .... >>>=20 >>> ..... DONE. It makes no difference. I don't understand either why = I see >>> this bug and you don't. >>=20 >> Maybe try updating the C++ grammar library? >>=20 >> Yuan, any ideas? >=20 > Nothing obviously wrong from a glance. I=E2=80=99m very busy recently = but I=E2=80=99ll have some time this week to look into this. Sorry for = the delay :-) >=20 > Yuan Upon closer inspection, I think this is caused by a recent change in = c-ts-mode font-lock rules, in 014aab9847a0d3d898cb8cbc7224143f2d741abb. Alan, could you do this: don=E2=80=99t upgrade your c++ grammar and try = this patch, if I was right it should fix your problem. Thanks! Yuan --Apple-Mail=_C5D7C714-4C08-408D-AD88-16E5A22C1B0B Content-Disposition: attachment; filename=cpp-font-lock.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="cpp-font-lock.patch" Content-Transfer-Encoding: quoted-printable =46rom=20a171709cadd915f48d6c8ed3f9e1e19f6a4fde19=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Yuan=20Fu=20=0ADate:=20Sat,=20= 24=20Aug=202024=2011:32:43=20-0700=0ASubject:=20[PATCH]=20Fix=20= c-ts-mode=20font-lock=20for=20older=20c++=20grammar=20(bug#64830)=0A=0A*=20= lisp/progmodes/c-ts-mode.el:=0A(c-ts-mode--virtual-named-p):=20New=20= function.=0A(c-ts-mode--font-lock-settings):=20Use=20either=20keyword=20= or=20named=20node=0Adepending=20on=20grammar=20version.=0A---=0A=20= lisp/progmodes/c-ts-mode.el=20|=2016=20++++++++++++++--=0A=201=20file=20= changed,=2014=20insertions(+),=202=20deletions(-)=0A=0Adiff=20--git=20= a/lisp/progmodes/c-ts-mode.el=20b/lisp/progmodes/c-ts-mode.el=0Aindex=20= 6c406a8acd9..66e4999677b=20100644=0A---=20a/lisp/progmodes/c-ts-mode.el=0A= +++=20b/lisp/progmodes/c-ts-mode.el=0A@@=20-537,6=20+537,16=20@@=20= c-ts-mode--top-level-label-matcher=0A=20=20=20=20=20=20=20=20(equal=20= "function_definition"=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (treesit-node-type=20(treesit-node-parent=20parent)))))=0A=20=0A+;;;=20= Grammar=20checks=0A+=0A+;;=20Ref:=20= https://github.com/tree-sitter/tree-sitter-cpp/commit/c51ffe9d7b67aa9500db= 01c26d8c075cfe032d0f=0A+(defun=20c-ts-mode--virtual-named-p=20()=0A+=20=20= "Return=20t=20if=20virtual=20is=20a=20named=20node=20instead=20of=20a=20= keyword."=0A+=20=20(ignore-errors=0A+=20=20=20=20(progn=0A+=20=20=20=20=20= =20(treesit-query-compile=20'c++=20"(virtual)=20@cap")=0A+=20=20=20=20=20= =20t)))=0A+=0A=20;;;=20Font-lock=0A=20=0A=20(defvar=20= c-ts-mode--feature-list=0A@@=20-635,9=20+645,11=20@@=20= c-ts-mode--font-lock-settings=0A=20=20=20=20:feature=20'keyword=0A=20=20=20= =20`([,@(c-ts-mode--keywords=20mode)]=20@font-lock-keyword-face=0A=20=20=20= =20=20=20,@(when=20(eq=20mode=20'cpp)=0A-=20=20=20=20=20=20=20=20=20= '((auto)=20@font-lock-keyword-face=0A+=20=20=20=20=20=20=20=20=20= `((auto)=20@font-lock-keyword-face=0A=20=20=20=20=20=20=20=20=20=20=20=20= (this)=20@font-lock-keyword-face=0A-=20=20=20=20=20=20=20=20=20=20=20= (virtual)=20@font-lock-keyword-face)))=0A+=20=20=20=20=20=20=20=20=20=20=20= ,@(if=20(c-ts-mode--virtual-named-p)=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20'((virtual)=20@font-lock-keyword-face)=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20'("virtual"=20@font-lock-keyword-face)))))=0A= =20=0A=20=20=20=20:language=20mode=0A=20=20=20=20:feature=20'operator=0A= --=20=0A2.39.5=20(Apple=20Git-151)=0A=0A= --Apple-Mail=_C5D7C714-4C08-408D-AD88-16E5A22C1B0B--