]> git.eshelyaron.com Git - emacs.git/commitdiff
Fixes: debbugs:18939
authorJan D <jan.h.d@swipnet.se>
Sun, 22 Mar 2015 18:31:46 +0000 (19:31 +0100)
committerJan D <jan.h.d@swipnet.se>
Sun, 22 Mar 2015 18:31:46 +0000 (19:31 +0100)
* simple.el (deactivate-mark): Only modify PRIMARY if we own PRIMARY.

lisp/ChangeLog
lisp/simple.el

index 8f888e37b06c064d2693f39c93be2dee55b0eabe..7c7c66d24d6bd3f9871cb01d84272c866c76d4ec 100644 (file)
@@ -1,3 +1,8 @@
+2015-03-22  Jan Djärv  <jan.h.d@swipnet.se>
+
+       * simple.el (deactivate-mark): Only modify PRIMARY if we own
+       PRIMARY (Bug#18939).
+
 2015-03-22  Martin Rudalics  <rudalics@gmx.at>
 
        * emacs-lisp/debug.el (debug): Don't try using "previous" window
index ae07f6237cedf91fceb3541bf01cd4eb59026363..5e5cd877e9b343a8e0a3a4bcaa1500bffe656e68 100644 (file)
@@ -4420,7 +4420,8 @@ run `deactivate-mark-hook'."
       ;; the region prior to the last command modifying the buffer.
       ;; Set the selection to that, or to the current region.
       (cond (saved-region-selection
-            (x-set-selection 'PRIMARY saved-region-selection)
+            (if (x-selection-owner-p 'PRIMARY)
+                (x-set-selection 'PRIMARY saved-region-selection))
             (setq saved-region-selection nil))
            ;; If another program has acquired the selection, region
            ;; deactivation should not clobber it (Bug#11772).