From: Ergus via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 54450@debbugs.gnu.org
Subject: bug#54450: 29.0.50; redisplay--pre-redisplay-functions issue
Date: Fri, 18 Mar 2022 18:42:52 +0100 [thread overview]
Message-ID: <20220318174252.xd33nalq4fdwpkeb@Ergus> (raw)
In-Reply-To: <83sfrffb59.fsf@gnu.org>
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" <bug-gnu-emacs@gnu.org>
>>
>> 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
next prev parent reply other threads:[~2022-03-18 17:42 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <87pmmjw9ru.fsf.ref@aol.com>
2022-03-18 15:38 ` bug#54450: 29.0.50; redisplay--pre-redisplay-functions issue Ergus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-03-18 17:01 ` Eli Zaretskii
2022-03-18 17:42 ` Ergus via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-03-18 18:38 ` Eli Zaretskii
2022-03-18 18:52 ` Ergus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-03-18 19:46 ` Eli Zaretskii
2022-03-18 18:54 ` Eli Zaretskii
2022-03-18 21:25 ` Ergus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-03-19 7:22 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220318174252.xd33nalq4fdwpkeb@Ergus \
--to=bug-gnu-emacs@gnu.org \
--cc=54450@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=spacibba@aol.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.