From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: emacs-tree-sitter and Emacs Date: Mon, 30 Mar 2020 10:00:48 -0400 Message-ID: References: <83eeta3sa0.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="3430"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Jorge Javier Araya Navarro , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Mar 30 16:01:41 2020 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 1jIuyz-0000ih-Qm for ged-emacs-devel@m.gmane-mx.org; Mon, 30 Mar 2020 16:01:41 +0200 Original-Received: from localhost ([::1]:50344 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jIuyy-00012h-SL for ged-emacs-devel@m.gmane-mx.org; Mon, 30 Mar 2020 10:01:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52319) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jIuyJ-0000Z5-PR for emacs-devel@gnu.org; Mon, 30 Mar 2020 10:01:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jIuyI-0006yj-63 for emacs-devel@gnu.org; Mon, 30 Mar 2020 10:00:59 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:5839) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jIuyC-0006rC-R1; Mon, 30 Mar 2020 10:00:52 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id D686C1006CE; Mon, 30 Mar 2020 10:00:51 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 50AFC100617; Mon, 30 Mar 2020 10:00:50 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1585576850; bh=VhDBeeG0cMsacvnx4w/6jT9OvErGnJE3iOLZERknBa8=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=NykOS2h75IyO9wqGMWTIw9qDsxtgzn5Eugz469i1c0fdunSvENkQ4ItcwiQ6WHmNx BNboI27a98mjOQr+f5MIoxeaCqXob43yFrV5ILW2448RxuL5NaZhVEqFejVnv8yo4V OIOD5f5S9jI3ESFzxCuTvQZpaNQ6oEMmFBWjrYYc1qp7H6Z27Ybw/SlyGddkPQGB8d 4OlxFRmOcPpVcyYromqkEGJI70zGaKlmua8GgF15g2pB3Iao7/ZfVZEAnM9t4Wk+Pk 16fF2cX4lJ+IUA5D1qc61uUxc5UEBuQKzrQQH1+bsYSDKM4L4W3HRcHPBs2Bz7yIDG 05wAgzNjrYdHQ== Original-Received: from alfajor (unknown [104.247.241.114]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id D64D0120820; Mon, 30 Mar 2020 10:00:49 -0400 (EDT) In-Reply-To: <83eeta3sa0.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 30 Mar 2020 16:07:35 +0300") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 132.204.25.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:246007 Archived-At: >> I have gone through th0rex's pull request[2] and nothing suggests that >> hooks are being used in order to do >> the fontification of buffers, the only hook we have is >> `tree-sitter--after-change', it does re-parsing and keeps >> the tree updated > > Can you explain why an after-change hook is at all needed? IIUC `tree-sitter--after-change` is not a function placed on `after-change-function` but a hook which tree-sitter runs after its parse tree has been changed. The "tree-sitter-highlight" feature uses this hook to be informed which parts of the buffer need to be re-fontified after a change (which can be much more than just the part of the buffer that was changed). Stefan