From: Eli Zaretskii Date: Mon, 10 Jan 2022 17:10:52 +0000 (+0200) Subject: Fix 'exchange-point-and-mark' in 'transient-mark-mode' X-Git-Tag: emacs-28.0.92~50 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fe27479cad0d6d1f33605a5185bda0957a7f179b;p=emacs.git 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) (cherry picked from commit 415ed4b42515ff2e6dd9b94e964b479e50c6392e) --- diff --git a/lisp/simple.el b/lisp/simple.el index 2822a4a3c23..1f606556b65 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -6652,11 +6652,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