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#63390: 29.0.90; c-ts-mode fails to recognize functions in xterm.c Date: Wed, 17 May 2023 23:19:22 -0700 Message-ID: <5DD50A1C-F069-4FA8-8F2B-F273409310AE@gmail.com> References: <837cthbtkz.fsf@gnu.org> <83ttwh3iuh.fsf@gnu.org> <83o7ml26fo.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.500.231\)) 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="1154"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 63390@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 18 08:20:23 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 1pzWzu-000Acu-Ne for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 18 May 2023 08:20:22 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzWzd-0005Px-W4; Thu, 18 May 2023 02:20:06 -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 1pzWzb-0005PF-VS for bug-gnu-emacs@gnu.org; Thu, 18 May 2023 02:20: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 1pzWzb-0006By-Mz for bug-gnu-emacs@gnu.org; Thu, 18 May 2023 02:20:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pzWza-0006kh-A0 for bug-gnu-emacs@gnu.org; Thu, 18 May 2023 02:20: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: Thu, 18 May 2023 06:20:02 +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.168439077425911 (code B ref 63390); Thu, 18 May 2023 06:20:02 +0000 Original-Received: (at 63390) by debbugs.gnu.org; 18 May 2023 06:19:34 +0000 Original-Received: from localhost ([127.0.0.1]:51740 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pzWz8-0006jq-9k for submit@debbugs.gnu.org; Thu, 18 May 2023 02:19:34 -0400 Original-Received: from mail-pl1-f171.google.com ([209.85.214.171]:44244) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pzWz6-0006je-I8 for 63390@debbugs.gnu.org; Thu, 18 May 2023 02:19:33 -0400 Original-Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1ae408f4d1aso13527985ad.0 for <63390@debbugs.gnu.org>; Wed, 17 May 2023 23:19:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684390767; x=1686982767; 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=n5Rl8xfvoqHneyHPTE0xNL0VUfb3GkiFWXaIJBA9LIY=; b=b3sRjk06WIsysQ2IYxDmIE3J748ZOEoRW59akYrYHv0Ir/5OLqUtoN9dngkjyJZu0v oXz6hsrbcG0o0VJ2SlzyBDc06iHQpskv7ctaMBPh5qlAENLU2Ev/fCaGSBi186N7KVmX iJJvox3EK2GuRqalUpB5IyIBwgNVRHT8B0kJpJeGBL9dd3Gz3HD39c3BEXhGWlgrFaiy JxnvqH+0oHqQTIbA+xz1zZD2PKsd77mDEgDoGAYJoCAD5n+gVH17fnmN9cVKD9TqcLvx 5ahRmYFeqI1+rdAoC0H9Tdqxi68o/8mA9p1GveJn7zb3JhcuYrBJUeJ4ZvSP7Ztrathm y8pA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684390767; x=1686982767; 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=n5Rl8xfvoqHneyHPTE0xNL0VUfb3GkiFWXaIJBA9LIY=; b=EfkUCKkkOgIs34fc2MP2RizRZrdE6//vzggncXfMY2gTPjVG2ef4NKLCe/wb+T6VhK zSpoBO3kLLPHpc8xj4PwrZKLph8/hg+XqaE1lnttT+3I4bOplqgynb2kKhf0ZHZKtxAP H4vXb00I3FTUMlmWkXfH+mLTSSktssFe1j9vgKapzfn1ETkdXIxhgpFLgwJ7AqBFRyZE xldOzWWWUirbrQnwrjWUBsKV5SRt7PsabVAkraDBT9k/J0R560j9kN6NTc+nuHgL2mW8 /gWkk83wamf+4o3SS0x7mz8q/NMw9RJTncK/idWo1s1swUb7PXV9yWUro7AXIbCxAGhm 6NdA== X-Gm-Message-State: AC+VfDxdNCf6UWP8VmwTpOEO+Ws9h9PqKeWrH7eSXVDp+ez6OEDuQt65 xyRuqdkJkzSGsNLIlOxSWNp8r+qWTKA= X-Google-Smtp-Source: ACHHUZ6Xc/0OgMznVGxoxnarkUx5fpL/Yy9MpwSqP3wCPLWuLINo7mYxFmhJYSrSjERhqp7I0P2E9g== X-Received: by 2002:a17:903:338e:b0:1ac:6d4c:c26a with SMTP id kb14-20020a170903338e00b001ac6d4cc26amr1464668plb.14.1684390766458; Wed, 17 May 2023 23:19:26 -0700 (PDT) Original-Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id v10-20020a170902b7ca00b001a9581d3ef5sm483094plz.97.2023.05.17.23.19.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 May 2023 23:19:25 -0700 (PDT) In-Reply-To: <83o7ml26fo.fsf@gnu.org> X-Mailer: Apple Mail (2.3731.500.231) 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:261896 Archived-At: > On May 15, 2023, at 4:13 AM, Eli Zaretskii wrote: >=20 >> From: Yuan Fu >> Date: Sun, 14 May 2023 22:47:06 -0700 >> Cc: 63390@debbugs.gnu.org >>=20 >>>> (function_declarator declarator: (identifier) >>>> parameters:=20 >>>> (parameter_list ( >>>> (parameter_declaration >>>> type: (struct_specifier struct name: (type_identifier)) >>>> declarator: (pointer_declarator * declarator: (identifier))) >>>> ))) >>>>=20 >>>> Same with the next function, = x_draw_composite_glyph_string_foreground. >>>> But the function after that, = x_draw_glyphless_glyph_string_foreground, >>>> is again recognized as function definition. I wonder if the >>>> preprocessor conditionals around there have something to do with = that. >>=20 >> Ok, so that=E2=80=99s because there are ifdef=E2=80=99s inside the = function, which cuts the function into pieces and tree-sitter can=E2=80=99= 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? >=20 > Does this mean that on master movement by defuns will be broken around > those functions? Yeah, unfortunately, I=E2=80=99ll try accommodate for it.=20 >=20 >> I can fix this by fontifying top-level function_declaration, I think = a top-level function_declaration should always be a function definition? >=20 > Yes, I think this would be better. >=20 >>>> Btw, function declarations in a header file are recognized as such, >>>> but the names of the functions there are still correctly fontified. >>=20 >> They are fine because there=E2=80=99s a semicolon in the end, so the = function_decalration is wrapped in a declaration node, which we (the = fontification rules) recognize. >=20 > Thanks for explaining this. Should I fix this on emacs-29 or master? Sorry for the delay, I was = having some distractions lately ;-) Yuan