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: Fri, 19 May 2023 16:13:36 -0700 Message-ID: <43A50DDE-2E59-450C-933E-B2B67B33760B@gmail.com> References: <837cthbtkz.fsf@gnu.org> <83ttwh3iuh.fsf@gnu.org> <83o7ml26fo.fsf@gnu.org> <5DD50A1C-F069-4FA8-8F2B-F273409310AE@gmail.com> <83mt22w2jz.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="23475"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 63390-done@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 20 01:14:31 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 1q09Is-0005tH-SB for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 20 May 2023 01:14:30 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q09IT-00050M-59; Fri, 19 May 2023 19:14: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 1q09IR-0004zi-99 for bug-gnu-emacs@gnu.org; Fri, 19 May 2023 19:14:03 -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 1q09IR-0000YT-1B for bug-gnu-emacs@gnu.org; Fri, 19 May 2023 19:14:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q09IQ-0002RC-J5 for bug-gnu-emacs@gnu.org; Fri, 19 May 2023 19:14:02 -0400 Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Fri, 19 May 2023 23:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 63390 X-GNU-PR-Package: emacs Mail-Followup-To: 63390@debbugs.gnu.org, casouri@gmail.com, eliz@gnu.org Original-Received: via spool by 63390-done@debbugs.gnu.org id=D63390.16845380389347 (code D ref 63390); Fri, 19 May 2023 23:14:02 +0000 Original-Received: (at 63390-done) by debbugs.gnu.org; 19 May 2023 23:13:58 +0000 Original-Received: from localhost ([127.0.0.1]:57585 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q09IL-0002Qe-Pe for submit@debbugs.gnu.org; Fri, 19 May 2023 19:13:58 -0400 Original-Received: from mail-pf1-f174.google.com ([209.85.210.174]:45502) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q09IJ-0002QQ-O8 for 63390-done@debbugs.gnu.org; Fri, 19 May 2023 19:13:56 -0400 Original-Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-64d2b42a8f9so1521326b3a.3 for <63390-done@debbugs.gnu.org>; Fri, 19 May 2023 16:13:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684538030; x=1687130030; 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=61fbd+pNcN1gYMzNkpt/Au5+eIJc2OnhwQy5gtn7lEE=; b=QzRdSvOuW5U87Qe9Ym2sYAbxsc2V2l30MVigHRXMPYngGxYNKW3wbJgJiJ6m2TWHUl KcWEsEsLZIGx4PV2ysegbwRU6BHgNbtg1+2EDcFYkE3UwoPE5x+794dZVvVuEkzHZVuq v8ZDD9aCWlhhbR9wsMGChnyukool27maF6ZR4WKx+xl0OD34khhVC+5F10KLSLHSFGWu ZGtDTP/xMgT1uBsS8wugY8sklze9T1+9fwH9McaY2BNd5WMjndyLanFVZnsHEoh8sg5f M+rPvsovGI/Mq2z00WGmFXBomWN+09sGIM7b9iKKNvgCMvHhr2TDa2zzF/TkoJmXlAwq QV8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684538030; x=1687130030; 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=61fbd+pNcN1gYMzNkpt/Au5+eIJc2OnhwQy5gtn7lEE=; b=Ks3bpO9Jt7mwtcU/rEDf7nlaW0hhHGN0CnJpyl9sw6srDtjBHAMXTvUUTA2Y+1o91Y v2+oj4rpsbBrELaDDyokCq/jWVpEXaoYRApN4iGqxLRLiiEFLt3UcZENslpa5kG7ev5S N3MFvWZ3wat/iVtSAumisJvnzh7sPA5Tx2R+9Oc2qaEje5vtQMVWpbC+s7zIKoQMX4jn ujSWEO2/lYo2jfvWFLCXEApnuxNGdOZJ/7zycr7LELrt52nPbbTbWXUS2PYTr34FwexW pj9bAz5DvQ8V8NUITiDSIPVLENZJgU38LoTZXaPIeC3xgtXg+mMaAijRVyvckw67DK9I 8y8Q== X-Gm-Message-State: AC+VfDzOtw+0sq8DqPzkV/YB6MQS8DPngaLiqFg2pQy7fVqXBOMAUCQ8 UNNS6Zw8+qB+GK6NH6EQw/Q= X-Google-Smtp-Source: ACHHUZ7Wl+WAAGpFEfPUOusd3vyyZt9Du1TLo967fiVZrYykL3MwFwW8LPFLfPGTy2oOV+r16azJmQ== X-Received: by 2002:a05:6a21:980f:b0:100:49d1:6fc7 with SMTP id ue15-20020a056a21980f00b0010049d16fc7mr2906030pzb.34.1684538029552; Fri, 19 May 2023 16:13:49 -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 y8-20020aa78048000000b0063b7c42a072sm213338pfm.13.2023.05.19.16.13.48 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 May 2023 16:13:49 -0700 (PDT) In-Reply-To: <83mt22w2jz.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:262026 Archived-At: > On May 17, 2023, at 11:56 PM, Eli Zaretskii wrote: >=20 >> From: Yuan Fu >> Date: Wed, 17 May 2023 23:19:22 -0700 >> Cc: 63390@debbugs.gnu.org >>=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? >>=20 >> Yeah, unfortunately, I=E2=80=99ll try accommodate for it.=20 >>=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. >>=20 >> Should I fix this on emacs-29 or master? Sorry for the delay, I was = having some distractions lately ;-) >=20 > No need to apologize. We all have our lives, with their "disasters". >=20 > 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. >=20 > Thanks. I pushed a fix for it to emacs-29. Yuan=