summaryrefslogtreecommitdiff
path: root/lisp/simple.el
diff options
context:
space:
mode:
authorJan D <jan.h.d@swipnet.se>2015-03-22 19:31:46 +0100
committerJan D <jan.h.d@swipnet.se>2015-03-22 19:31:46 +0100
commitc3c4b758c6d3e33d7fa7621ba4a50ec75c121247 (patch)
treed3d70e6b6973ade152c370afe8ba41d099ee6bbc /lisp/simple.el
parenta4ff05a2172fc0c057ca9715d263c8b00fbf0218 (diff)
downloademacs-c3c4b758c6d3e33d7fa7621ba4a50ec75c121247.tar.gz
Fixes: debbugs:18939
* simple.el (deactivate-mark): Only modify PRIMARY if we own PRIMARY.
Diffstat (limited to 'lisp/simple.el')
-rw-r--r--lisp/simple.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index ae07f6237ce..5e5cd877e9b 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -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).