GNU bug report logs - #81398
30.1; Cursor jumps to cua global mark after M-x

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Vangelis Evangelou <evangelou@HIDDEN>; dated Sat, 11 Jul 2026 08:15:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 81398 <at> debbugs.gnu.org:


Received: (at 81398) by debbugs.gnu.org; 11 Jul 2026 15:52:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 11 11:52:08 2026
Received: from localhost ([127.0.0.1]:43636 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1wiZzr-0008U4-SW
	for submit <at> debbugs.gnu.org; Sat, 11 Jul 2026 11:52:08 -0400
Received: from mail-lj1-x22c.google.com ([2a00:1450:4864:20::22c]:53601)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <evangelou@HIDDEN>)
 id 1wiZzq-0008TG-Dz
 for 81398 <at> debbugs.gnu.org; Sat, 11 Jul 2026 11:52:07 -0400
Received: by mail-lj1-x22c.google.com with SMTP id
 38308e7fff4ca-39ca0a30148so10501111fa.3
 for <81398 <at> debbugs.gnu.org>; Sat, 11 Jul 2026 08:52:06 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1783785120; cv=none;
 d=google.com; s=arc-20260327;
 b=k18zW/A9vXDK/Do6uXzIVwiuuoFgUOhXtfLn2hG0jDILRe117VqQkp0eAZVfAFhcTU
 z1LMX7JBtXCpYBJryF37KHw+oA5kr0Zpm+4beYDecSQPp+Y6kTRMCR/QLWe109WPm7eJ
 gqDeoDa0J8dJS6lehmDdwjO/RzL32YqCe+stvzyjihSuAneWSnO5dR71ota5IBh+muLJ
 6ubJ0kps3AL9rZsW9eGzJqpZWX0LnB+ljR1KpRdgZYA2SkE+2uw7Ddq1+c15lzLTgIJF
 TEnoP82BKL9QUDA3NLXlZkgRdYBUJw2KEeVX5rgfE4uBCr+Ng5uXHUmjIzP8R7jFQpHn
 zUow==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;
 s=arc-20260327; 
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:dkim-signature;
 bh=8FX4SpoGDnUdZo9uOJVbTy+R/1ll0KsAZrs9vOzywtk=;
 fh=BTdUGsUO1J/CST5U+5MZiVFlw7kuf09egA9n3ZIXKj4=;
 b=a0IL6Ko0gvXCN4EpPAskzEt+sKNCi6JUZvXePc4W4g/LYaCKQZARY9gRnS0lzI9Kl3
 HtxqKSqwd5wOeeewrnX5UJyd1OZIDQJFhcZb6evgtO+5hjvG/04zie30rDuFTqmcX44D
 BJgSE4Thdg6ym78CT69xnfHTRAfK2DHFnPKMH3JLugh8fFqsBnvcH+WGVQPXuCnA+q0C
 6REyJVSHMKSh8SXkmybo3+osiv1uPJBciBi3+10bi1cjNnp3x332KcvPPflPuqyRF+4+
 FbhmOfwCWkXBa9EyTRBVPYYsYyxMUKIneR/OBJObg9kwRZ+WQ8sikZ3Vutzpoyy/ZnFD
 rNRA==; darn=debbugs.gnu.org
ARC-Authentication-Results: i=1; mx.google.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20251104; t=1783785120; x=1784389920; darn=debbugs.gnu.org;
 h=content-type:cc:to:subject:message-id:date:from:in-reply-to
 :references:mime-version:from:to:cc:subject:date:message-id:reply-to
 :content-type; bh=8FX4SpoGDnUdZo9uOJVbTy+R/1ll0KsAZrs9vOzywtk=;
 b=FvQPRgks61un2oxYliuqPnLJu28iZddY73QaIATgi48FWL2lY1OEi1F4cUx0QE9I00
 NsBoBL04XHKtdeHHE9+je4FfC4wM+vWIu5CIZWKXDeIuqrlm3HE7/Ao2So5aIYrs5MCR
 ZyGRKxhCkfUsEUhxXqX7qMrXK6BtP5RL8Yht8wPwVvcG2/2Q8NcImMPa9BSlUGaPd3QX
 Z3fkFTcXF1dgItDRviyN1mF/vzY4hr3gmhE/CodY54N4/R7q4ZGHKZTNf6+7GMkoKZh9
 YnB54iCjyyd3qLKluQp4VGBbTypC5UDmNVXit488hsCbo/Ar2Xi3RVI5xfyFPv9/9cby
 j1HA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20251104; t=1783785120; x=1784389920;
 h=content-type:cc:to:subject:message-id:date:from:in-reply-to
 :references:mime-version:x-gm-gg:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to:content-type;
 bh=8FX4SpoGDnUdZo9uOJVbTy+R/1ll0KsAZrs9vOzywtk=;
 b=KlPx6/FXPUNKH62HjS8PbXdcGzAB1ej5tiGwyYEipMKXJ99Ov0aVjD5h/rhkaRSkxk
 XL+nHyRF69lYmtbLsTLLWaOTfdYcHH4Pg9dH+6Jwg4v/P3m9vr25X8tY0s0dL80HesrC
 zYl1uiSTjf0xCvJg0okLvuS+kTj9KejSdur3mkI6NlXqfLfDIN8p5EpVMBNUdC+orEJd
 petqCTVjRXV1OcEcmKkMDZrBVfRgSjVyB98Mm1Vib454vlV31d14X1xDuN00s3/dFQRO
 RJ1XxsBiWkjo2TAHDg6mzdVKoXZbaOWFhqNZ4KYUCbjLMPTWG0hWyxW4NzRctw2on+oP
 jmwQ==
