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#60223: 29.0.60; Improve how tree-sitter changes to treesit--font-lock-fast-mode Date: Sat, 24 Dec 2022 01:33:01 -0800 Message-ID: References: <2e1e12123516721aed9e7e4ba8fe5409@ronanarraes.com> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) 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="3198"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60223@debbugs.gnu.org To: ronisbr@ronanarraes.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 24 10:34:12 2022 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 1p90ux-0000U4-An for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 24 Dec 2022 10:34:11 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p90ur-0002Dt-Kg; Sat, 24 Dec 2022 04:34:05 -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 1p90up-0002DX-8z for bug-gnu-emacs@gnu.org; Sat, 24 Dec 2022 04:34:03 -0500 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 1p90up-0000DI-1E for bug-gnu-emacs@gnu.org; Sat, 24 Dec 2022 04:34:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p90uo-00041m-TL for bug-gnu-emacs@gnu.org; Sat, 24 Dec 2022 04:34:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <2e1e12123516721aed9e7e4ba8fe5409@ronanarraes.com> Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Dec 2022 09:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60223 X-GNU-PR-Package: emacs Original-Received: via spool by 60223-submit@debbugs.gnu.org id=B60223.167187439115437 (code B ref 60223); Sat, 24 Dec 2022 09:34:02 +0000 Original-Received: (at 60223) by debbugs.gnu.org; 24 Dec 2022 09:33:11 +0000 Original-Received: from localhost ([127.0.0.1]:41995 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p90tz-00040v-01 for submit@debbugs.gnu.org; Sat, 24 Dec 2022 04:33:11 -0500 Original-Received: from mail-pf1-f179.google.com ([209.85.210.179]:39690) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p90tw-00040p-WA for 60223@debbugs.gnu.org; Sat, 24 Dec 2022 04:33:09 -0500 Original-Received: by mail-pf1-f179.google.com with SMTP id w26so4652448pfj.6 for <60223@debbugs.gnu.org>; Sat, 24 Dec 2022 01:33:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=o0Z+Rn+g3IoDBf+mbTQjgYzutU49qZq/bRF6SHsTd20=; b=oYpB7j1h6+LDmwc6MUQVE8ZHJlGukayrBO9um2Of4Q2tscT+FJZGjLZg0LE3mWM99F nBRkzIDNQCkKZhvT5hi0wparb9RLV60Mps2dq21kmMFttc3m1qxpIUZ5UKr93wsA5j0/ wxZpTraWabZ98GiZ2sCKC1rc/Gjqby06fxUljIe4Dnni0Gp1OYD5yr4SxHQ5OJUpGm5N O4yrt/aac2yIXvAqkVQ0fVeV69s4SRyfQK1I4824gM5EWqXt1IRMN9SNQ1JjtuL//175 4TBdEweasW/5gHtlmAz445CAODy04HjEEuV+Rg98uLHVIsE8YNPQemA80GGxfgkksGP6 L0Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=o0Z+Rn+g3IoDBf+mbTQjgYzutU49qZq/bRF6SHsTd20=; b=KYNZ1DY3IF2H3flB7peP6AbCL6Sd5llFlOHMaR1wBWVkqeRZoKRUrK4RpNW3Bf6dET as8V5gkTjbgPd+GX2EoXZxf2JriNYEpCUBgfPVi0ArG4fiyDOLnaR5sb9vU7cAajfktj +jBj+zfzYvpFsQUphN5uVnzosb4YtuikQAYKGFnA0EBI90Ij4e3H96dwmLM9vUuMJIwn scNHoU+HrN4/g8Rc/xT/9Ywgpq6AJEU54W7Ou7JpDn5wyvEYgjzQaL1d8w48fcd6FYRZ sjhPCGcrrwOXzzN7IPp2CrpL3Pj6UQs4Zn4/JPQ9U/1qFOptBDLjFDgW1ZpOu2FdB5gY FCfA== X-Gm-Message-State: AFqh2kox5VcX8AghpxZ7/l3nQ6eYd2i8ZoZblsr8eN3i8eixyKIhbgke TajaimAljMC5hliTBtTL6Is= X-Google-Smtp-Source: AMrXdXvROuHEWnqTwTyaMA+ehHGwV0YJyQQo/M43U/Z+v9u+2Kc6EsTZgMe35ykEGaW6JRnjKqmDXQ== X-Received: by 2002:aa7:86d3:0:b0:577:3523:bd1f with SMTP id h19-20020aa786d3000000b005773523bd1fmr30024477pfo.14.1671874383167; Sat, 24 Dec 2022 01:33:03 -0800 (PST) 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 a24-20020aa795b8000000b00576ce9ed31csm3798216pfk.56.2022.12.24.01.33.02 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Dec 2022 01:33:02 -0800 (PST) X-Mailer: Apple Mail (2.3696.120.41.1.1) 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:251788 Archived-At: ronisbr writes: > Hi Yuan! > > Em 2022-12-21 01:17, Yuan Fu escreveu: >> Thanks for the report! >> The "fast mode" should be buffer-local, so that particular file >> shouldn=E2=80=99t affect other buffers. Just to make sure, you said = that if you >> open print.jl first, all other files are affected? > > Sorry for the misunderstanding. Indeed, only print.jl is affected. > > The behavior is: > > 1. If I open `print.jl` as the first file, the fast mode is > activated, > and the buffer shows a very strange font lock. All other = buffers > (including Julia files) work as expected. > 2. If I open any other Julia file and then I open `print.jl`, the > fast > mode is not activated, and everything works as expected. Cool, that makes much more sence. >> And I agree that the 0.01 second criterion is a crude one, but a long >> string shouldn=E2=80=99t affect the _query_ time, and that string is = not >> long at >> all, far from enough to make tree-sitter query to slow down. Let me >> investigate and see what=E2=80=99s the real cause, and if this can be = solved by >> better solutions than making the threshold customizable. We can=E2=80=99= t >> expect >> everyone to be able to pinpoint the culprit like you did :-) >> Yuan > > Thanks! Let me know if I can help debugging :) Which julia parser are you using? I installed the "official" one at here: https://github.com/tree-sitter/tree-sitter-julia but some queries in julia-ts-mode.el are not accepted by it, like the (true) pattern: the parser I downloaded wants "true" instead. Also julia-ts-mode has this code (set-electric! 'julia-ts-mode :words '("catch" "else" "elseif" "finally" "end")) which seems like a doom macro or something, since I don=E2=80=99t have = doom Emacs complains about undefined function. I commented it out so no biggy, just FYI. Yuan