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: Major modes using `widen' is a good, even essential, programming practice. Date: Mon, 08 Aug 2022 05:29:45 +0300 Message-ID: <83fsi7wjqe.fsf@gnu.org> References: <6ae35c9306ade07b4c45@heytings.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2252"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, gregory@heytings.org, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Aug 08 04:31:26 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 1oKsY9-0000R0-9T for ged-emacs-devel@m.gmane-mx.org; Mon, 08 Aug 2022 04:31:25 +0200 Original-Received: from localhost ([::1]:40274 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oKsY7-0007QE-LG for ged-emacs-devel@m.gmane-mx.org; Sun, 07 Aug 2022 22:31:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56120) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oKsWp-0006er-GE for emacs-devel@gnu.org; Sun, 07 Aug 2022 22:30:03 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:36248) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oKsWn-0005vF-IT; Sun, 07 Aug 2022 22:30:01 -0400 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=XF+RHtsuv93NXKFxszIHl1mPkPr9pi/idCoK9krpEiM=; b=cpSMfs6X6SsL Fd55mBeT9YnrwFscGeOcvRSXjJipfka8V4M/wDeZVZYKjZwydzkxA8LYVpfUKZwLOBbSbUh+1qMjZ 8vpUFzNuP3puAV1KgbpryZSwwilVD+nFZHiQGdltiu8PokCFz07aFGyfGTS/ZXI9czXRLe030/JCT EN9837RhcSQlhyX4r1t7l6LjaiUPAEn06wnrzVVhX6ysQVpCCyXJSK5QTRPeuRB8SpmMg/VEwd561 fJZAytL1pJo6DmjtorR4sQCNpUyvhexiWsw4BfJhRP3Scu4FKfRwthQF8CJ0miyDHUlrDVtFLOguB NRtufzdEhKkD2RZpedaK9Q==; Original-Received: from [87.69.77.57] (port=4127 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 1oKsWm-00038D-L8; Sun, 07 Aug 2022 22:30:01 -0400 In-Reply-To: (message from Stefan Monnier on Sun, 07 Aug 2022 19:21:32 -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:293240 Archived-At: > From: Stefan Monnier > Cc: Gregory Heytings , emacs-devel@gnu.org > Date: Sun, 07 Aug 2022 19:21:32 -0400 > > Eli Zaretskii [2022-08-07 17:20:52] wrote: > > jit-lock calls the functions with two arguments, BEG and END, and > > expects them to work only on that chunk of text. > > That is not the case: it expects the function to "fontify" *at least* > from BEG to END, but is quite happy to let it fontify more (and the > function can return a value indicating which portion was actually > returned in that case). Furthermore, it's clear that fontification of > BEG..END may need to look at text before BEG (and occasionally beyond > END as well). The intent is clearly that fontifications don't look far beyond these two points, because otherwise the whole design of jit-lock and its invocations during redisplay is basically thrown out the window.