]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix updating process-mark position in 'set-process-buffer'
authorEli Zaretskii <eliz@gnu.org>
Sat, 7 Oct 2023 14:58:54 +0000 (17:58 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sat, 7 Oct 2023 14:58:54 +0000 (17:58 +0300)
* src/process.c (update_process_mark): Update marker position only
if P's process-mark is not already associated with P's buffer.
(Bug#66313)

src/process.c

index 5f7408a939513e3e6696150c2231e0ebbe660288..46e57c1a7c21c562dcd33d25e94c44719b3dca03 100644 (file)
@@ -1273,7 +1273,8 @@ static void
 update_process_mark (struct Lisp_Process *p)
 {
   Lisp_Object buffer = p->buffer;
-  if (BUFFERP (buffer))
+  if (BUFFERP (buffer)
+      && XMARKER (p->mark)->buffer != XBUFFER (buffer))
     set_marker_both (p->mark, buffer,
                     BUF_ZV (XBUFFER (buffer)),
                     BUF_ZV_BYTE (XBUFFER (buffer)));