From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.devel Subject: Re: Tree sitter support for C-like languages Date: Wed, 16 Nov 2022 21:29:04 +0800 Message-ID: <878rkbhvtr.fsf@yahoo.com> References: <87tu36em9t.fsf@thornhill.no> <87v8njw5th.fsf@thornhill.no> <83leofkwjm.fsf@gnu.org> <9E9244D3-2EFB-4621-91E0-FC8B8C1C2D52@gmail.com> <186915C1-1C47-43DC-A386-B447A2E7528D@gmail.com> <83h6z1k6z8.fsf@gnu.org> <52D18BA8-C9A8-4E9A-9DDA-76E48744DDC9@gmail.com> <837czxjrxu.fsf@gnu.org> <8BEF109A-A5B3-4CF4-AE07-AEB9388B0A07@gmail.com> <83zgcti9gh.fsf@gnu.org> <83y1scj3s8.fsf@gnu.org> <7082237A-2BD6-4A1C-8BEC-4D470B0D204F@gmail.com> <83a64si7jo.fsf@gnu.org> <835yfgi26h.fsf@gnu.org> <83y1scgj0e.fsf@gnu.org> <5C8F6B71-5610-4472-ACE0-7B1AD087FFA5@gmail.com> <83h6yzghui.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3870"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Yuan Fu , monnier@iro.umontreal.ca, theo@thornhill.no, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Nov 16 14:29:58 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 1ovIUH-0000lf-RM for ged-emacs-devel@m.gmane-mx.org; Wed, 16 Nov 2022 14:29:57 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ovITo-0007dl-De; Wed, 16 Nov 2022 08:29:28 -0500 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 1ovITi-0007cu-CS for emacs-devel@gnu.org; Wed, 16 Nov 2022 08:29:22 -0500 Original-Received: from sonic302-21.consmr.mail.ne1.yahoo.com ([66.163.186.147]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ovITf-0003Sx-PQ for emacs-devel@gnu.org; Wed, 16 Nov 2022 08:29:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1668605358; bh=zocB/1oPAbc02SHGNJmLs7bsYdckGtPknh2U+6A9DCs=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=acxy548ZGw4ebjzPkA5WkgqnvwTqNYFmK20WznJrPxswODkibPcwuaMjdDFQ6SGHB8ZFAXCFJMV6aYslAd3unW+bsWMia73L9RMhiY3yn789TxIqfnsA/mUhrrFzjFZtJsZxguhiA16jzWuI6LUEOA+ujX9FAp+oTx1TkaMrcoqXW1DAFjeO1wF9532xhLM4N/IssBWNy5gbvN94axMpzlkZIdAnwmEYBIkebQOMeVpEHP2B5451b2iieVhxvV4PRTTkz6TVz7uajUhPK6ywEaE24FqN4iFzY+nZXjknCzxo9CJojdLGG//F/8Qk7klF5ouLa6uKtdP8+UAYlNJW5g== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1668605358; bh=zsfaWmLE8IU/vqsoRnfStVkmwZbXJzGwL6TDlnV4XCd=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=FujE+8DX3x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ZAj3rw_PrER0.KhX_7FXoEd DKWy.CVTZm5G9o9P.sk0Yb7GeP6AaGJ6X_c6zw55NkUFS5NkErpbpFopnxkyYPOMFyfgS9pnpyr3 n97d3mOEe1Y2SnTvzoti0TP10b3gC6HhQgY5A39YT2 X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic302.consmr.mail.ne1.yahoo.com with HTTP; Wed, 16 Nov 2022 13:29:18 +0000 Original-Received: by hermes--production-sg3-6c8895b545-mnqst (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 0e7f27543af4b26a708b55d8960013d3; Wed, 16 Nov 2022 13:29:13 +0000 (UTC) In-Reply-To: <83h6yzghui.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 16 Nov 2022 15:16:21 +0200") X-Mailer: WebService/1.1.20863 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.186.147; envelope-from=luangruo@yahoo.com; helo=sonic302-21.consmr.mail.ne1.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:299923 Archived-At: Eli Zaretskii writes: > DEFUN is Emacs-specific, but the other examples I've shown aren't, I > see them in many other programs. Right. What about "common" macros, such as ones that involve type names? For example, here is some sample GLib code, and GLib is a library used widely throughout GNOME and freedesktop.org: #ifdef HAVE_GTK3 static void emacs_menu_bar_get_preferred_width (GtkWidget *, gint *, gint *); static GType emacs_menu_bar_get_type (void); typedef struct _EmacsMenuBar { GtkMenuBar parent; } EmacsMenuBar; typedef struct _EmacsMenuBarClass { GtkMenuBarClass parent; } EmacsMenuBarClass; G_DEFINE_TYPE (EmacsMenuBar, emacs_menu_bar, GTK_TYPE_MENU_BAR) #endif Note how the the macro has no trailing semicolon. That is required for it to work correctly (I don't know why.)