From 8f23a02a9ea1fbc4213cae5664dcb9bf6b5205f6 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 7 Oct 2023 17:58:54 +0300 Subject: [PATCH] Fix updating process-mark position in 'set-process-buffer' * 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/process.c b/src/process.c index 5f7408a9395..46e57c1a7c2 100644 --- a/src/process.c +++ b/src/process.c @@ -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))); -- 2.39.2