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: emacs-29 56cd810b9d1: =?utf-8?Q?Don=E2=80=99t?= signal warning when loading go-ts-mode.el without grammar Date: Sat, 04 Mar 2023 09:05:24 +0200 Message-ID: <83lekdate3.fsf@gnu.org> References: <83r0u7eh2f.fsf@gnu.org> <6B49E4E7-8FB6-47A6-A380-538BEE2DE1E1@gmail.com> <83edq6cmdr.fsf@gnu.org> <5B384B39-F6DD-4E32-8506-A6D2BB940CAD@gmail.com> 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="31664"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Mar 04 08:06:08 2023 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 1pYLy2-000829-Ss for ged-emacs-devel@m.gmane-mx.org; Sat, 04 Mar 2023 08:06:07 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pYLxd-0000hG-5n; Sat, 04 Mar 2023 02:05:41 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pYLxb-0000h6-BX for emacs-devel@gnu.org; Sat, 04 Mar 2023 02:05:39 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pYLxb-0001ut-1l; Sat, 04 Mar 2023 02:05:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=EOSpkqk2ds2tuWfoFdKrsmy9GDDj8LjVILV7ymfHNws=; b=md5XrBbmZOpqCkSKCxkh iVMrzBtsZURHywOPclrJ05I2/fXg+pPYfsqNOywDQaBKSGFWVxuy58TLyNrd0f5qu+2ZQN1K1CgVz ts+5VL6JxXSz/VNXI2C+tZ47lTOaKzKCMxk7yYLO7Cn0ykjLLSRzdPFgiCANavtD8xyS9sL7775JZ DrYpTcSYtNTL1tM2oZyJTWXTVuL2seCRWPSR9tm6tGI4c1zbdiNtBkCU3DTUOA0qtPnXIh9779XIh oiuHcs6nHRm2qxCCEtVO5hj5G9//9E4v3bD/ymskb0K8mjZY+ew5MI+k9/TUgS777sVvJ9ZpnvQmi WkCGN2HJGsrcSg==; Original-Received: from [87.69.77.57] (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 1pYLxY-0004Ar-I5; Sat, 04 Mar 2023 02:05:38 -0500 In-Reply-To: <5B384B39-F6DD-4E32-8506-A6D2BB940CAD@gmail.com> (message from Yuan Fu on Fri, 3 Mar 2023 14:06:03 -0800) 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:303932 Archived-At: > From: Yuan Fu > Date: Fri, 3 Mar 2023 14:06:03 -0800 > Cc: emacs-devel@gnu.org > > > So please revert those changes, as they go against what is planned for > > Emacs 29. > > > >>> made this even worse: now we have a byte-compilation warning in a > >>> build without tree-sitter, and this code will signal a generic error > >>> (whose text is not very helpful to users) if the file is loaded in a > >>> build without tree-sitter. This is all against the intended behavior > >>> of these modes. > >>> > >>> Again, what problem were you trying to fix with that change? > >> > >> Treesit-ready-p is intended to be used for major modes, so it includes checks for current buffer’s size, which doesn’t make much sense when called when loading the file. But if you intentionally used that function for the warning, I guess there is no harm using it this way, as the default size threshold is rather large. > > > > If we want to avoid the buffer size text in some cases, we can add an > > optional argument to treesit-ready-p, and use it in those places. > > (And I agree that the test is probably harmless anyway.) > > I’ve reverted the change. Thanks.