From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Tree-sitter integration on feature/tree-sitter (severe performance issues together with linum-mode) Date: Tue, 23 Aug 2022 10:30:57 -0400 Message-ID: References: <04E35325-9A74-4395-9C93-2300827494C4@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="23730"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: jostein@kjonigsen.net, "Ergus via Emacs development discussions." , =?utf-8?Q?Tu=E1=BA=A5n-Anh_Nguy=E1=BB=85n?= , Markus Triska , Theodor Thornhill , dgutov@yandex.ru To: Fu Yuan Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Aug 23 16:35:33 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 1oQV09-0005tU-Dm for ged-emacs-devel@m.gmane-mx.org; Tue, 23 Aug 2022 16:35:33 +0200 Original-Received: from localhost ([::1]:48134 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQV08-0003yb-2i for ged-emacs-devel@m.gmane-mx.org; Tue, 23 Aug 2022 10:35:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49678) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQUvr-00017L-2Z for emacs-devel@gnu.org; Tue, 23 Aug 2022 10:31:08 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:13238) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQUvl-0000Es-W0 for emacs-devel@gnu.org; Tue, 23 Aug 2022 10:31:05 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 567994411DD; Tue, 23 Aug 2022 10:31:00 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 2EE4F4416BB; Tue, 23 Aug 2022 10:30:59 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1661265059; bh=PmpWdTlJEUeNI2g7MhaynjgxE7jeJYJn+pUCrfWHWSw=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=d2HBeE8ZVCI81UtDwew+n5mBIYIWAKm1QbQggw6PGA5cU+TikIDolaHWhjgS6N4GM +lKTGUmeU//8aWcE8uMVhgyRKTexzpQ2bCME8e3FdgBzrbHCvUWvHc221Whd8l/jWe rKEnqk5VpUqm/LtTnrsbS8W/YrYlpuaUtsTyqnDdo/SEuKJ4VaMz3MTGlmnr1YzZrq +P7E35uYpHdpTpZiZNz3GCZIfMoFxZoDcpcR6ryZaJ4BFuTOy6XW6WNeluj3hTAxTX vqdLK+OaYzYOLn8Da4SnrrzrdAW0epOEiZLM+doj0bRPkunt4opnvcaTD4rmCHslHS hTB8eH00jVqGw== Original-Received: from pastel (unknown [45.72.195.111]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id DD9B7120301; Tue, 23 Aug 2022 10:30:58 -0400 (EDT) In-Reply-To: <04E35325-9A74-4395-9C93-2300827494C4@gmail.com> (Fu Yuan's message of "Mon, 22 Aug 2022 18:53:10 -0700") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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:293890 Archived-At: > Yeah! I can do that. Do you have some ideas on the syntax you would use f= or > font-lock? Not really, which is why it hasn't happened yet I guess :-) `syntax-propertize-rules` could be an inspiration (tho, compared to font-lock, this one had the added constraint that it had to be applied in a single scan of an N-element regexp whereas font-lock can use N scans of simpler regexps). But maybe it's better if you try to come up with your own plan without suffering from my biases. Then I can look at it and complain :-) The result will probably be better. > If possible I=E2=80=99d like treesit stuff to be similar to font-lock. Since font-lock's hasn't happened yet, this should presumably happen by font-lock mimicking treesit rather than the reverse. > For example I made treesit to use font-lock=E2=80=99s decoration level sy= stem. That is the kind of bias that would have better been avoided (I think a better approach is to let the major mode specify features that can be included/excluded: practice seems to have shown that a "level" is too meaningless and coarse). Stefan