From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?=C3=93scar_Fuentes?= Newsgroups: gmane.emacs.devel Subject: Re: How to add pseudo vector types Date: Mon, 26 Jul 2021 22:05:58 +0200 Message-ID: <87y29sg7rt.fsf@telefonica.net> References: <83h7gw6pyj.fsf@gnu.org> <46BBFF88-76C3-4818-8805-5437409BEA93@gmail.com> <83wnpq46uk.fsf@gnu.org> <533BD53B-4E85-4E9E-B46A-346A5BBAD0F5@gmail.com> <258CB68D-1CC1-42C8-BDCD-2A8A8099B783@gmail.com> <1a776770-50b7-93cd-6591-c9a5b3a56eb8@gmail.com> <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> <83r1fluikh.fsf@gnu.org> <83mtq8vqmn.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10620"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) To: emacs-devel@gnu.org Cancel-Lock: sha1:TwvDxIRmeFqF2QJvde4eiYqgTeg= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jul 26 22:07:33 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 1m86sv-0002Yd-IJ for ged-emacs-devel@m.gmane-mx.org; Mon, 26 Jul 2021 22:07:33 +0200 Original-Received: from localhost ([::1]:38412 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m86su-0000DN-K8 for ged-emacs-devel@m.gmane-mx.org; Mon, 26 Jul 2021 16:07:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50974) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m86rb-0006fG-6i for emacs-devel@gnu.org; Mon, 26 Jul 2021 16:06:11 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]:54320) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m86rW-0005Aa-TY for emacs-devel@gnu.org; Mon, 26 Jul 2021 16:06:10 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1m86rT-0000k7-RM for emacs-devel@gnu.org; Mon, 26 Jul 2021 22:06:03 +0200 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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:271670 Archived-At: chad writes: > I think I understand your point, and I agree that it would be ill-advised > to remove the ability to change the "scope" in question from lisp's > control. What I'm trying to say (and I think Yuan Fu is also suggesting) is > that while emacs necessarily has *one* view of the buffer, narrowed or not, > tree-sitter might want to maintain multiple trees of that buffer, with the > default being the same as emacs' widened view, and narrowed views being > separate parse trees created as needed. I'm suggesting this as an > alternative to having emacs+ts effectively throw away most of the parse > tree every time the user narrows, then have to re-build it on each widen. > > In other words, I think this might be a communication issue about the > default trade-off behavior: generally keep a fully-widened tree and > create/use narrowed trees as needed, versus generally keeping only a tree > that matches whatever a higher-level view of the buffer might give at any > one moment, rebuilding each time. IIUC this is not about the user doing M-x narrow-to-defun or somesuch, we can agree that (in general) the right thing to do for TS is to keep using the whole buffer. I think Eli is trying to control what TS sees because doing so would make possible some features and/or simplify implementing them. Think of an Org file with some code blocks. It makes no sense to expose the whole Org file to TS and, I guess, it would just complicate things for no benefit. On that scenario, it might make sense to deal with the code blocks as independent entities instead of parts of something else.