]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid restrictions when copying window selection.
authorChong Yidong <cyd@stupidchicken.com>
Sat, 7 Aug 2010 20:26:55 +0000 (16:26 -0400)
committerChong Yidong <cyd@stupidchicken.com>
Sat, 7 Aug 2010 20:26:55 +0000 (16:26 -0400)
* src/keyboard.c (command_loop_1):
* src/insdel.c (prepare_to_modify_buffer): Don't call validate_region.

src/ChangeLog
src/insdel.c
src/keyboard.c

index b1c5d5651c8d4cd017fcca5038097ff9568efa3e..8ed347761c1c46af0e3f6cae465b3d6e80e167eb 100644 (file)
@@ -1,3 +1,8 @@
+2010-08-07  Chong Yidong  <cyd@stupidchicken.com>
+
+       * keyboard.c (command_loop_1):
+       * insdel.c (prepare_to_modify_buffer): Don't call validate_region.
+
 2010-08-07  Chong Yidong  <cyd@stupidchicken.com>
 
        * insdel.c (prepare_to_modify_buffer): Save active region text to
index ac220d6b74bd924c631d1d1e4b1607a6f4a86e41..00025808e37daaefa7fdf3d116b40836112b0d1a 100644 (file)
@@ -2055,13 +2055,12 @@ prepare_to_modify_buffer (EMACS_INT start, EMACS_INT end,
       && !NILP (Vtransient_mark_mode)
       && NILP (Vsaved_region_selection))
     {
-      Lisp_Object b = Fmarker_position (current_buffer->mark);
-      Lisp_Object e = make_number (PT);
-      if (NILP (Fequal (b, e)))
-       {
-         validate_region (&b, &e);
-         Vsaved_region_selection = make_buffer_string (XINT (b), XINT (e), 0);
-       }
+      int b = XINT (Fmarker_position (current_buffer->mark));
+      int e = XINT (make_number (PT));
+      if (b < e)
+       Vsaved_region_selection = make_buffer_string (b, e, 0);
+      else if (b > e)
+       Vsaved_region_selection = make_buffer_string (e, b, 0);
     }
 
   signal_before_change (start, end, preserve_ptr);
index de793fccde14c557be049b5fafc6684918a73889..f12395544b98e1755c2c9b356416d6fe0a43cb94 100644 (file)
@@ -1797,11 +1797,14 @@ command_loop_1 (void)
            {
              /* Set window selection.  If `select-active-regions' is
                 `lazy', only do it for temporarily active regions. */
-             Lisp_Object beg = Fmarker_position (current_buffer->mark);
-             Lisp_Object end = make_number (PT);
-             validate_region (&beg, &end);
-             call2 (Qx_set_selection, QPRIMARY,
-                    make_buffer_string (XINT (beg), XINT (end), 0));
+             int beg = XINT (Fmarker_position (current_buffer->mark));
+             int end = XINT (make_number (PT));
+             if (beg < end)
+               call2 (Qx_set_selection, QPRIMARY,
+                      make_buffer_string (beg, end, 0));
+             else if (beg > end)
+               call2 (Qx_set_selection, QPRIMARY,
+                      make_buffer_string (end, beg, 0));
            }
 
          if (!NILP (Vdeactivate_mark))