From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yoav Marco Newsgroups: gmane.emacs.devel Subject: Re: Tree-sitter integration on feature/tree-sitter Date: Fri, 13 May 2022 11:42:04 +0300 Message-ID: <87fsldkdec.fsf@gmail.com> References: <87y1zabmbt.fsf@gmail.com> <5F186EBD-CD21-422B-8B4F-0D5424173334@gmail.com> <875ymdwf76.fsf@gmail.com> <011DA1A3-0FA8-4449-878A-FD6B336B0F1B@gmail.com> <8735hhw75p.fsf@gmail.com> <83czgks4ss.fsf@gnu.org> <87wnesuw63.fsf@gmail.com> <83pmkkqhft.fsf@gnu.org> <87tu9wukbt.fsf@gmail.com> <83ee10qbk7.fsf@gnu.org> <8F6A43D1-D1EA-4602-A245-627DB7960FC2@gmail.com> <838rr7qqhw.fsf@gnu.org> <87sfpekf6t.fsf@gmail.com> <838rr6pwjt.fsf@gnu.org> <87pmkik7x6.fsf@gmail.com> <83wneqoej5.fsf@gnu.org> <87mtfmk4oi.fsf@gmail.com> <83ee0yndor.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="15788"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.6.3; emacs 29.0.50 Cc: casouri@gmail.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri May 13 12:44:44 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 1npSmp-0003y7-0P for ged-emacs-devel@m.gmane-mx.org; Fri, 13 May 2022 12:44:43 +0200 Original-Received: from localhost ([::1]:39916 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1npSmo-0007U2-1b for ged-emacs-devel@m.gmane-mx.org; Fri, 13 May 2022 06:44:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40508) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npRIJ-0005u4-Nd for emacs-devel@gnu.org; Fri, 13 May 2022 05:09:07 -0400 Original-Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:42505) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1npRII-0007WM-3W; Fri, 13 May 2022 05:09:07 -0400 Original-Received: by mail-wm1-x336.google.com with SMTP id n126-20020a1c2784000000b0038e8af3e788so4397102wmn.1; Fri, 13 May 2022 02:09:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:user-agent:from:to:cc:subject:date:in-reply-to :message-id:mime-version; bh=mMqsDdIE4t6xfJ9u3bMbr+VdWZtsjUlsARi6GVqheA4=; b=nmJGjQ8aPDLtLt8tOXnWTK9PVthpm/8+if1mLGoUqHz0LkvNpulD3n3I/wQWTJtYA/ AI9wV+o7A+BbPSahOTZvg6euHnZw2o3vMgVIQxcU5IC54boZ1q+C/2z+iorQJUpXrWXv Cs6duKJT7dj/pGOhudEUZ7UagS0+czfhUtMH9idV2ToMsZK781JOVYwIOXp/wtuSvZQL 9glY/Wf1IqHldfIkH5A7T7sVBNrflWHzMJy/wApBgT2MomqRiWUGJlJdHToSmLpW3kTd ZUiGuug5TrAqaj6/l314JT44WThRknESHfpJdu6UkHpDYGRhcQMbk8LfhWqXErPT1LRX oFGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:references:user-agent:from:to:cc:subject:date :in-reply-to:message-id:mime-version; bh=mMqsDdIE4t6xfJ9u3bMbr+VdWZtsjUlsARi6GVqheA4=; b=o/E2EqLIz8W9QzDNy9tFAbmdB1mGF2AoFzZgzmHVPSNiwftBLB1dN51tLLYbPGfRQG rPkSEJ2peA6F1+RGJvttLUopzh2fjLp6JBxkqikMVBzJF6g42cDUeQFWe9QyyuyrLGTa FNJoFK0sXX6tlyQXNtH43SuD7HJc+sZSZcbluur+tFN5ZC6+2mPBHxw3VeDTi9S/fLAt SBEfm8kKxnz7a1IRT8C7xbJmmslqO4Yb6DCmmPJTy4ZqE9MXtUt7QnjIwbeL5DwxhKoR JTrlFCfroocYvNxm2RoNZrs1WoH8eMysJriPOVcKGl8UzOBONlq1opC9aJUeEWJ7ItzQ QRhg== X-Gm-Message-State: AOAM5302QIbt6dMGiD2u1WgU0Y3g12GEpowyrwmyJYZpptRjaN0c8umq XCNsHccyoNFlD4nXhODqaJRgp1Ge7bWmww== X-Google-Smtp-Source: ABdhPJz5rRhK8CEKi9ufdWAf3gNl1qA1j45hLGL3ec9wDl4aavUwUVPztBBiskYW3pb1JG5ClwkOvw== X-Received: by 2002:a05:600c:5112:b0:394:55bd:5f9d with SMTP id o18-20020a05600c511200b0039455bd5f9dmr14291530wms.188.1652432944115; Fri, 13 May 2022 02:09:04 -0700 (PDT) Original-Received: from localhost ([77.126.101.171]) by smtp.gmail.com with ESMTPSA id o17-20020adfca11000000b0020c5253d8ddsm1764434wrh.41.2022.05.13.02.09.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 02:09:03 -0700 (PDT) In-reply-to: <83ee0yndor.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=yoavm448@gmail.com; helo=mail-wm1-x336.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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-Mailman-Approved-At: Fri, 13 May 2022 06:40:12 -0400 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:289722 Archived-At: Eli Zaretskii writes: > Is it true that there's just one query for each PL mode, and it is > fixed (doesn't change) and doesn't depend on the buffer contents in > any way? If that is true, the major mode could compile the query > whenever it is initialized, and then reuse it in every buffer that is > under that major mode. It's correct, though there might be more than one if a mode wants to offer fontification options users can toggle. But yeah, the major mode could compile its queries when initialized. I'm in favor of this too. >> Okay, we can try that. What's the proper way to trigger a "natural >> fontification" as would occur in the GUI without opening an interactive >> session? > > There isn't any (IIUC what you are asking). Fontification is a > feature of interactive sessions, and is basically meaningless without > normal redisplay. > >> I'd rather use the groundwork that's actually used by users, >> and not get stuff like the JIT chunck size wrong. In general I'm not too >> familiar with that part of Emacs; the benchmarks up to now used >> with-temp-buffer, would that suffice for these new benchmarks? > > Using with-temp-buffer could cause problems, because not everything is > set up as it would when actually visiting the file. Why is > with-temp-buffer necessary for the benchmarks? > > But if it turns out that a query doesn't depend on the buffer > contents, I think this is a moot point, and the major mode could > compile the query just once when its first loaded. Yeah. - Yoav