X-Forwarded-Encrypted: i=1;
 AHgh+Ro/bbDLj7K9oT2PdkngQKT+LJZuj0Nq4bowhr+tliiwV8jr2LsdVeYNdIFYD506IATJC0v8qg==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YwUE7eg4GLMllhMmm2t/9ARwWfJ8cpoQ1ivZKvYzJhFboLZmQUR
 NVYPIO3ZE25zvwDK2f8AoctwXK0ZVTsWwr2zs5lcI7wV2O1elGAHoAanwBkL/KeXxIBnOwdOnTp
 ZmoSSbLqqexQ6mHzmSSTG3sT/GY7luY4=
X-Gm-Gg: AfdE7ckLb4nH+yKS/sn+r7KMWc6Deyv1oCQt9Ue+giTDBU6Ap4KH9wZi1+TmOgACYot
 Z/QFoYncDbjVaYx7PC8HfY/n75/Kkby2ta1RweCa4DdUAQYcSpgxRCocDHEExefQBrt7Pp1nQum
 bI2u+TYWgJXhBCB0Qw38Gt3ncb/XFOXCAsN6JIkxF7mR3xHeS/MjRWAWB9pIHjw+JNIDEaXkVam
 38UB3DTBB6yQwY+932MONTq3/1oQcNlEjI2apl2l+4kK5SLJ7DKqrbRSlvowJtHb49SqJiSqDVG
 VlH9F0a82eiAu0lwzXoy8DXEHqU9
X-Received: by 2002:a05:651c:1584:b0:39c:699b:22b6 with SMTP id
 38308e7fff4ca-39caa139391mr5821801fa.18.1783785119627; Sat, 11 Jul 2026
 08:51:59 -0700 (PDT)
MIME-Version: 1.0
References: <CAD1AF2ey+HS2Kpd98CvscKa4Qa30-bV9ktaXc1wpw5ufGAmNQw@HIDDEN>
 <86ech9ixxq.fsf@HIDDEN>
In-Reply-To: <86ech9ixxq.fsf@HIDDEN>
From: Vangelis Evangelou <evangelou@HIDDEN>
Date: Sat, 11 Jul 2026 16:51:48 +0100
X-Gm-Features: AVVi8Ce9z_bqRvmryiyWAVFIJ8pohm5UkKi2-Fr-Fvqe8lyVus_Sh6akljWdT3Y
Message-ID: <CAD1AF2fRVov9q7bubEyXWg2+YrKVJrup0-fx6N-kHth8Dkt=mA@HIDDEN>
Subject: Re: bug#81398: 30.1; Cursor jumps to cua global mark after M-x
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000693d6c065657d6dc"
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 81398
Cc: 81398 <at> debbugs.gnu.org, Stefan Monnier <monnier@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

--000000000000693d6c065657d6dc
Content-Type: text/plain; charset="UTF-8"

Hi Eli.

OK, thanks for explaining the process.

> Btw, why did you expect point to remain in its place?

I was based on my experience. In all other cases M-x does not move the
buffer's cursor.

> My personal conclusion from this is that you should expect that, and
> not keep the Global Mark active for prolonged periods of time to begin
> with.

Understood. My original intension was to call a custom kill-ring-save-mine
function which I hadn't bound to a key. I felt obliged to report this (to
me) unexpected behaviour.

On Sat, 11 Jul 2026 at 12:10, Eli Zaretskii <eliz@HIDDEN> wrote:

