emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r101176: Avoid clobbering primary sel


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r101176: Avoid clobbering primary selection when switching frames (Bug#6872).
Date: Tue, 24 Aug 2010 11:48:14 -0400
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 101176
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Tue 2010-08-24 11:48:14 -0400
message:
  Avoid clobbering primary selection when switching frames (Bug#6872).
  
  * 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).
modified:
  lisp/ChangeLog
  lisp/mouse.el
  src/ChangeLog
  src/keyboard.c
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-08-23 13:08:54 +0000
+++ b/lisp/ChangeLog    2010-08-24 15:48:14 +0000
@@ -1,3 +1,8 @@
+2010-08-24  Chong Yidong  <address@hidden>
+
+       * mouse.el (mouse-yank-primary): Avoid setting primary when
+       deactivating the mark (Bug#6872).
+
 2010-08-23  Michael Albinus  <address@hidden>
 
        * net/dbus.el: Accept UNIX domain sockets as bus address.

=== modified file 'lisp/mouse.el'
--- a/lisp/mouse.el     2010-08-21 04:46:23 +0000
+++ b/lisp/mouse.el     2010-08-24 15:48:14 +0000
@@ -1268,10 +1268,11 @@
   (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

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2010-08-23 13:02:00 +0000
+++ b/src/ChangeLog     2010-08-24 15:48:14 +0000
@@ -1,3 +1,8 @@
+2010-08-24  Chong Yidong  <address@hidden>
+
+       * keyboard.c (command_loop_1): Don't clobber primary selection
+       during handle-switch-frame (Bug#6872).
+
 2010-08-23  Michael Albinus  <address@hidden>
 
        * dbusbind.c: Accept UNIX domain sockets as bus address.

=== modified file 'src/keyboard.c'
--- a/src/keyboard.c    2010-08-22 23:27:59 +0000
+++ b/src/keyboard.c    2010-08-24 15:48:14 +0000
@@ -368,7 +368,7 @@
    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 @@
            {
              /* 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 @@
   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);


reply via email to

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