aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorChong Yidong2012-07-08 14:09:21 +0800
committerChong Yidong2012-07-08 14:09:21 +0800
commitd75be97d549b7264098ff19f8941a0dd80bde080 (patch)
tree65a5ea0f8081de1beea7fc476ae184d9dc445cc1 /lisp
parent1ac8b55c0c8bb66ecd617c192b022f7f27950266 (diff)
downloademacs-d75be97d549b7264098ff19f8941a0dd80bde080.tar.gz
emacs-d75be97d549b7264098ff19f8941a0dd80bde080.zip
Do not steal primary selection on mark deactivation.
* lisp/simple.el (deactivate-mark): Do not set the primary selection if another program has acquired it. Fixes: debbugs:11772
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/simple.el6
2 files changed, 10 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 70894c5fc7b..8a608ea7b10 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12012-07-08 Chong Yidong <cyd@gnu.org>
2
3 * simple.el (deactivate-mark): Do not set the primary selection
4 if another program has acquired it (Bug#11772).
5
12012-07-07 Kevin Ryde <user42@zip.com.au> 62012-07-07 Kevin Ryde <user42@zip.com.au>
2 7
3 * woman.el (woman-strings): Fix double-quote handling (Bug#1151). 8 * woman.el (woman-strings): Fix double-quote handling (Bug#1151).
diff --git a/lisp/simple.el b/lisp/simple.el
index 4527a9da0dc..e6b4a79b9b2 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -3863,7 +3863,11 @@ run `deactivate-mark-hook'."
3863 (cond (saved-region-selection 3863 (cond (saved-region-selection
3864 (x-set-selection 'PRIMARY saved-region-selection) 3864 (x-set-selection 'PRIMARY saved-region-selection)
3865 (setq saved-region-selection nil)) 3865 (setq saved-region-selection nil))
3866 ((/= (region-beginning) (region-end)) 3866 ;; If another program has acquired the selection, region
3867 ;; deactivation should not clobber it (Bug#11772).
3868 ((and (/= (region-beginning) (region-end))
3869 (or (x-selection-owner-p 'PRIMARY)
3870 (null (x-selection-exists-p 'PRIMARY))))
3867 (x-set-selection 'PRIMARY 3871 (x-set-selection 'PRIMARY
3868 (buffer-substring-no-properties 3872 (buffer-substring-no-properties
3869 (region-beginning) 3873 (region-beginning)