> > From: Vangelis Evangelou <evangelou@HIDDEN>
> > Date: Sat, 11 Jul 2026 09:13:40 +0100
> >
> > 1. Start with emacs -q
> > 2. Enable cua-mode with M-x cua-mode
> > 3. Switch to the scratch buffer. Cursor will be on line 4.
> > 4. Activate the cua global mark with C-S-SPC.
> > 5. Move the cursor to line 1.
> > 6. Type M-x
> >
> > What happens: The cursor moves to the position of the cua global mark.
> >
> > What should happen: The cursor stays where it was.
>
> AFAICT, it's a (mis)feature.  When the CUA Global Mark is active,
> Emacs forces point in the mark's buffer to return to the mark after
> every command, evidently to keep the Global Mark visible and centered
> at all times (which kinda makes sense, since everything you type and
> copy/paste while the mark is active happens at the Global Mark's
> position).  This is done by adding to post-command-hook a CUA function
> that does:
>
>         (let ((w (selected-window)) (p (point)) h)
>           ;; The following code is an attempt to keep the global mark
> visible in
>           ;; other window -- but it doesn't work.
>           (switch-to-buffer-other-window (marker-buffer
> cua--global-mark-marker) t)
>           (goto-char (marker-position cua--global-mark-marker))
> <<<<<<<<<<<<<
>           (if (not (pos-visible-in-window-p (marker-position
> cua--global-mark-marker)))
>               (recenter (if (> (setq h (- (window-height) 4)) 1) h '(4))))
>           (select-window w)
>           (goto-char p)))))
>
> And since entering the minibuffer re-enters the command loop, typing
> M-x runs the post-command-hook (because it calls read-from-minibuffer,
> which enters the minibuffer via a variant of recursive-edit), whose
> effect is to return point to the position of the Global Mark, as shown
> above.
>
> AFAIU, it is not easy to distinguish between M-x and other uses of
> read-from-minibuffer.  We could perhaps disable this "return to mark"
> behavior for _all_ uses of the minibuffer, but I'm not sure this is a
> good idea, given the purpose of this feature.
>
> My personal conclusion from this is that you should expect that, and
> not keep the Global Mark active for prolonged periods of time to begin
> with.  But maybe others will have other ideas or suggestions.
>
> Btw, why did you expect point to remain in its place?  AFAICS, all
> versions of Emacs behaved like this -- did you see a different
> behavior in some previous release?
>

--000000000000693d6c065657d6dc
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hi Eli.</div><div><br></div><div>OK, thanks for expla=
ining the process.=C2=A0</div><div><br></div><div>&gt; Btw, why did you exp=
ect point to remain in its place?=C2=A0</div><div><br></div><div>I was base=
d on my experience. In all other cases M-x does not move the buffer&#39;s c=
ursor.</div><div><br></div><div>&gt;=C2=A0My personal conclusion from this =
is that you should expect that, and<br>&gt; not keep the Global Mark active=
 for prolonged periods of time to begin<br>&gt; with.=C2=A0</div><div><br><=
