(deactivate-mark, activate-mark, set-mark): Don't call x-set-selection
authorEli Zaretskii <eliz@gnu.org>
Sat, 18 Jul 2009 19:04:22 +0000 (19:04 +0000)
committerEli Zaretskii <eliz@gnu.org>
Sat, 18 Jul 2009 19:04:22 +0000 (19:04 +0000)
if display-selections-p returns nil for the current frame.

lisp/ChangeLog
lisp/simple.el

index 3904750..0db4667 100644 (file)
@@ -1,3 +1,9 @@
+2009-07-18  Eli Zaretskii  <eliz@gnu.org>
+
+       * simple.el (deactivate-mark, activate-mark, set-mark): Don't call
+       x-set-selection if display-selections-p returns nil for the
+       current frame.
+
 2009-07-18  Chong Yidong  <cyd@stupidchicken.com>
 
        * simple.el (region-active-p, use-region-p): Doc fix (Bug#3873).
index 6ea572b..cfbbad5 100644 (file)
@@ -3489,6 +3489,7 @@ This function also runs `deactivate-mark-hook'."
     ;; Copy the latest region into the primary selection, if desired.
     (and select-active-regions
         mark-active
+        (display-selections-p)
         (x-selection-owner-p 'PRIMARY)
         (x-set-selection 'PRIMARY (buffer-substring-no-properties
                                    (region-beginning) (region-end))))
@@ -3510,7 +3511,8 @@ This function also runs `deactivate-mark-hook'."
     (setq mark-active t)
     (unless transient-mark-mode
       (setq transient-mark-mode 'lambda))
-    (when select-active-regions
+    (when (and select-active-regions
+              (display-selections-p))
       (x-set-selection 'PRIMARY (current-buffer)))))
 
 (defun set-mark (pos)
@@ -3534,7 +3536,8 @@ store it in a Lisp variable.  Example:
       (progn
        (setq mark-active t)
        (run-hooks 'activate-mark-hook)
-       (when select-active-regions
+       (when (and select-active-regions
+                  (display-selections-p))
          (x-set-selection 'PRIMARY (current-buffer)))
        (set-marker (mark-marker) pos (current-buffer)))
     ;; Normally we never clear mark-active except in Transient Mark mode.