From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: How to add pseudo vector types Date: Thu, 15 Jul 2021 18:50:36 +0300 Message-ID: <83v95b60fn.fsf@gnu.org> References: <83h7gw6pyj.fsf@gnu.org> <45EBF16A-C953-42C7-97D1-3A2BFEF7DD01@gmail.com> <83y2a764oy.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7828"; mail-complaints-to="usenet@ciao.gmane.io" Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jul 15 17:51:36 2021 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 1m43eC-0001tV-Sk for ged-emacs-devel@m.gmane-mx.org; Thu, 15 Jul 2021 17:51:36 +0200 Original-Received: from localhost ([::1]:57976 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m43eB-0001xu-Ow for ged-emacs-devel@m.gmane-mx.org; Thu, 15 Jul 2021 11:51:35 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42604) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m43dU-0001BY-LU for emacs-devel@gnu.org; Thu, 15 Jul 2021 11:50:52 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:53528) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m43dT-0001rr-NS; Thu, 15 Jul 2021 11:50:51 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2199 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m43dT-0006ex-7x; Thu, 15 Jul 2021 11:50:51 -0400 In-Reply-To: (message from Yuan Fu on Thu, 15 Jul 2021 11:17:02 -0400) 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:271258 Archived-At: > From: Yuan Fu > Date: Thu, 15 Jul 2021 11:17:02 -0400 > Cc: Stefan Monnier , > emacs-devel@gnu.org > > > Great, then please try also to liberate the implementation from using > > JSON, it's a major slowdown factor. > > JSON? I didn’t write anything involving JSON. Then what is json-module.zip about? > While you are looking at the patch, here are some questions for integrating tree-sitter with out buffer implementation. What I envisioned is for each buffer to have a `parser-list’, and on buffer change, we update each parser’s tree. I think modifying signal_after_change is enough to cover al the cases? Why do you need to do this when a buffer is updated? why not use display as the trigger? Large portions of a buffer will never be displayed, and some buffers will not be displayed at all. Why waste cycles on them? Redisplay is perfectly equipped to tell you when some chunk of buffer text is going to be redrawn, and it already knows to do nothing if the buffer haven't changed. > And, for tree-sitter to take the buffer’s content directly, we need to tell it to skip the gap. AFAIR, tree-sitter allows the calling package to provide a function to access the text, isn't that so? If so, you could write a function that accesses buffer text via BYTE_POS_ADDR etc., and that knows how to skip the gap already. > I only need to modify gap_left, gap_right, make_gap_smaller and make_gap_larger, right? Why would you need to _modify_ any of these?