/div><div>Understood. My original intension was to call a custom kill-ring-=
save-mine function which I hadn&#39;t bound to a key. I felt obliged to rep=
ort this (to me) unexpected behaviour.</div></div><br><div class=3D"gmail_q=
uote gmail_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">On Sat, 1=
1 Jul 2026 at 12:10, Eli Zaretskii &lt;<a href=3D"mailto:eliz@HIDDEN">eliz=
@gnu.org</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D=
"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-le=
ft:1ex">&gt; From: Vangelis Evangelou &lt;<a href=3D"mailto:evangelou@gmail=
.com" target=3D"_blank">evangelou@HIDDEN</a>&gt;<br>
&gt; Date: Sat, 11 Jul 2026 09:13:40 +0100<br>
&gt; <br>
&gt; 1. Start with emacs -q<br>
&gt; 2. Enable cua-mode with M-x cua-mode<br>
&gt; 3. Switch to the scratch buffer. Cursor will be on line 4.<br>
&gt; 4. Activate the cua global mark with C-S-SPC.<br>
&gt; 5. Move the cursor to line 1.<br>
&gt; 6. Type M-x<br>
&gt; <br>
&gt; What happens: The cursor moves to the position of the cua global mark.=
<br>
&gt; <br>
&gt; What should happen: The cursor stays where it was.<br>
<br>
AFAICT, it&#39;s a (mis)feature.=C2=A0 When the CUA Global Mark is active,<=
br>
Emacs forces point in the mark&#39;s buffer to return to the mark after<br>
every command, evidently to keep the Global Mark visible and centered<br>
at all times (which kinda makes sense, since everything you type and<br>
copy/paste while the mark is active happens at the Global Mark&#39;s<br>
position).=C2=A0 This is done by adding to post-command-hook a CUA function=
<br>
that does:<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (let ((w (selected-window)) (p (point)) h)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; The following code is an attempt to k=
eep the global mark visible in<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; other window -- but it doesn&#39;t wo=
rk.<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (switch-to-buffer-other-window (marker-b=
uffer cua--global-mark-marker) t)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (goto-char (marker-position cua--global-=
mark-marker))=C2=A0 &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;<br=
>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (not (pos-visible-in-window-p (marke=
r-position cua--global-mark-marker)))<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (recenter (if (&gt; (setq =
h (- (window-height) 4)) 1) h &#39;(4))))<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (select-window w)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (goto-char p)))))<br>
<br>
And since entering the minibuffer re-enters the command loop, typing<br>
M-x runs the post-command-hook (because it calls read-from-minibuffer,<br>
which enters the minibuffer via a variant of recursive-edit), whose<br>
effect is to return point to the position of the Global Mark, as shown<br>
above.<br>
<br>
AFAIU, it is not easy to distinguish between M-x and other uses of<br>
read-from-minibuffer.=C2=A0 We could perhaps disable this &quot;return to m=
ark&quot;<br>
behavior for _all_ uses of the minibuffer, but I&#39;m not sure this is a<b=
r>
good idea, given the purpose of this feature.<br>
<br>
My personal conclusion from this is that you should expect that, and<br>
not keep the Global Mark active for prolonged periods of time to begin<br>
with.=C2=A0 But maybe others will have other ideas or suggestions.<br>
<br>
Btw, why did you expect point to remain in its place?=C2=A0 AFAICS, all<br>
versions of Emacs behaved like this -- did you see a different<br>
behavior in some previous release?<br>
</blockquote></div>

--000000000000693d6c065657d6dc--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#81398; Package emacs. Full text available.

Message received at 81398 <at> debbugs.gnu.org:


Received: (at 81398) by debbugs.gnu.org; 11 Jul 2026 11:10:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 11 07:10:52 2026
Received: from localhost ([127.0.0.1]:40558 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1wiVbg-0001WW-90
	for submit <at> debbugs.gnu.org; Sat, 11 Jul 2026 07:10:52 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:46636)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1wiVbe-0001W8-ID
 for 81398 <at> debbugs.gnu.org; Sat, 11 Jul 2026 07:10:51 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1wiVbY-0004Xa-Q6; Sat, 11 Jul 2026 07:10:44 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=pE6QOHaRsqxIOWxR6gvFGb+KlfGJLQIrY84Ry9JTt7Y=; b=PeBBpuvs7u83
 Jq3AW1v9YrXk9GEe6F/4CQg18+DUI5lzu3v7BebZ4uHRZgAibxoGtw7RvzbBiaXRn3VNB7TFLRrAB
 5gZIfCgAy1BaAFDUk0DrC45pFeyp26XdL4BNxRVjmPjjCO+NXtoEypjLj5/I17m8CJuhKhXU6kIJT
 F1x2DmJpjW4cZA1fkvbwED7MAJ7qmcSRiTlqMwYlmxunpKy7pSZw87ilYSsUokl9Gzzjd/LcG2QhL
 QFwr+t1L2cmlgTht/e2De58y7zGXJAiH11sbOvaEhPpR6K4fx/QS1C2qvnsjtV36EUAxIOle0qXea
 iQVaXXLKms4Z+mrLCLfgOQ==;
Date: Sat, 11 Jul 2026 14:10:41 +0300
Message-Id: <86ech9ixxq.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Vangelis Evangelou <evangelou@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>
In-Reply-To: <CAD1AF2ey+HS2Kpd98CvscKa4Qa30-bV9ktaXc1wpw5ufGAmNQw@HIDDEN>
 (message from Vangelis Evangelou on Sat, 11 Jul 2026 09:13:40 +0100)
Subject: Re: bug#81398: 30.1; Cursor jumps to cua global mark after M-x
References: <CAD1AF2ey+HS2Kpd98CvscKa4Qa30-bV9ktaXc1wpw5ufGAmNQw@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 81398
Cc: 81398 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Vangelis Evangelou <evangelou@HIDDEN>
> Date: Sat, 11 Jul 2026 09:13:40 +0100
> 
> 1. Start with emacs -q
> 2. Enable cua-mode with M-x cua-mode
> 3. Switch to the scratch buffer. Cursor will be on line 4.
> 4. Activate the cua global mark with C-S-SPC.
> 5. Move the cursor to line 1.
> 6. Type M-x
> 
> What happens: The cursor moves to the position of the cua global mark.
> 
> What should happen: The cursor stays where it was.

AFAICT, it's a (mis)feature.  When the CUA Global Mark is active,
Emacs forces point in the mark's buffer to return to the mark after
every command, evidently to keep the Global Mark visible and centered
at all times (which kinda makes sense, since everything you type and
copy/paste while the mark is active happens at the Global Mark's
position).  This is done by adding to post-command-hook a CUA function
that does:

	(let ((w (selected-window)) (p (point)) h)
	  ;; The following code is an attempt to keep the global mark visible in
	  ;; other window -- but it doesn't work.
	  (switch-to-buffer-other-window (marker-buffer cua--global-mark-marker) t)
	  (goto-char (marker-position cua--global-mark-marker))  <<<<<<<<<<<<<
	  (if (not (pos-visible-in-window-p (marker-position cua--global-mark-marker)))
	      (recenter (if (> (setq h (- (window-height) 4)) 1) h '(4))))
	  (select-window w)
	  (goto-char p)))))

And since entering the minibuffer re-enters the command loop, typing
M-x runs the post-command-hook (because it calls read-from-minibuffer,
which enters the minibuffer via a variant of recursive-edit), whose
effect is to return point to the position of the Global Mark, as shown
above.

AFAIU, it is not easy to distinguish between M-x and other uses of
read-from-minibuffer.  We could perhaps disable this "return to mark"
behavior for _all_ uses of the minibuffer, but I'm not sure this is a
good idea, given the purpose of this feature.

My personal conclusion from this is that you should expect that, and
not keep the Global Mark active for prolonged periods of time to begin
with.  But maybe others will have other ideas or suggestions.

Btw, why did you expect point to remain in its place?  AFAICS, all
versions of Emacs behaved like this -- did you see a different
behavior in some previous release?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#81398; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 11 Jul 2026 08:14:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 11 04:14:11 2026
Received: from localhost ([127.0.0.1]:39262 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1wiSqg-0006pu-QT
	for submit <at> debbugs.gnu.org; Sat, 11 Jul 2026 04:14:11 -0400
Received: from lists1p.gnu.org ([2001:470:142::17]:34566)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <evangelou@HIDDEN>)
 id 1wiSqb-0006p1-Tq
 for submit <at> debbugs.gnu.org; Sat, 11 Jul 2026 04:14:08 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <evangelou@HIDDEN>)
 id 1wiSqT-00010Q-4p
 for bug-gnu-emacs@HIDDEN; Sat, 11 Jul 2026 04:13:57 -0400
Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <evangelou@HIDDEN>)
 id 1wiSqQ-0000nU-VR
 for bug-gnu-emacs@HIDDEN; Sat, 11 Jul 2026 04:13:56 -0400
Received: by mail-lf1-x12a.google.com with SMTP id
 2adb3069b0e04-5b015b2d792so1813251e87.3
 for <bug-gnu-emacs@HIDDEN>; Sat, 11 Jul 2026 01:13:53 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1783757632; cv=none;
 d=google.com; s=arc-20260327;
 b=DwrZxkmv0AUUzpbhGI+Mf4/wt+AhMP05D3vpHzai0fvM6qF5V2KPEHhRIUtDGIteAs
 PHFWvF5FKGsJKFjsvD10m3RfiwItWrYkggPdGgYPKNbVyi+fSDM399C6bwBbjI9P55y0
 X/utDfx8bdAalbsvFjdinIMkZ9DTUmVERDKoj+0Bglz3MG14F1mbsQhToR6GmXGDLIzf
 r9TFjrdFYUpminN9mMYgrmU/d8rdMHTWaic24lj6cYMQ2c+8Gg7zgEthbGguaqANDCX6
 QZKNHdUrIOGQ/4raBcDCORNR7dCHT0fTwWeVR6gg14HPvm8IOO9YZ5VT91aED6hE2jOF
 d6kA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;
 s=arc-20260327; 
 h=to:subject:message-id:date:from:mime-version:dkim-signature;
 bh=bEFUhMw7li56MDylN1USWpxVR9xV7OzYKKEkjG5W0iA=;
 fh=+R8aXOFVnuBbN1nRXJJI02Ia//JUQJmLW/Uk/VaA0ag=;
 b=UCT0cTkKy5ucto4IBVKHEYWibitznX1eKIelOqSBnCVOB3VQGfbIfc0pxSwZ7IYUo9
 48TFbdzz0gmohBLhTyDI/kyj16RSqGbfGdHkFSp4dqvF9xmVKpvhNi3jScEuC7qytJQb
 TI9XcSoTpM9ttDdgpERi52qhzXGj+kXNlV5+v3SVXrhyW45Nasadwr9jTjMlPRl9XcLj
 4EFXfiea4npn86brhjZVaVFlkYww2uMYc2wusQyMnPCR0TiBkn00wGGMnUFtmsyYOc2e
 crBVTFsODUkrAWrICB8Q9rCe6sgGNo2xMz7d86UAsQ7VZhHbQDn5FKfLTmDtN/LHeMlV
 MVBg==; darn=gnu.org
ARC-Authentication-Results: i=1; mx.google.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20251104; t=1783757632; x=1784362432; darn=gnu.org;
 h=content-type:to:subject:message-id:date:from:mime-version:from:to
 :cc:subject:date:message-id:reply-to:content-type;
 bh=bEFUhMw7li56MDylN1USWpxVR9xV7OzYKKEkjG5W0iA=;
 b=LuvD5FZhuhZFaGpyWT8waUvtSXtIP3GNGXtJnDolfS3VMtE5MPJR+SCPAN4K0hNULI
 ps9QDhBWmc+S6/BmBgvmY0QR9492C7mVoveFtvW9JdHfOfzbrzU5WLTxe+RyGTKkcTP7
 cjCgChVCd5ane7BzDfOPgHH/W5+47CWZXAS19+7lsY8fGL+MRuUrcQ6ykeoV3Z7uj2P2
 f2LGJfeErtrHWPvX61R7GqayGrM8H3SytAhsLRI7DUg08pvUdufJ0H6Wltx5l7y4mR/S
 rv41IQkwnTUrq6HvOW911poAbEIgwImayeNDFcc5V8T+FfC36xreXZ9dcdz8eOXWouCj
 SDCQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20251104; t=1783757632; x=1784362432;
 h=content-type:to:subject:message-id:date:from:mime-version:x-gm-gg
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
 :content-type;
 bh=bEFUhMw7li56MDylN1USWpxVR9xV7OzYKKEkjG5W0iA=;
 b=iwaQybxfBC3duUUg0MkK61QC8YRdzsVxWv6675lbfkQPV2kuG2MtFX/yB4PqtA7njU
 fGRa9RYtYqLFo1Q85XVi13NZfV6tlM4sCDS4d7iK0pemJBsOA1JISxswiI9goiI8mbnn
 llkty4A6LeRflZcZzGyL88hUhH/anB64EXVgsYKbBGBnHrcJxm/snJ6ahvf17FVdktkH
 LBzeEgcBX9R3wb6VMTw80Ruvtndbs9v3x7aoK1rRZaBYTPPfGkA6OXwhFm8nf+fBw5MQ
 BW7ivg8XcumxhKcXeZl4jxlNPxeXdejz6Ot0IoJqV4nO12qslUlufXMdMV2JitkfGtzR
 cd1A==
X-Gm-Message-State: AOJu0YyMtYl5y0IfClrJG4XsgOADnDVqfrZKpcZr2x8o0dmqEuK5D07j
 LOazzF2kbqtQh9V6vFwFJRfQoDxnJ4P18qvAGHYhJQa6ASt1GynSUOIaM3rc0GNDKcSVq9db1LB
 qWnxV6xqRoste9xlGywxWhdQWC5GL0wA3QBCf
X-Gm-Gg: AfdE7cln8t+6USfVTeO024gqPD0Cpm1qg9WuyNCJjXo6NsChE7Fwurh/C41CXbTr31x
 hf8HL/np0qtVWiNuOVTsTErgaa7/FfTogw6W7Htp3PtwRDuoDEFoTmPkzNZOaYrqrXPNwy2EZUv
 MjVMwG5bZbiZ1nPXMVm8djW2WVO/iN5vGNOmXfOMDRKIGD7uuv+4ApgYSZ88RUtNXK90ZioUUt5
 HompI0sseQ+6VJn2+2hSvMTm9Tadj2ZBJyjnoHN8I4zylEjfhyf6K5/FSHEHSVCaIQeb/OmSQ6T
 RV69cq4sE9UcrkLzkUipbj79OgOI
X-Received: by 2002:a05:6512:40c1:20b0:5b0:172f:2ef3 with SMTP id
 2adb3069b0e04-5b02369b48bmr335272e87.38.1783757632118; Sat, 11 Jul 2026
 01:13:52 -0700 (PDT)
MIME-Version: 1.0
From: Vangelis Evangelou <evangelou@HIDDEN>
Date: Sat, 11 Jul 2026 09:13:40 +0100
X-Gm-Features: AVVi8CdSg9wqSRP7k1uZklWRJxbohdFF0Wkdm4iX4TNUuct_JCHXGq-DDOjZPhI
Message-ID: <CAD1AF2ey+HS2Kpd98CvscKa4Qa30-bV9ktaXc1wpw5ufGAmNQw@HIDDEN>
Subject: 30.1; Cursor jumps to cua global mark after M-x
To: bug-gnu-emacs@HIDDEN
Content-Type: multipart/alternative; boundary="00000000000007255006565170da"
Received-SPF: pass client-ip=2a00:1450:4864:20::12a;
 envelope-from=evangelou@HIDDEN; helo=mail-lf1-x12a.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 2.0 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview: 1. Start with emacs -q 2. Enable cua-mode with M-x cua-mode
 3. Switch to the scratch buffer. Cursor will be on line 4. 4. Activate the
 cua global mark with C-S-SPC. 5. Move the cursor to line 1. 6. Ty [...] 
 Content analysis details:   (2.0 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (evangelou[at]gmail.com)
 1.0 FORGED_GMAIL_RCVD      'From' gmail.com does not match 'Received'
 headers
 1.0 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [2001:470:142:0:0:0:0:17 listed in] [list.dnswl.org]
 0.0 HTML_MESSAGE           BODY: HTML included in message
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)

--00000000000007255006565170da
Content-Type: text/plain; charset="UTF-8"

1. Start with emacs -q
2. Enable cua-mode with M-x cua-mode
3. Switch to the scratch buffer. Cursor will be on line 4.
4. Activate the cua global mark with C-S-SPC.
5. Move the cursor to line 1.
6. Type M-x

What happens: The cursor moves to the position of the cua global mark.

What should happen: The cursor stays where it was.


In GNU Emacs 30.1 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo
 version 1.18.0, Xaw scroll bars) of 2025-02-23 built on ublt-ee224
