[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#54450: 29.0.50; redisplay--pre-redisplay-functions issue
From: |
Eli Zaretskii |
Subject: |
bug#54450: 29.0.50; redisplay--pre-redisplay-functions issue |
Date: |
Fri, 18 Mar 2022 19:01:06 +0200 |
> 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. */