emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r101018: Avoid restrictions when copy


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r101018: Avoid restrictions when copying window selection.
Date: Sat, 07 Aug 2010 16:26:55 -0400
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 101018
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Sat 2010-08-07 16:26:55 -0400
message:
  Avoid restrictions when copying window selection.
  * src/keyboard.c (command_loop_1):
  * src/insdel.c (prepare_to_modify_buffer): Don't call validate_region.
modified:
  src/ChangeLog
  src/insdel.c
  src/keyboard.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2010-08-07 19:39:04 +0000
+++ b/src/ChangeLog     2010-08-07 20:26:55 +0000
@@ -1,5 +1,10 @@
 2010-08-07  Chong Yidong  <address@hidden>
 
+       * keyboard.c (command_loop_1):
+       * insdel.c (prepare_to_modify_buffer): Don't call validate_region.
+
+2010-08-07  Chong Yidong  <address@hidden>
+
        * insdel.c (prepare_to_modify_buffer): Save active region text to
        Vsaved_region_selection.
 

=== modified file 'src/insdel.c'
--- a/src/insdel.c      2010-08-07 19:39:04 +0000
+++ b/src/insdel.c      2010-08-07 20:26:55 +0000
@@ -2055,13 +2055,12 @@
       && !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);

=== modified file 'src/keyboard.c'
--- a/src/keyboard.c    2010-08-07 19:39:04 +0000
+++ b/src/keyboard.c    2010-08-07 20:26:55 +0000
@@ -1797,11 +1797,14 @@
            {
              /* 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))


reply via email to

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