Windowing system distributor 'The X.Org Foundation', version 11.0.12101011
System Description: Linux Mint 22.3

Configured using:
 'configure --without-pop --without-kerberos --without-kerberos5
 --without-hesiod --without-mail-unlink --without-mailhost
 --with-x-toolkit=lucid --with-file-notification=inotify --with-x
 --with-modules --with-json --with-xft'

Configured features:
CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG LCMS2
LIBSELINUX LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND
SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM
XINPUT2 XPM LUCID ZLIB

Important settings:
  value of $LC_TIME: en_GB.utf8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  delete-selection-mode: t
  cua-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  minibuffer-regexp-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util text-property-search time-date subr-x mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils cua-gmrk cua-rect rect cus-start cus-load delsel
cua-base rmc iso-transl tooltip cconv eldoc paren electric uniquify
ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win
term/common-win x-dnd touch-screen tool-bar dnd fontset image regexp-opt
fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode
register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting cairo x-toolkit xinput2 x multi-tty move-toolbar
make-network-process emacs)

Memory information:
((conses 16 52213 35037) (symbols 48 6722 0) (strings 32 15994 1397)
 (string-bytes 1 359479) (vectors 16 10005)
 (vector-slots 8 115297 7434) (floats 8 28 1) (intervals 56 266 0)
 (buffers 992 11))

