aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2012-03-26 12:06:31 +0800
committerChong Yidong2012-03-26 12:06:31 +0800
commit90d49b7fb27dfa5a7d8cdb6aa11a5ce65ad9ddfa (patch)
tree04bdb905af37798897c57e93dbfde6f4afe40d96
parentc0bf77531e26501546bbb3a1fc000c730c3fc89f (diff)
downloademacs-90d49b7fb27dfa5a7d8cdb6aa11a5ce65ad9ddfa.tar.gz
emacs-90d49b7fb27dfa5a7d8cdb6aa11a5ce65ad9ddfa.zip
New variable selection-inhibit-update-commands, for inhibiting selection updates.
* keyboard.c (Vselection_inhibit_update_commands): New variable. (command_loop_1): Use it; inhibit selection update for handle-select-window too. Fixes: debbugs:8996
-rw-r--r--src/ChangeLog6
-rw-r--r--src/keyboard.c15
2 files changed, 20 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 71bfec1f061..490d4279080 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
12012-03-26 Chong Yidong <cyd@gnu.org>
2
3 * keyboard.c (Vselection_inhibit_update_commands): New variable.
4 (command_loop_1): Use it; inhibit selection update for
5 handle-select-window too (Bug#8996).
6
12012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr> 72012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
2 8
3 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific 9 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific
diff --git a/src/keyboard.c b/src/keyboard.c
index f791773c352..e60420599c9 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -241,6 +241,7 @@ Lisp_Object internal_last_event_frame;
241Time last_event_timestamp; 241Time last_event_timestamp;
242 242
243static Lisp_Object Qx_set_selection, Qhandle_switch_frame; 243static Lisp_Object Qx_set_selection, Qhandle_switch_frame;
244static Lisp_Object Qhandle_select_window;
244Lisp_Object QPRIMARY; 245Lisp_Object QPRIMARY;
245 246
246static Lisp_Object Qself_insert_command; 247static Lisp_Object Qself_insert_command;
@@ -1647,7 +1648,8 @@ command_loop_1 (void)
1647 ? EQ (CAR_SAFE (Vtransient_mark_mode), Qonly) 1648 ? EQ (CAR_SAFE (Vtransient_mark_mode), Qonly)
1648 : (!NILP (Vselect_active_regions) 1649 : (!NILP (Vselect_active_regions)
1649 && !NILP (Vtransient_mark_mode))) 1650 && !NILP (Vtransient_mark_mode)))
1650 && !EQ (Vthis_command, Qhandle_switch_frame)) 1651 && NILP (Fmemq (Vthis_command,
1652 Vselection_inhibit_update_commands)))
1651 { 1653 {
1652 EMACS_INT beg = 1654 EMACS_INT beg =
1653 XINT (Fmarker_position (BVAR (current_buffer, mark))); 1655 XINT (Fmarker_position (BVAR (current_buffer, mark)));
@@ -11649,6 +11651,7 @@ syms_of_keyboard (void)
11649 DEFSYM (Qx_set_selection, "x-set-selection"); 11651 DEFSYM (Qx_set_selection, "x-set-selection");
11650 DEFSYM (QPRIMARY, "PRIMARY"); 11652 DEFSYM (QPRIMARY, "PRIMARY");
11651 DEFSYM (Qhandle_switch_frame, "handle-switch-frame"); 11653 DEFSYM (Qhandle_switch_frame, "handle-switch-frame");
11654 DEFSYM (Qhandle_select_window, "handle-select-window");
11652 11655
11653 DEFSYM (Qinput_method_function, "input-method-function"); 11656 DEFSYM (Qinput_method_function, "input-method-function");
11654 DEFSYM (Qinput_method_exit_on_first_char, "input-method-exit-on-first-char"); 11657 DEFSYM (Qinput_method_exit_on_first_char, "input-method-exit-on-first-char");
@@ -12285,6 +12288,16 @@ text in the region before modifying the buffer. The next
12285`deactivate-mark' call uses this to set the window selection. */); 12288`deactivate-mark' call uses this to set the window selection. */);
12286 Vsaved_region_selection = Qnil; 12289 Vsaved_region_selection = Qnil;
12287 12290
12291 DEFVAR_LISP ("selection-inhibit-update-commands",
12292 Vselection_inhibit_update_commands,
12293 doc: /* List of commands which should not update the selection.
12294Normally, if `select-active-regions' is non-nil and the mark remains
12295active after a command (i.e. the mark was not deactivated), the Emacs
12296command loop sets the selection to the text in the region. However,
12297if the command is in this list, the selection is not updated. */);
12298 Vselection_inhibit_update_commands
12299 = list2 (Qhandle_switch_frame, Qhandle_select_window);
12300
12288 DEFVAR_LISP ("debug-on-event", 12301 DEFVAR_LISP ("debug-on-event",
12289 Vdebug_on_event, 12302 Vdebug_on_event,
12290 doc: /* Enter debugger on this event. When Emacs 12303 doc: /* Enter debugger on this event. When Emacs