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: master c69858b3f0: ; * lisp/treesit.el (treesit-ready-p): Guard against empty buffers. Date: Wed, 23 Nov 2022 15:38:03 +0200 Message-ID: <83cz9dzt8k.fsf@gnu.org> References: <166916717199.12853.3816069320355351676@vcs2.savannah.gnu.org> <20221123013252.46814C004B6@vcs2.savannah.gnu.org> <83o7sxzwhn.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11001"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org, casouri@gmail.com To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Nov 23 14:38:34 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 1oxpxR-0002eb-VD for ged-emacs-devel@m.gmane-mx.org; Wed, 23 Nov 2022 14:38:34 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oxpwj-0006H8-Ef; Wed, 23 Nov 2022 08:37:49 -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 1oxpwh-0006Gy-WC for emacs-devel@gnu.org; Wed, 23 Nov 2022 08:37:48 -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 1oxpwg-0000jx-Od; Wed, 23 Nov 2022 08:37:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=0PqD0BL+sl4w7DLgYZKM590arK4QQTH0eEG2jX3NaNY=; b=qE9l3BTStCs5 qus/11vEjq9pHuLZ+YMmcWtxAYIMcVGMSKKypRxZtmS1LricD89LZ5sSqEI22Wa0fhP0N9sswTXoP 6lxTOc9kBpcTRnqgUn0zm9FknfjC/WXG6TMnjqkIHlH6wsgOpQtmeLi5u2StspDOm50gjSVpswU7W PWzFvoHkGMqBTrjn+68K4YPmm5Dhgtju+FtQkI7YXqZIsbPqL54dXay5g1nbLA/CHdG7wbiKcGbN5 SXYkR8kL2sl3RIOKCd9rN2mAvnOW26gV+U+gVjQm7NaVJfsYDumDQ1cR61u8+sLyLN/ESjVaupBzf U0TM2dd35PTc4S+p6xVywg==; 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 1oxpwg-0000Y8-85; Wed, 23 Nov 2022 08:37:46 -0500 In-Reply-To: (message from Stefan Monnier on Wed, 23 Nov 2022 07:40:31 -0500) 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:300392 Archived-At: > From: Stefan Monnier > Cc: emacs-devel@gnu.org, casouri@gmail.com > Date: Wed, 23 Nov 2022 07:40:31 -0500 > > But my question was not so much pointing out a problem but trying to > understand why we chose the more complex code. Because we need to compare with byte positions, and I'm not aware that we have anything like a buffer-size-bytes function. (Do we?) And I didn't feel like adding one, for this simple use case, in a function that is unlikely to be called frequently and/or in some inner loop.