From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#63390: 29.0.90; c-ts-mode fails to recognize functions in xterm.c Date: Thu, 18 May 2023 09:56:16 +0300 Message-ID: <83mt22w2jz.fsf@gnu.org> References: <837cthbtkz.fsf@gnu.org> <83ttwh3iuh.fsf@gnu.org> <83o7ml26fo.fsf@gnu.org> <5DD50A1C-F069-4FA8-8F2B-F273409310AE@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18517"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 63390@debbugs.gnu.org To: Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 18 08:57:25 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 1pzXZk-0004fA-Pr for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 18 May 2023 08:57:24 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzXZR-00066H-Nz; Thu, 18 May 2023 02:57:05 -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 1pzXZQ-000669-SY for bug-gnu-emacs@gnu.org; Thu, 18 May 2023 02:57:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pzXZN-0004Sg-Pj for bug-gnu-emacs@gnu.org; Thu, 18 May 2023 02:57:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pzXZN-0007zn-ME for bug-gnu-emacs@gnu.org; Thu, 18 May 2023 02:57:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 18 May 2023 06:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63390 X-GNU-PR-Package: emacs Original-Received: via spool by 63390-submit@debbugs.gnu.org id=B63390.168439297130672 (code B ref 63390); Thu, 18 May 2023 06:57:01 +0000 Original-Received: (at 63390) by debbugs.gnu.org; 18 May 2023 06:56:11 +0000 Original-Received: from localhost ([127.0.0.1]:51774 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pzXYZ-0007yd-D5 for submit@debbugs.gnu.org; Thu, 18 May 2023 02:56:11 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:38596) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pzXYX-0007yQ-Pd for 63390@debbugs.gnu.org; Thu, 18 May 2023 02:56:10 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzXYS-0004Oo-IW; Thu, 18 May 2023 02:56:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=JJe6Rw25/hYoXwubb+owIfWlVEUDJOsZsegjlfzkBVY=; b=gjUAmwlDnSAspQj+/r4P Wi5nivg7vnqEfwg57QLyawK2gFQHIWmcbJ1/mXNNi6lCmMvRJWVIrJqcAh3e7CF5HjWGZD75KAsFF 9xWunjH9uPhECJIbslw+Scr3tmKTG35vtY/lXJ+sSDaY2pd1yAIv/CBcN5mUr5HM7d7KO2uYAmTZj uN5GESkVSp1+v3EtqDuQKQjv5uEIBirlNV6PZ8EUtdGrKRzLEHGcPzz6qSS1uAVfn0/H2Hl6Z2q2c A2WrzM8ZpliqnXE8PeomstD5xAliFQNa5dX2xov1IN2c0meq39gCIJgBIfWr6juqpvomZtlM20A2k IrfclBpdyBupvw==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzXYS-0002UG-3t; Thu, 18 May 2023 02:56:04 -0400 In-Reply-To: <5DD50A1C-F069-4FA8-8F2B-F273409310AE@gmail.com> (message from Yuan Fu on Wed, 17 May 2023 23:19:22 -0700) 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:261901 Archived-At: > From: Yuan Fu > Date: Wed, 17 May 2023 23:19:22 -0700 > Cc: 63390@debbugs.gnu.org > > >> Ok, so that’s because there are ifdef’s inside the function, which cuts the function into pieces and tree-sitter can’t make out a function_definition, which is what we use to fontify the function name. A function_declarator alone can be used in many places, like in an argument list for function pointers, I think? > > > > Does this mean that on master movement by defuns will be broken around > > those functions? > > Yeah, unfortunately, I’ll try accommodate for it. > > > > >> I can fix this by fontifying top-level function_declaration, I think a top-level function_declaration should always be a function definition? > > > > Yes, I think this would be better. > > > >>>> Btw, function declarations in a header file are recognized as such, > >>>> but the names of the functions there are still correctly fontified. > >> > >> They are fine because there’s a semicolon in the end, so the function_decalration is wrapped in a declaration node, which we (the fontification rules) recognize. > > > > Thanks for explaining this. > > Should I fix this on emacs-29 or master? Sorry for the delay, I was having some distractions lately ;-) No need to apologize. We all have our lives, with their "disasters". If the fix is relatively simple and safe, I'd prefer this to be fixed on emacs-29. But if not, we can fix it later; after all, on emacs-29 this is a relatively rare issue, since we don't use tree-sitter for movement by defuns there. Thanks.