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.bugs Subject: bug#71345: Feature: unleash font-lock's secret weapon; handle Qfontified = non-nil Date: Wed, 05 Jun 2024 20:52:42 +0300 Message-ID: <86zfrzi8et.fsf@gnu.org> References: <8A929E16-AF10-4D2B-AD71-AEAD4435F016@gmail.com> <1F2B8726-7594-494F-AB9D-08C48B7BCC43@gmail.com> <798B70AF-69BD-479E-992E-5CE9B4924820@gmail.com> <86o78fk4ye.fsf@gnu.org> <865xunjqfb.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34981"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 71345@debbugs.gnu.org, jdtsmith@gmail.com, dmitry@gutov.dev To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 05 19:54:09 2024 Return-path: Envelope-to: geb-bug-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 1sEupr-0008pT-VT for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 05 Jun 2024 19:54:08 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEupb-0004tO-BN; Wed, 05 Jun 2024 13:53:51 -0400 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 1sEupY-0004se-HI for bug-gnu-emacs@gnu.org; Wed, 05 Jun 2024 13:53:48 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEupY-00039N-8K for bug-gnu-emacs@gnu.org; Wed, 05 Jun 2024 13:53:48 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sEupm-0007gO-93 for bug-gnu-emacs@gnu.org; Wed, 05 Jun 2024 13:54:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 05 Jun 2024 17:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71345 X-GNU-PR-Package: emacs Original-Received: via spool by 71345-submit@debbugs.gnu.org id=B71345.171760998829378 (code B ref 71345); Wed, 05 Jun 2024 17:54:02 +0000 Original-Received: (at 71345) by debbugs.gnu.org; 5 Jun 2024 17:53:08 +0000 Original-Received: from localhost ([127.0.0.1]:52952 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sEuot-0007df-Px for submit@debbugs.gnu.org; Wed, 05 Jun 2024 13:53:08 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:57786) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sEuor-0007cm-Jl for 71345@debbugs.gnu.org; Wed, 05 Jun 2024 13:53:06 -0400 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 1sEuoY-000331-2d; Wed, 05 Jun 2024 13:52:46 -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=Ur6mO/RuFFNTcg9p59xa+FerpkZDLnaNmCQJ9RoYZZc=; b=RHvy1AaFgj3R Tr3C45iHuL5D64NLNq/yano/VD2RxGIrN6+xkmfcTk5WNJPLxNjj7Dein+la1l7zHcLj1bBHUMFTh xVm4ctAVaSAEXwy0o+rGDD76KARxboaFhHbNYnh39Yl8R3lTP2bT8Rw5qwLZj/NZdBDk6kfB+faKN a/71P+9ZPLj6gdXswMkEHIm9zoGJpcKJd9mPyjHHWnSPNI3torVOy1TN513DMoY0q57co0Ibc2IKq DDpjvTCpjHnwDeP1O/bkRYnypizT1zXbHWlYKa7N76ndqGlQjEiOI8M96CE/sCdpwneuHeso4SGe9 s+4Bt058wES6r2hcBamoOQ==; In-Reply-To: (message from Stefan Monnier on Wed, 05 Jun 2024 12:59:08 -0400) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:286631 Archived-At: > From: Stefan Monnier > Cc: jdtsmith@gmail.com, 71345@debbugs.gnu.org, dmitry@gutov.dev > Date: Wed, 05 Jun 2024 12:59:08 -0400 > > >> But the highlighting is done "once and for all" (at least until the next > >> command), so if you want it to be different in different windows (to > >> reflect the different values of `point` in those windows) you'll need > >> overlays with the `window` property because the highlighting will not be > >> re-done in the middle of redisplay when we go from one window to another. > > > > In that case, we are in trouble anyway, because the "once and for all" > > highlighting could be (by sheer luck) be done by display code that > > doesn't run as part of redisplay, but as part of something else, like > > vertical-motion. > > I can't see why that would be a problem. > > The highlighting code run from `jit-lock` will usually not be able to > use `point` (or `window-point`) directly. Instead, that highlighter > will need to keep track of the windows' points elsewhere "manually" via > hooks like `post-command-hook` or `pre-redisplay-functions` and then > rely on that info when performing the highlighting. You say you don't see a problem, but then describe a solution for a problem you don't see? ;-) Yes, if the code run from jit-lock will use some private variable instead of point, it can get away, but such a code will need to be written in an extremely disciplined manner, like nothing else in Emacs (except, perhaps, the inner parts of redisplay code in C), because what is more natural than call functions and APIs under the assumption that point is where it's expected to be?