]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix 'exchange-point-and-mark' in 'transient-mark-mode'
authorEli Zaretskii <eliz@gnu.org>
Mon, 10 Jan 2022 17:10:52 +0000 (19:10 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sun, 13 Feb 2022 13:22:13 +0000 (15:22 +0200)
* lisp/simple.el (exchange-point-and-mark): Don't deactivate mark
when 'transient-mark-mode' is ON.  (Bug#53150)

(cherry picked from commit 415ed4b42515ff2e6dd9b94e964b479e50c6392e)

lisp/simple.el

index 2822a4a3c23d3d6030623fa09708f82aecbb5f6e..1f606556b6595f9b7099cbac0d2467e252b487ed 100644 (file)
@@ -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