From 415ed4b42515ff2e6dd9b94e964b479e50c6392e Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 10 Jan 2022 19:10:52 +0200 Subject: [PATCH] Fix 'exchange-point-and-mark' in 'transient-mark-mode' * lisp/simple.el (exchange-point-and-mark): Don't deactivate mark when 'transient-mark-mode' is ON. (Bug#53150) --- lisp/simple.el | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lisp/simple.el b/lisp/simple.el index cbcde9fb8da..c73c94b53ad 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -6664,11 +6664,10 @@ mode temporarily." (user-error "No mark set in this buffer")) (set-mark (point)) (goto-char omark) - (cond ((and (not arg) (not temp-highlight)) - (setq-local transient-mark-mode (cons 'only transient-mark-mode))) - ((xor arg (not (region-active-p))) - (deactivate-mark)) - (t (activate-mark))) + (or temp-highlight + (cond ((xor arg (not (region-active-p))) + (deactivate-mark)) + (t (activate-mark)))) nil)) (defcustom shift-select-mode t -- 2.39.2