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: Tue, 27 Jul 2021 19:59:51 +0300 Message-ID: <8335rzvgjc.fsf@gnu.org> References: <8335s64v10.fsf@gnu.org> <5380C92B-6C15-4490-A1E0-1C3132DBB16A@gmail.com> <83k0li2shw.fsf@gnu.org> <86wnpg82v3.fsf@stephe-leake.org> <83lf5wyn0z.fsf@gnu.org> <86pmv66yqg.fsf@stephe-leake.org> <83a6maw705.fsf@gnu.org> <20210726234053.za5axe3m646ps7wr@Ergus> <4EA6F686-9408-4739-8552-110C24655966@gmail.com> <20210727165040.h265ih6bewvnvhop@Ergus> 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="9927"; mail-complaints-to="usenet@ciao.gmane.io" Cc: casouri@gmail.com, emacs-devel@gnu.org, stephen_leake@stephe-leake.org, cpitclaudel@gmail.com, monnier@iro.umontreal.ca To: Ergus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jul 27 19:01:20 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 1m8QSG-0002Sg-GF for ged-emacs-devel@m.gmane-mx.org; Tue, 27 Jul 2021 19:01:20 +0200 Original-Received: from localhost ([::1]:36182 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m8QSF-0004Or-CE for ged-emacs-devel@m.gmane-mx.org; Tue, 27 Jul 2021 13:01:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56306) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m8QQy-0003bu-Gw for emacs-devel@gnu.org; Tue, 27 Jul 2021 13:00:00 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:55468) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m8QQx-0003oa-GT; Tue, 27 Jul 2021 12:59:59 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1170 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 1m8QQx-0005en-3h; Tue, 27 Jul 2021 12:59:59 -0400 In-Reply-To: <20210727165040.h265ih6bewvnvhop@Ergus> (message from Ergus on Tue, 27 Jul 2021 18:50:40 +0200) 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:271704 Archived-At: > Date: Tue, 27 Jul 2021 18:50:40 +0200 > From: Ergus > Cc: Eli Zaretskii , > Clément Pit-Claudel , > Stephen Leake , > Stefan Monnier , emacs-devel@gnu.org > > On Tue, Jul 27, 2021 at 10:49:44AM -0400, Yuan Fu wrote: > > >You mean adding syntactic information to the text as text properties? > >That’s an interesting idea, maybe that’s easier to use than using > >tree-sitter’s api. > > > I think that was the initial Eli's idea when this topic came out. But > maybe I understood it wrongly. > > Theoretically in a re-parse doing ts_tree_get_changed_ranges will give > the list of changes needed in the whole text, so updating properties > there may be simpler and cheap (even when they are not in the visible > part of the buffer). > > Also, any action that doesn't modify the text (scrolling, moving the > cursor, windows split/resize) won't call any tree-sitter and redisplay > could handle almost everything easily on the beginning. > > The only concern here may be that adding properties to the entire text > may be memory consuming. Or maybe that this could overlap part of the > font-lock functionality. > > But probably Eli can make a more accurate critic of this idea.. Storing the syntactic information as text properties has definite advantages: easy access, use of well-known Emacs Lisp features, etc. I don't feel I know enough about this use of the properties to have a definitive opinion, though. We should probably try that.