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.devel Subject: Re: Call for volunteers: add tree-sitter support to major modes Date: Thu, 20 Oct 2022 09:12:24 +0300 Message-ID: <8335bjyqev.fsf@gnu.org> References: <83czb1jrm3.fsf@gnu.org> <878rlo7on0.fsf@thornhill.no> <83k04y1gd2.fsf@gnu.org> <87wn8xbyr2.fsf@yahoo.com> <713135A0-FF74-43F5-969E-CECDF3C02DE6@gmail.com> <87sfjlbpw9.fsf@yahoo.com> <21B0931E-728E-4F17-8BC0-D8218BE65489@gnu.org> <87h701beqv.fsf@yahoo.com> <835ygh18w5.fsf@gnu.org> <87czan8hyn.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35602"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org, casouri@gmail.com, acm@muc.de, theo@thornhill.no To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Oct 20 08:21:47 2022 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 1olOw6-00096L-RP for ged-emacs-devel@m.gmane-mx.org; Thu, 20 Oct 2022 08:21:47 +0200 Original-Received: from localhost ([::1]:42466 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1olOw5-0005b5-Ie for ged-emacs-devel@m.gmane-mx.org; Thu, 20 Oct 2022 02:21:45 -0400 Original-Received: from [::1] (port=58038 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1olOrB-0002hI-3M for ged-emacs-devel@m.gmane-mx.org; Thu, 20 Oct 2022 02:16:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58524) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1olOnB-0008S0-6d for emacs-devel@gnu.org; Thu, 20 Oct 2022 02:12:33 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:50860) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1olOnA-0000jA-6U; Thu, 20 Oct 2022 02:12:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=DHkc+3dAPJNxFiQjZp+gXRzfnoqOz6aNao/sA1sv/Nw=; b=MEDFHQ8GE0qg SR4Zp98akgY6iX5wA4bUE8OSCfFYWl3Ba4s1hrpc204Ci3WIHpEAy8ZdN+ngWHsyOzgToTHiJO5EI YK7lzWXCt7jnEi6AdleP/9SDcLqTZukb7fSiWXOECI8IEKWv4PZzApe4aDxm6F161N6q5bU9pTDnq Hfs1EZ6+MRFdWo97OXNbCU67Z+wuutDSRFVu/YhpfM9qH/Cf9QTL6ZLsEiVS7zEwvP5fi4aaLIqBP K7j/R8QK6y6mpmRcvmo36wNM3KT9Cm/F55rV/urLM8pclLDsa79tTwhjmGUxq2HvP1LCO9TiRgbuJ 40APLRJP5kTJJ7dXklPN0w==; Original-Received: from [87.69.77.57] (port=4535 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 1olOn7-0007lj-QS; Thu, 20 Oct 2022 02:12:31 -0400 In-Reply-To: <87czan8hyn.fsf@yahoo.com> (message from Po Lu on Thu, 20 Oct 2022 08:19:28 +0800) 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" Xref: news.gmane.io gmane.emacs.devel:298137 Archived-At: > From: Po Lu > Cc: emacs-devel@gnu.org, casouri@gmail.com, acm@muc.de, theo@thornhill.no > Date: Thu, 20 Oct 2022 08:19:28 +0800 > > Eli Zaretskii writes: > > > This part definitely isn't valid: > > > > extern maybe_tls (int) errno; > > > > $ gcc -c buggy_c.c > > buggy_c.c: In function 'maybe_tls': > > buggy_c.c:1:26: error: expected declaration specifiers before 'errno' > > 1 | extern maybe_tls (int) errno; > > | ^~~~~ > > buggy_c.c:1:21: error: parameter name omitted > > 1 | extern maybe_tls (int) errno; > > | ^~~ > > buggy_c.c:2: error: expected '{' at end of input > > Well, what if tree-sitter is given the following macro definition? > > # if !defined (LinkTargetKO) && !defined (__cc_lint__) > # define maybe_tls(type) _task_local_/**/type > # else > # define maybe_tls(type) type > # endif If you use macros to selectively remove parts of the source at critical places, you can completely change how the source code is seen by the parser. I don't know how tree-sitter processes macro definitions, but maybe someone else will. > Trust me, I have my own bad experiences with CC Mode fontification. See > the slew of bugs I found and reported with Emacs 29's CC Mode just this > week: bug#58537, bug#58534, bug#58539. My problem is the blanket > dismissal of what CC Mode actually gets right that seems to be > alarmingly prevalent around here ("... in Emacs 30, let's get rid of CC > Mode!") No one seriously intends to throw away what CC Mode does, let alone dismiss it in a blanket manner. This is a strawman. This discussion has a lot of noise, but you should be experienced enough to know whose voices to hear and whose to dismiss as merely a personal opinion that has no bearing on what will actually happen in Emacs. > I agree that's bad, but so is the tree-sitter fontification of K&R > areas. We need to get our priorities right.