emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r107681: New variable selection-inhib


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r107681: New variable selection-inhibit-update-commands, for inhibiting selection updates.
Date: Mon, 26 Mar 2012 12:06:31 +0800
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 107681
fixes bug(s): http://debbugs.gnu.org/8996
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Mon 2012-03-26 12:06:31 +0800
message:
  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.
modified:
  src/ChangeLog
  src/keyboard.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-03-25 18:30:50 +0000
+++ b/src/ChangeLog     2012-03-26 04:06:31 +0000
@@ -1,3 +1,9 @@
+2012-03-26  Chong Yidong  <address@hidden>
+
+       * keyboard.c (Vselection_inhibit_update_commands): New variable.
+       (command_loop_1): Use it; inhibit selection update for
+       handle-select-window too (Bug#8996).
+
 2012-03-25  Fabrice Popineau  <address@hidden>
 
        * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific

=== modified file 'src/keyboard.c'
--- a/src/keyboard.c    2012-02-24 08:34:09 +0000
+++ b/src/keyboard.c    2012-03-26 04:06:31 +0000
@@ -241,6 +241,7 @@
 Time last_event_timestamp;
 
 static Lisp_Object Qx_set_selection, Qhandle_switch_frame;
+static Lisp_Object Qhandle_select_window;
 Lisp_Object QPRIMARY;
 
 static Lisp_Object Qself_insert_command;
@@ -1647,7 +1648,8 @@
                      ? EQ (CAR_SAFE (Vtransient_mark_mode), Qonly)
                      : (!NILP (Vselect_active_regions)
                         && !NILP (Vtransient_mark_mode)))
-                 && !EQ (Vthis_command, Qhandle_switch_frame))
+                 && NILP (Fmemq (Vthis_command,
+                                 Vselection_inhibit_update_commands)))
                {
                  EMACS_INT beg =
                    XINT (Fmarker_position (BVAR (current_buffer, mark)));
@@ -11649,6 +11651,7 @@
   DEFSYM (Qx_set_selection, "x-set-selection");
   DEFSYM (QPRIMARY, "PRIMARY");
   DEFSYM (Qhandle_switch_frame, "handle-switch-frame");
+  DEFSYM (Qhandle_select_window, "handle-select-window");
 
   DEFSYM (Qinput_method_function, "input-method-function");
   DEFSYM (Qinput_method_exit_on_first_char, "input-method-exit-on-first-char");
@@ -12285,6 +12288,16 @@
 `deactivate-mark' call uses this to set the window selection.  */);
   Vsaved_region_selection = Qnil;
 
+  DEFVAR_LISP ("selection-inhibit-update-commands",
+              Vselection_inhibit_update_commands,
+              doc: /* List of commands which should not update the selection.
+Normally, if `select-active-regions' is non-nil and the mark remains
+active after a command (i.e. the mark was not deactivated), the Emacs
+command loop sets the selection to the text in the region.  However,
+if the command is in this list, the selection is not updated.  */);
+  Vselection_inhibit_update_commands
+    = list2 (Qhandle_switch_frame, Qhandle_select_window);
+
   DEFVAR_LISP ("debug-on-event",
                Vdebug_on_event,
                doc: /* Enter debugger on this event.  When Emacs


reply via email to

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