]> git.eshelyaron.com Git - emacs.git/commitdiff
* mouse.el (mouse-yank-primary): If select-active-regions is non-nil,
authorChong Yidong <cyd@stupidchicken.com>
Fri, 17 Jul 2009 23:24:54 +0000 (23:24 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Fri, 17 Jul 2009 23:24:54 +0000 (23:24 +0000)
deactivate the mark before insertion.

lisp/ChangeLog
lisp/mouse.el

index df01e56c679a848b1c843238cff62c4b96ef2595..5b899c35ca09582867da85b8c50affde3cea0b6f 100644 (file)
@@ -9,8 +9,9 @@
        * w32-fns.el (x-selection-owner-p): New function.
 
        * mouse.el (mouse-drag-track): Call deactivate-mark earlier.
-       (mouse-yank-at-click): If select-active-regions is non-nil,
-       deactivate the mark before insertion.
+       (mouse-yank-at-click, mouse-yank-primary): If
+       select-active-regions is non-nil, deactivate the mark before
+       insertion.
 
        * simple.el (deactivate-mark, set-mark): Only save selection if we
        own it.
index 7b7f6927debce28d3771563d944b05b8afaf1d50..9e25078e72a9e1e0ab3eec66328ea414f43a1587 100644 (file)
@@ -1387,6 +1387,10 @@ regardless of where you click."
   (interactive "e")
   ;; Give temporary modes such as isearch a chance to turn off.
   (run-hooks 'mouse-leave-buffer-hook)
+  (when select-active-regions
+    ;; Without this, confusing things happen upon e.g. inserting into
+    ;; the middle of an active region.
+    (deactivate-mark t))
   (or mouse-yank-at-point (mouse-set-point click))
   (let ((primary (x-get-selection 'PRIMARY)))
     (if primary