]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid clobbering primary selection when switching frames (Bug#6872).
authorChong Yidong <cyd@stupidchicken.com>
Tue, 24 Aug 2010 15:48:14 +0000 (11:48 -0400)
committerChong Yidong <cyd@stupidchicken.com>
Tue, 24 Aug 2010 15:48:14 +0000 (11:48 -0400)
* lisp/mouse.el (mouse-yank-primary): Avoid setting primary when
deactivating the mark (Bug#6872).

* src/keyboard.c (command_loop_1): Don't set primary selection during
handle-switch-frame (Bug#6872).

lisp/ChangeLog
lisp/mouse.el
src/ChangeLog
src/keyboard.c

index 1402c45b1252df28f28e01f697be7055bc04c384..79b5f6583a0e826359693eb07916fa6bd8f7a42e 100644 (file)
@@ -1,3 +1,8 @@
+2010-08-24  Chong Yidong  <cyd@stupidchicken.com>
+
+       * mouse.el (mouse-yank-primary): Avoid setting primary when
+       deactivating the mark (Bug#6872).
+
 2010-08-23  Michael Albinus  <michael.albinus@gmx.de>
 
        * net/dbus.el: Accept UNIX domain sockets as bus address.
index c9b190f1c793f1e4cb35b328b10b5d07156f4a9a..a2a0191ce79ac76b017427cc356b88bd39d6f7b1 100644 (file)
@@ -1268,10 +1268,11 @@ regardless of where you click."
   (interactive "e")
   ;; Give temporary modes such as isearch a chance to turn off.
   (run-hooks 'mouse-leave-buffer-hook)
+  ;; Without this, confusing things happen upon e.g. inserting into
+  ;; the middle of an active region.
   (when select-active-regions
-    ;; Without this, confusing things happen upon e.g. inserting into
-    ;; the middle of an active region.
-    (deactivate-mark))
+    (let (select-active-regions)
+      (deactivate-mark)))
   (or mouse-yank-at-point (mouse-set-point click))
   (let ((primary
         (cond
index 17d1f7a08b6dfaeb1a8f529665bbb1b58a67b316..7cadee4fcda33b55f9497921a17ce418dcb9158a 100644 (file)
@@ -1,3 +1,8 @@
+2010-08-24  Chong Yidong  <cyd@stupidchicken.com>
+
+       * keyboard.c (command_loop_1): Don't clobber primary selection
+       during handle-switch-frame (Bug#6872).
+
 2010-08-23  Michael Albinus  <michael.albinus@gmx.de>
 
        * dbusbind.c: Accept UNIX domain sockets as bus address.
index b4a5d4e060fb09929606dde2b6da957b24c15f84..cac051f78827526c2f6a73591415f2fff05adaaa 100644 (file)
@@ -368,7 +368,7 @@ Lisp_Object Vselect_active_regions;
    Used by the `select-active-regions' feature.  */
 Lisp_Object Vsaved_region_selection;
 
-Lisp_Object Qx_set_selection, QPRIMARY;
+Lisp_Object Qx_set_selection, QPRIMARY, Qhandle_switch_frame;
 
 Lisp_Object Qself_insert_command;
 Lisp_Object Qforward_char;
@@ -1799,10 +1799,11 @@ command_loop_1 (void)
            {
              /* Even if not deactivating the mark, set PRIMARY if
                 `select-active-regions' is non-nil.  */
-             if (EQ (Vselect_active_regions, Qonly)
-                 ? EQ (CAR_SAFE (Vtransient_mark_mode), Qonly)
-                 : (!NILP (Vselect_active_regions)
-                    && !NILP (Vtransient_mark_mode)))
+             if ((EQ (Vselect_active_regions, Qonly)
+                  ? EQ (CAR_SAFE (Vtransient_mark_mode), Qonly)
+                  : (!NILP (Vselect_active_regions)
+                     && !NILP (Vtransient_mark_mode)))
+                 && !EQ (Vthis_command, Qhandle_switch_frame))
                {
                  int beg = XINT (Fmarker_position (current_buffer->mark));
                  int end = XINT (make_number (PT));
@@ -11702,6 +11703,8 @@ syms_of_keyboard (void)
   staticpro (&Qx_set_selection);
   QPRIMARY = intern_c_string ("PRIMARY");
   staticpro (&QPRIMARY);
+  Qhandle_switch_frame = intern_c_string ("handle-switch-frame");
+  staticpro (&Qhandle_switch_frame);
 
   Qinput_method_exit_on_first_char = intern_c_string ("input-method-exit-on-first-char");
   staticpro (&Qinput_method_exit_on_first_char);