From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.devel Subject: Re: Recent updates to tree-sitter branch Date: Sun, 02 Oct 2022 15:33:44 +0800 Message-ID: <87zgeeznl3.fsf@localhost> References: <87wn9srn9n.fsf@localhost> <87leq65v3t.fsf@localhost> <87k05m96cy.fsf@localhost> <09FF0751-A76E-449F-9F6C-7F3FDEC11DA1@gmail.com> <871qrs2mzl.fsf@localhost> <59AE5D4B-39D2-4C18-BAC6-9C71B736F0D0@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12875"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel , Theodor Thornhill To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Oct 02 09:33:50 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 1oetTy-0003AI-7z for ged-emacs-devel@m.gmane-mx.org; Sun, 02 Oct 2022 09:33:50 +0200 Original-Received: from localhost ([::1]:39296 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oetTx-0000SX-AJ for ged-emacs-devel@m.gmane-mx.org; Sun, 02 Oct 2022 03:33:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52058) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oetT6-0007ey-Jc for emacs-devel@gnu.org; Sun, 02 Oct 2022 03:32:56 -0400 Original-Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]:56244) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oetT4-0005vA-OR for emacs-devel@gnu.org; Sun, 02 Oct 2022 03:32:56 -0400 Original-Received: by mail-pj1-x102a.google.com with SMTP id gf8so4977305pjb.5 for ; Sun, 02 Oct 2022 00:32:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date; bh=RsIGIJECfUloGvx2sF3hzUCC320XEdndBdpVZP1hAo8=; b=ppYW5hnMOeWLJ61cbD2j9RXaIO5CzNCMODYWw4jwkEj9rQ9dNVux3op4Zu+RFcW9jG 7YreGNTPjwnrE2v0Nu1CBhF50mWLAQgm7lug0kOrCXIz9DEX5TIYA3N6KC39PAesvxvv qNvHrpER1hhOxPGcpJEJkHfh06c7Te1jBX8kaxivsldU5kw9e+kq8JEhQnaiJOhI4PP0 lZ+v6jGuNU3Rhf3Ol5tAPe7WvDNtFau9WsIsy81gFkl4cGkOgUNTgz6CYTRolXs6tDTH +yw/uNWSmb3ba/+aabszbbMQ58CXcgK2CWgi6VUQOAGaKyQc4Ts3Ieef7D/6G2MSBwZP To+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date; bh=RsIGIJECfUloGvx2sF3hzUCC320XEdndBdpVZP1hAo8=; b=mJHEJ1WE/W3RA8iORZbiuCHnEXIRtPe4bzzhGnmoKmSM4OOsCXIMmCnmbC2MbGN6Mk uAP6gbTlRBFP+1wDbAczsAYanHFYpePNV7QRUdJp9zk1FfT/+c0d/XB6iKi1RG32rTJs jy1NsxhFDJsPsYl8ppe+j0i/5aJbQfvkP8X8uxS/n4Hj3Vlzi33y3zXr15tmm4waKZDk NDK7E++iIiL3lXTtG2YNr29SdH0ktOmMx09+aeM5r8pMz9Z2R1PYOgluGMaTkNSr6FeF 4JgwtV2goDZp+AiGjM/OiLwAMN89YSGU6tBTgWL5Ewa3J4gGMpp1bG8iU2UGEbd8iJ/S ylxA== X-Gm-Message-State: ACrzQf0y8ICYLTB2cezIGB00hLOK+S2nMV5tGwWZuSYy8mJcW1DVfsgy wGZGJwRWoyp75i8qPiKj9yQw8f6D7HrEYQ== X-Google-Smtp-Source: AMsMyM5IyJxWKDrDOA0vCT2BTe7sZwQrD1kMZc8pfPapoho2bLbbiKRFPHdUj6vnHLKi6wLLpmEjYw== X-Received: by 2002:a17:903:1109:b0:179:d220:1f55 with SMTP id n9-20020a170903110900b00179d2201f55mr16405093plh.42.1664695973238; Sun, 02 Oct 2022 00:32:53 -0700 (PDT) Original-Received: from localhost ([2409:8970:a80:3a4:8ec6:81ff:fe70:339d]) by smtp.gmail.com with ESMTPSA id b8-20020a1709027e0800b00172b87d97cbsm4941343plm.67.2022.10.02.00.32.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Oct 2022 00:32:52 -0700 (PDT) In-Reply-To: <59AE5D4B-39D2-4C18-BAC6-9C71B736F0D0@gmail.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=yantar92@gmail.com; helo=mail-pj1-x102a.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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_ENVFROM_END_DIGIT=0.25, 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" Xref: news.gmane.io gmane.emacs.devel:296590 Archived-At: Yuan Fu writes: >> I disagree. The current default in font-lock-keywords is not to >> override. If programmatic font-lock behaves differently, it will be >> confusing. > > I think the tree-sitter queries are different enough from font-lock keywords that it will not bring confusion. Further more, default to override should make things easier, especially to delicate things like string interpolation, or other nested constructs, where tree-sitter shines. By default, if the to-be-fontified region has any existing face, the whole fontification is given up instead of filling in new fontification. That would be IMO confusing because user would think the match failed. I do agree that it may be confusing. Yet, it is how the default fontification works. I do not think that tree-sitter matching is conceptually different compared to regexp matching. (And this particular area is not even limited to tree-sitter, AFAIU). I do not insist on my idea being actually used, but wanted to leave a data point to be considered. > Also bear in mind that the override flag can only be applied to the whole query, rather than individual captured nodes. How does it change anything? I may be misunderstanding something---can you provide some illustrative example clarifying whole query vs. individual notes? -- Ihor Radchenko, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92