Commit d75be97d authored by Chong Yidong's avatar Chong Yidong

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
parent 1ac8b55c
2012-07-08 Chong Yidong <cyd@gnu.org>
* simple.el (deactivate-mark): Do not set the primary selection
if another program has acquired it (Bug#11772).
2012-07-07 Kevin Ryde <user42@zip.com.au>
* woman.el (woman-strings): Fix double-quote handling (Bug#1151).
......
......@@ -3863,7 +3863,11 @@ run `deactivate-mark-hook'."
(cond (saved-region-selection
(x-set-selection 'PRIMARY saved-region-selection)
(setq saved-region-selection nil))
((/= (region-beginning) (region-end))
;; If another program has acquired the selection, region
;; deactivation should not clobber it (Bug#11772).
((and (/= (region-beginning) (region-end))
(or (x-selection-owner-p 'PRIMARY)
(null (x-selection-exists-p 'PRIMARY))))
(x-set-selection 'PRIMARY
(buffer-substring-no-properties
(region-beginning)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment