summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/mouse.el4
2 files changed, 7 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index df01e56c679..5b899c35ca0 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -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.
diff --git a/lisp/mouse.el b/lisp/mouse.el
index 7b7f6927deb..9e25078e72a 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -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