diff lisp/mouse.el @ 109965:aa6b00b4471c

Avoid clobbering primary selection when switching frames (Bug#6872). * lisp/mouse.el (mouse-yank-primary): Avoid setting primary when deactivating the mark (Bug#6872). * src/keyboard.c (command_loop_1): Don't set primary selection during handle-switch-frame (Bug#6872).
author Chong Yidong <cyd@stupidchicken.com>
date Tue, 24 Aug 2010 11:48:14 -0400
parents bb6ea55bfdc0
children 280c8ae2476d
line wrap: on
line diff
--- a/lisp/mouse.el	Mon Aug 23 15:57:55 2010 +0200
+++ b/lisp/mouse.el	Tue Aug 24 11:48:14 2010 -0400
@@ -1268,10 +1268,11 @@
   (interactive "e")
   ;; Give temporary modes such as isearch a chance to turn off.
   (run-hooks 'mouse-leave-buffer-hook)
+  ;; Without this, confusing things happen upon e.g. inserting into
+  ;; the middle of an active region.
   (when select-active-regions
-    ;; Without this, confusing things happen upon e.g. inserting into
-    ;; the middle of an active region.
-    (deactivate-mark))
+    (let (select-active-regions)
+      (deactivate-mark)))
   (or mouse-yank-at-point (mouse-set-point click))
   (let ((primary
 	 (cond