--00000000000007255006565170da
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">1. Start with emacs -q<br>2. Enable cua-mode with M-x cua-=
mode<br>3. Switch to the scratch buffer. Cursor will be on line 4.<br>4. Ac=
tivate the cua global mark with C-S-SPC.<br>5. Move the cursor to line 1.<b=
r>6. Type M-x<br><br>What happens: The cursor moves to the position of the =
cua global mark.<br><br>What should happen: The cursor stays where it was.<=
br><br><br>In GNU Emacs 30.1 (build 1, x86_64-pc-linux-gnu, X toolkit, cair=
o<br>=C2=A0version 1.18.0, Xaw scroll bars) of 2025-02-23 built on ublt-ee2=
24<br>Windowing system distributor &#39;The X.Org Foundation&#39;, version =
11.0.12101011<br>System Description: Linux Mint 22.3<br><br>Configured usin=
g:<br>=C2=A0&#39;configure --without-pop --without-kerberos --without-kerbe=
ros5<br>=C2=A0--without-hesiod --without-mail-unlink --without-mailhost<br>=
=C2=A0--with-x-toolkit=3Dlucid --with-file-notification=3Dinotify --with-x<=
br>=C2=A0--with-modules --with-json --with-xft&#39;<br><br>Configured featu=
res:<br>CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG LCM=
S2<br>LIBSELINUX LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SO=
UND<br>SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE X=
IM<br>XINPUT2 XPM LUCID ZLIB<br><br>Important settings:<br>=C2=A0 value of =
$LC_TIME: en_GB.utf8<br>=C2=A0 value of $LANG: en_US.UTF-8<br>=C2=A0 locale=
-coding-system: utf-8-unix<br><br>Major mode: Lisp Interaction<br><br>Minor=
 modes in effect:<br>=C2=A0 delete-selection-mode: t<br>=C2=A0 cua-mode: t<=
