* lisp/isearch.el (isearch-yank-x-selection): Deactivate mark.
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 29 Nov 2011 18:39:16 +0000 (13:39 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 29 Nov 2011 18:39:16 +0000 (13:39 -0500)
Fixes: debbugs:10022

lisp/ChangeLog
lisp/isearch.el

index b25374d..d6275c8 100644 (file)
@@ -1,3 +1,7 @@
+2011-11-29  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * isearch.el (isearch-yank-x-selection): Deactivate mark (bug#10022).
+
 2011-11-29  Chong Yidong  <cyd@gnu.org>
 
        * indent.el (indent-for-tab-command, indent-according-to-mode):
index 6d95993..2a7f191 100644 (file)
@@ -1548,7 +1548,10 @@ If search string is empty, just beep."
 (defun isearch-yank-x-selection ()
   "Pull current X selection into search string."
   (interactive)
-  (isearch-yank-string (x-get-selection)))
+  (isearch-yank-string (x-get-selection))
+  ;; If `x-get-selection' returned the text from the active region,
+  ;; then it "used" the mark which we should hence deactivate.
+  (when select-active-regions (deactivate-mark)))
 
 
 (defun isearch-mouse-2 (click)