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: Sat, 01 Oct 2022 12:20:46 +0800 Message-ID: <871qrs2mzl.fsf@localhost> References: <87wn9srn9n.fsf@localhost> <87leq65v3t.fsf@localhost> <87k05m96cy.fsf@localhost> <09FF0751-A76E-449F-9F6C-7F3FDEC11DA1@gmail.com> Mime-Version: 1.0 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="20821"; 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 Sat Oct 01 06:20:57 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 1oeTzk-0005DB-Qh for ged-emacs-devel@m.gmane-mx.org; Sat, 01 Oct 2022 06:20:56 +0200 Original-Received: from localhost ([::1]:39220 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oeTzj-000681-9F for ged-emacs-devel@m.gmane-mx.org; Sat, 01 Oct 2022 00:20:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51520) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oeTyn-0005M2-7a for emacs-devel@gnu.org; Sat, 01 Oct 2022 00:19:57 -0400 Original-Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]:38773) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oeTyl-0005IC-KC for emacs-devel@gnu.org; Sat, 01 Oct 2022 00:19:57 -0400 Original-Received: by mail-pg1-x534.google.com with SMTP id 129so5691424pgc.5 for ; Fri, 30 Sep 2022 21:19:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date; bh=xgyD4DgPvcqX1zP88ifaxZSS/Djo6IMq35Yu5KoPgsw=; b=V/q1eGBM/9hj1eE8N5Q10B5z+a4zoZIrkrraqLSKe0WOGgKXpCT+UMQIbSGmTTaJpq LIgPLAcbpqGyz/2Z2C+gD5fMFVQkqAeP7ECUS2GeJF5JRTHd0rZ1YuJDx3K/Sbao2CTI gs9Siq15UdZN/LhBdPS1KA+EYXizTBbWohvODSJfExGZB0S+rZnSy4AkNCYl4+B+VOiV HJ7r6RA6RGOtOT25kzMGBftbBIIqV0GbjeV8aL8TnZBYWxsyto3pdk0i35eysCwroSWR /39W0KDqbFNys69IOPJxI3dw5UH+aic17m+vL+zeDnyjcSs/jjC/ca55wAeKC5DYQ9yu D1uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=xgyD4DgPvcqX1zP88ifaxZSS/Djo6IMq35Yu5KoPgsw=; b=y7p3lMnEoXKcA1FwDQUvuPll+hW0Wg+2vwsQf9+GtzZfEt0bcf2wew5WzGhPHaNvT3 lpsRUTflgLFglFQ8jvmFXxuz8yxP0i0jIcWUNmGK45f1SA/DVVC08zfjuO7hK6ta0Kb+ GI8lX+YDNYNQoRBlIjnGJg72EF2e9LYufDsd3t7B1gcWNvqGxXnvBmEMWJPM2u/yB4QL pSxdaApw1FHzv2wSdaqeHD9AJdxDDn88y1IYmtA6QerroOdcyqLADZh220wEtGqRxfMt 7yZhKcK27MCelKYAbZ/injbj3gH3vaSFSVyrFYobZvq17665f+S1ZgErdMMjpYo0ayRC TL+Q== X-Gm-Message-State: ACrzQf2NHQV+eg/FKwVeq/+75X2hejrfyVf+Ggq6IhtElAHyF0oKD7cD K3tkfl1lWQ0DObfwgGPlqCE= X-Google-Smtp-Source: AMsMyM6Og+mtrfn9UQI0dVXTj4zXnZ2yxr0WoLxB1ChFR/+ZspGWIHtv/R1/8Q6NfateLO0zxIttVg== X-Received: by 2002:a62:1b8f:0:b0:54b:8114:e762 with SMTP id b137-20020a621b8f000000b0054b8114e762mr12405340pfb.7.1664597993893; Fri, 30 Sep 2022 21:19:53 -0700 (PDT) Original-Received: from localhost ([2409:8970:a80:3a4:8ec6:81ff:fe70:339d]) by smtp.gmail.com with ESMTPSA id n6-20020a170903110600b0016ee3d7220esm2780267plh.24.2022.09.30.21.19.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Sep 2022 21:19:53 -0700 (PDT) In-Reply-To: <09FF0751-A76E-449F-9F6C-7F3FDEC11DA1@gmail.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::534; envelope-from=yantar92@gmail.com; helo=mail-pg1-x534.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:296538 Archived-At: Yuan Fu writes: >> Will the currently matched node be passed to the function? Or should the >> function run yet another query to determine the node it was called on? > > The matched node is passed to the function. Thanks for the clarification! I missed this detail in the documentation. >> OVERRIDE can also be 'prepend or 'append to combine faces from multiple >> nodes. > > You can=E2=80=99t really pretend or append if the only face format we all= ow is symbol. Why? 'prepend implies that if there is an existing font-lock-face, the new face will be prepended to it. Note the 'face text property may contain a list of faces: =E2=80=98face=E2=80=99 The =E2=80=98face=E2=80=99 property controls the appearance of the= character (*note Faces::). The value of the property can be the following: =20=20=20=20 ... =E2=80=A2 A list of faces. Each list element should be either= a face name or an anonymous face. This specifies a face which is an aggregate of the attributes of each of the listed faces. Faces occurring earlier in the list have higher priority. >> Also, OVERRIDE nil will not apply fontification on the already fontified >> parts of the region. Note that the parent node might only fontify >> fraction of the text inside the child node. The parts not yet fontified >> can make use of OVERRIDE nil. > > Ok, I guess it=E2=80=99s good to have options. But I think it is more int= uitive and convenient to override by default. I disagree. The current default in font-lock-keywords is not to override. If programmatic font-lock behaves differently, it will be confusing. --=20 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