aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2010-08-24 11:48:14 -0400
committerChong Yidong2010-08-24 11:48:14 -0400
commit1c409d0b963ebdb1f48b90ddce85c56d989bee5f (patch)
treedb1bf3baea9d24a20e325d76c52699c64daef7b7
parent372214322c37ded1631741b55cb125a99ff6bdbd (diff)
downloademacs-1c409d0b963ebdb1f48b90ddce85c56d989bee5f.tar.gz
emacs-1c409d0b963ebdb1f48b90ddce85c56d989bee5f.zip
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).
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/mouse.el7
-rw-r--r--src/ChangeLog5
-rw-r--r--src/keyboard.c13
4 files changed, 22 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 1402c45b125..79b5f6583a0 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12010-08-24 Chong Yidong <cyd@stupidchicken.com>
2
3 * mouse.el (mouse-yank-primary): Avoid setting primary when
4 deactivating the mark (Bug#6872).
5
12010-08-23 Michael Albinus <michael.albinus@gmx.de> 62010-08-23 Michael Albinus <michael.albinus@gmx.de>
2 7
3 * net/dbus.el: Accept UNIX domain sockets as bus address. 8 * net/dbus.el: Accept UNIX domain sockets as bus address.
diff --git a/lisp/mouse.el b/lisp/mouse.el
index c9b190f1c79..a2a0191ce79 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -1268,10 +1268,11 @@ regardless of where you click."
1268 (interactive "e") 1268 (interactive "e")
1269 ;; Give temporary modes such as isearch a chance to turn off. 1269 ;; Give temporary modes such as isearch a chance to turn off.
1270 (run-hooks 'mouse-leave-buffer-hook) 1270 (run-hooks 'mouse-leave-buffer-hook)
1271 ;; Without this, confusing things happen upon e.g. inserting into
1272 ;; the middle of an active region.
1271 (when select-active-regions 1273 (when select-active-regions
1272 ;; Without this, confusing things happen upon e.g. inserting into 1274 (let (select-active-regions)
1273 ;; the middle of an active region. 1275 (deactivate-mark)))
1274 (deactivate-mark))
1275 (or mouse-yank-at-point (mouse-set-point click)) 1276 (or mouse-yank-at-point (mouse-set-point click))
1276 (let ((primary 1277 (let ((primary
1277 (cond 1278 (cond
diff --git a/src/ChangeLog b/src/ChangeLog
index 17d1f7a08b6..7cadee4fcda 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12010-08-24 Chong Yidong <cyd@stupidchicken.com>
2
3 * keyboard.c (command_loop_1): Don't clobber primary selection
4 during handle-switch-frame (Bug#6872).
5
12010-08-23 Michael Albinus <michael.albinus@gmx.de> 62010-08-23 Michael Albinus <michael.albinus@gmx.de>
2 7
3 * dbusbind.c: Accept UNIX domain sockets as bus address. 8 * dbusbind.c: Accept UNIX domain sockets as bus address.
diff --git a/src/keyboard.c b/src/keyboard.c
index b4a5d4e060f..cac051f7882 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -368,7 +368,7 @@ Lisp_Object Vselect_active_regions;
368 Used by the `select-active-regions' feature. */ 368 Used by the `select-active-regions' feature. */
369Lisp_Object Vsaved_region_selection; 369Lisp_Object Vsaved_region_selection;
370 370
371Lisp_Object Qx_set_selection, QPRIMARY; 371Lisp_Object Qx_set_selection, QPRIMARY, Qhandle_switch_frame;
372 372
373Lisp_Object Qself_insert_command; 373Lisp_Object Qself_insert_command;
374Lisp_Object Qforward_char; 374Lisp_Object Qforward_char;
@@ -1799,10 +1799,11 @@ command_loop_1 (void)
1799 { 1799 {
1800 /* Even if not deactivating the mark, set PRIMARY if 1800 /* Even if not deactivating the mark, set PRIMARY if
1801 `select-active-regions' is non-nil. */ 1801 `select-active-regions' is non-nil. */
1802 if (EQ (Vselect_active_regions, Qonly) 1802 if ((EQ (Vselect_active_regions, Qonly)
1803 ? EQ (CAR_SAFE (Vtransient_mark_mode), Qonly) 1803 ? EQ (CAR_SAFE (Vtransient_mark_mode), Qonly)
1804 : (!NILP (Vselect_active_regions) 1804 : (!NILP (Vselect_active_regions)
1805 && !NILP (Vtransient_mark_mode))) 1805 && !NILP (Vtransient_mark_mode)))
1806 && !EQ (Vthis_command, Qhandle_switch_frame))
1806 { 1807 {
1807 int beg = XINT (Fmarker_position (current_buffer->mark)); 1808 int beg = XINT (Fmarker_position (current_buffer->mark));
1808 int end = XINT (make_number (PT)); 1809 int end = XINT (make_number (PT));
@@ -11702,6 +11703,8 @@ syms_of_keyboard (void)
11702 staticpro (&Qx_set_selection); 11703 staticpro (&Qx_set_selection);
11703 QPRIMARY = intern_c_string ("PRIMARY"); 11704 QPRIMARY = intern_c_string ("PRIMARY");
11704 staticpro (&QPRIMARY); 11705 staticpro (&QPRIMARY);
11706 Qhandle_switch_frame = intern_c_string ("handle-switch-frame");
11707 staticpro (&Qhandle_switch_frame);
11705 11708
11706 Qinput_method_exit_on_first_char = intern_c_string ("input-method-exit-on-first-char"); 11709 Qinput_method_exit_on_first_char = intern_c_string ("input-method-exit-on-first-char");
11707 staticpro (&Qinput_method_exit_on_first_char); 11710 staticpro (&Qinput_method_exit_on_first_char);