From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ergus via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#54450: 29.0.50; redisplay--pre-redisplay-functions issue Date: Fri, 18 Mar 2022 18:42:52 +0100 Message-ID: <20220318174252.xd33nalq4fdwpkeb@Ergus> References: <87pmmjw9ru.fsf.ref@aol.com> <87pmmjw9ru.fsf@aol.com> <83sfrffb59.fsf@gnu.org> Reply-To: Ergus Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9476"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 54450@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 18 18:45:40 2022 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 1nVGfT-0002JQ-HY for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 18 Mar 2022 18:45:40 +0100 Original-Received: from localhost ([::1]:57610 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nVGfS-0001BC-Fz for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 18 Mar 2022 13:45:38 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:51472) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVGdv-00005l-2u for bug-gnu-emacs@gnu.org; Fri, 18 Mar 2022 13:44:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36189) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nVGdt-0003ZH-Th for bug-gnu-emacs@gnu.org; Fri, 18 Mar 2022 13:44:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nVGdt-00064l-SK for bug-gnu-emacs@gnu.org; Fri, 18 Mar 2022 13:44:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ergus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 18 Mar 2022 17:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54450 X-GNU-PR-Package: emacs Original-Received: via spool by 54450-submit@debbugs.gnu.org id=B54450.164762542323322 (code B ref 54450); Fri, 18 Mar 2022 17:44:01 +0000 Original-Received: (at 54450) by debbugs.gnu.org; 18 Mar 2022 17:43:43 +0000 Original-Received: from localhost ([127.0.0.1]:58319 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nVGdb-000646-3M for submit@debbugs.gnu.org; Fri, 18 Mar 2022 13:43:43 -0400 Original-Received: from sonic316-11.consmr.mail.bf2.yahoo.com ([74.6.130.121]:46650) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nVGdZ-00063o-8u for 54450@debbugs.gnu.org; Fri, 18 Mar 2022 13:43:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1647625415; bh=c83qPuSpMaQmELkeJmXuv2wo2H3JgyBs2eUnw+m/sZc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject:Reply-To; b=QZlWoVBBbeyG7GGYqLLF/2sYe1TAM7r5C5iLVc/HxK5IsAT9dnfkO5QhhrrKBSp7P7qdYKFbNy4sYrsPsth2gXDdl6x7fmlrnwlx90tWzwGWlZws4WnuP53E7oR5k0MK52dkDRSUfC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eXtiSqmhTe H5moc8BvFya0GHqXuf6.CyVt9VDYcu0XKosHIBxOu.hlOgoZEw6L4XIppYyCAbDNGLnf9vvSbkiD Ktw1lAMPWjJ0JrtVhZClkc8NtxVu0MOMSBjwpmf6JjWtPGsbiWM0eiytcG.6qGGnzNwmmYA4G73i yhJOfEmHFL.RQI8hR6EOSIg6xljLIqbI3RLRBn7pw6qlVlegQd87EHap1cuQgFAJH_PTosWA8upv PttC9Pd7dvkd3zmRC5oApKQQdVY_5DI84pUtHcJosLUPID39Rgzq23WZx0J6lKAO0f.BO_a.djzA _PE6mX1VX15mwMQ_s9FlAATaXR1ehnqpKYyQOgbJ3OksBms3ufiRSevcqicbXlB2Bl_1B6RfGZL3 Ugv9gAtH58DzdcdEmYjTFKt_KkuTedxW7VX1DZY16zmLv7vJ_8PNs7HfJ2uQ1fvmDJVo74odnLel b2LI4CEmXJ2q9awQnVPW_Rzxgq2vYNeRX742S5PbXJ X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic316.consmr.mail.bf2.yahoo.com with HTTP; Fri, 18 Mar 2022 17:43:35 +0000 Original-Received: by kubenode516.mail-prod1.omega.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID ce09f371247bee45f0322e84e3d9edc1; Fri, 18 Mar 2022 17:43:32 +0000 (UTC) Content-Disposition: inline In-Reply-To: <83sfrffb59.fsf@gnu.org> X-Mailer: WebService/1.1.19894 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol 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" Xref: news.gmane.io gmane.emacs.bugs:228564 Archived-At: On Fri, Mar 18, 2022 at 07:01:06PM +0200, Eli Zaretskii wrote: >> Date: Fri, 18 Mar 2022 16:38:45 +0100 >> From: Ergus via "Bug reports for GNU Emacs, >> the Swiss army knife of text editors" >> >> emacs -Q >> (setq highlight-nonselected-windows t) >> >> C-x 2 >> C-x o >> C-x C-f /tmp/test >> (insert some text) >> C-a C-SPC C-f C-f C-f >> C-x o >> >> [at this point we should see a region highlighted over the 3 first >> letters of the inserted text in the other winfow buffer (test)] >> >> then eval this several times: >> >> (with-selected-window (get-buffer-window "test" 0) >> (right-char)) >> >> This will move the point in the test window, but the region won't be >> updated. > >Thanks. Does the patch below solve the problem? > >diff --git a/src/intervals.c b/src/intervals.c >index 687b237..cbcc100 100644 >--- a/src/intervals.c >+++ b/src/intervals.c >@@ -44,6 +44,7 @@ > #include "lisp.h" > #include "intervals.h" > #include "buffer.h" >+#include "window.h" > #include "puresize.h" > #include "keymap.h" > >@@ -1885,6 +1886,11 @@ set_point_both (ptrdiff_t charpos, ptrdiff_t bytepos) > return; > } > >+ if (highlight_nonselected_windows >+ && !NILP (Vtransient_mark_mode) >+ && !NILP (BVAR (current_buffer, mark_active))) >+ bset_redisplay (current_buffer); >+ > /* Set TO to the interval containing the char after CHARPOS, > and TOPREV to the interval containing the char before CHARPOS. > Either one may be null. They may be equal. */ Hi Eli: Yes, this could solve the issue for the region, but not in general for redisplay--update-cursor-face-highlight which was the initial problem with Juri's code. Same for any other function that goes into the pre-redisplay-functions hook. The region example reported in this issue was only the simplest way I found to give you a simple reproducible snippet, but the issue is a bit more general. With the cursor-face we may have a similar issue cause such hook works in the same way, so this condition will need to be extended and extended and extended on every case for every function in pre-redisplay-functions hook. else For Juri's code maybe there is a way that he can explicitly do bset_redisplay at the end of the with-selected-window? Does it makes sense? Best, Ergus