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.help Subject: Re: Why is jit-lock-stealth-time nil by default? Date: Thu, 17 Feb 2022 09:58:40 +0200 Message-ID: <83h78x2abz.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29633"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Feb 17 09:12:31 2022 Return-path: Envelope-to: geh-help-gnu-emacs@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 1nKbtu-0007XS-Ta for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 17 Feb 2022 09:12:31 +0100 Original-Received: from localhost ([::1]:51610 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nKbtt-0004V5-8w for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 17 Feb 2022 03:12:29 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:44326) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nKbgO-0006HY-TT for help-gnu-emacs@gnu.org; Thu, 17 Feb 2022 02:58:32 -0500 Original-Received: from [2001:470:142:3::e] (port=44292 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nKbgO-0005og-Hp for help-gnu-emacs@gnu.org; Thu, 17 Feb 2022 02:58:32 -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=b+McHU+NpTVwyvju8Tj34ZBKQQfORbbMFsZz5gx9950=; b=ip+2KUQJYs5L S0u/Tx5UR0WYp1kZdGVmJlmbMIUFeAmxOJHOSK26NRGNmWuGshSrFUPE082pZM9CGja0iIHyYYq3U 2JXGiB9bbC9N5WgEKb1Fjaxa627JllbPkEHCcuA2Cn9tpl8uAsceUwJWpnj2EKl2GKvyFDQQB3itk am7qPclyb9Lw5WiAIyV1spFtkXIUwigSI6ouLt1+Di9V/AI1rWzc1sIYygufidawpxIMuClDXxCDM Ztu5fF7jgsfDmPI3F7iRF9sI1LZv/9jD00mJm0oT4jUDRFEmrrz2DaF2IX7zChq4hNPXaNkw+TAeV oeiIo8BYZng+5mepD6X7qw==; Original-Received: from [87.69.77.57] (port=4526 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 1nKbgN-000465-TD for help-gnu-emacs@gnu.org; Thu, 17 Feb 2022 02:58:32 -0500 In-Reply-To: (message from emacsq via Users list for the GNU Emacs text editor on Thu, 17 Feb 2022 06:58:09 +0000) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:135974 Archived-At: > Date: Thu, 17 Feb 2022 06:58:09 +0000 > From: emacsq via Users list for the GNU Emacs text editor > > > That shouldn't happen. Emacs uses a JIT fontification feature, which > > is turned on by default, and which should make sure any part of the > > buffer is always fontified before it is displayed. > > Is it also true for programmatic features, that is if the user himself doesn't visit those parts, only elisp routines go there and show parts of the buffer? E.g. 'peek' features which fetch unvisited parts of a buffer and show them to the user in a tooltip? I thought JIT does not fontificates those parts. JIT fontification works at display time. If a Lisp program shows portions of the buffer in a tooltip, the fontification will still happen when the tooltip is displayed (assuming you don't use GTK tooltips), but it will use the rules according to the major mode of the buffer you show in the tooltip, which will probably be different from what you expect. But note that jit-lock-stealth fontifications will not necessarily solve this problem, because you have no control on the order and the timing of the stealth fontifications. So it could well be that by the time you show some portion of the buffer in a tooltip, stealth fontifications for that part didn't yet happen. If you want to ensure the portion of the buffer you are about to display is fontified, call font-lock-fontify-region or font-lock-ensure just before showing the tooltip.