br>=C2=A0 tooltip-mode: t<br>=C2=A0 global-eldoc-mode: t<br>=C2=A0 eldoc-mo=
de: t<br>=C2=A0 show-paren-mode: t<br>=C2=A0 electric-indent-mode: t<br>=C2=
=A0 mouse-wheel-mode: t<br>=C2=A0 tool-bar-mode: t<br>=C2=A0 menu-bar-mode:=
 t<br>=C2=A0 file-name-shadow-mode: t<br>=C2=A0 global-font-lock-mode: t<br=
>=C2=A0 font-lock-mode: t<br>=C2=A0 blink-cursor-mode: t<br>=C2=A0 minibuff=
er-regexp-mode: t<br>=C2=A0 line-number-mode: t<br>=C2=A0 indent-tabs-mode:=
 t<br>=C2=A0 transient-mark-mode: t<br>=C2=A0 auto-composition-mode: t<br>=
=C2=A0 auto-encryption-mode: t<br>=C2=A0 auto-compression-mode: t<br><br>Lo=
ad-path shadows:<br>None found.<br><br>Features:<br>(shadow sort mail-extr =
emacsbug message mailcap yank-media puny dired<br>dired-loaddefs rfc822 mml=
 mml-sec password-cache epa derived epg rfc6068<br>epg-config gnus-util tex=
t-property-search time-date subr-x mm-decode<br>mm-bodies mm-encode mail-pa=
rse rfc2231 mailabbrev gmm-utils mailheader<br>cl-loaddefs cl-lib sendmail =
rfc2047 rfc2045 ietf-drums mm-util<br>mail-prsvr mail-utils cua-gmrk cua-re=
ct rect cus-start cus-load delsel<br>cua-base rmc iso-transl tooltip cconv =
eldoc paren electric uniquify<br>ediff-hook vc-hooks lisp-float-type elisp-=
mode mwheel term/x-win x-win<br>term/common-win x-dnd touch-screen tool-bar=
 dnd fontset image regexp-opt<br>fringe tabulated-list replace newcomment t=
ext-mode lisp-mode prog-mode<br>register page tab-bar menu-bar rfn-eshadow =
isearch easymenu timer select<br>scroll-bar mouse jit-lock font-lock syntax=
 font-core term/tty-colors<br>frame minibuffer nadvice seq simple cl-generi=
c indonesian philippine<br>cham georgian utf-8-lang misc-lang vietnamese ti=
betan thai tai-viet lao<br>korean japanese eucjp-ms cp51932 hebrew greek ro=
manian slovak czech<br>european ethiopic indian cyrillic chinese composite =
emoji-zwj charscript<br>charprop case-table epa-hook jka-cmpr-hook help abb=
rev obarray oclosure<br>cl-preloaded button loaddefs theme-loaddefs faces c=
us-face macroexp<br>files window text-properties overlay sha1 md5 base64 fo=
rmat env<br>code-pages mule custom widget keymap hashtable-print-readable b=
ackquote<br>threads dbusbind inotify lcms2 dynamic-setting system-font-sett=
ing<br>font-render-setting cairo x-toolkit xinput2 x multi-tty move-toolbar=
<br>make-network-process emacs)<br><br>Memory information:<br>((conses 16 5=
2213 35037) (symbols 48 6722 0) (strings 32 15994 1397)<br>=C2=A0(string-by=
tes 1 359479) (vectors 16 10005)<br>=C2=A0(vector-slots 8 115297 7434) (flo=
ats 8 28 1) (intervals 56 266 0)<br>=C2=A0(buffers 992 11))<br><br></div>

--00000000000007255006565170da--




Acknowledgement sent to Vangelis Evangelou <evangelou@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#81398; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 11 Jul 2026 16:00:05 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.