emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r108950: Do not steal primary selecti


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r108950: Do not steal primary selection on mark deactivation.
Date: Sun, 08 Jul 2012 14:09:21 +0800
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 108950
fixes bug: http://debbugs.gnu.org/11772
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Sun 2012-07-08 14:09:21 +0800
message:
  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.
modified:
  lisp/ChangeLog
  lisp/simple.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-07-07 23:16:19 +0000
+++ b/lisp/ChangeLog    2012-07-08 06:09:21 +0000
@@ -1,3 +1,8 @@
+2012-07-08  Chong Yidong  <address@hidden>
+
+       * simple.el (deactivate-mark): Do not set the primary selection
+       if another program has acquired it (Bug#11772).
+
 2012-07-07  Kevin Ryde  <address@hidden>
 
        * woman.el (woman-strings): Fix double-quote handling (Bug#1151).

=== modified file 'lisp/simple.el'
--- a/lisp/simple.el    2012-07-07 09:33:28 +0000
+++ b/lisp/simple.el    2012-07-08 06:09:21 +0000
@@ -3863,7 +3863,11 @@
       (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)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]