diff options
| author | Chong Yidong | 2010-08-07 16:26:55 -0400 |
|---|---|---|
| committer | Chong Yidong | 2010-08-07 16:26:55 -0400 |
| commit | 746812d9da7e6e2437fcac311d18641748942213 (patch) | |
| tree | 6dbedb81309dac9f0471b184bd7a13d730eb1c98 /src | |
| parent | 1bcb9e6575ee9a73a01fae63908e5a57ebeff34b (diff) | |
| download | emacs-746812d9da7e6e2437fcac311d18641748942213.tar.gz emacs-746812d9da7e6e2437fcac311d18641748942213.zip | |
Avoid restrictions when copying window selection.
* src/keyboard.c (command_loop_1):
* src/insdel.c (prepare_to_modify_buffer): Don't call validate_region.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/insdel.c | 13 | ||||
| -rw-r--r-- | src/keyboard.c | 13 |
3 files changed, 19 insertions, 12 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index b1c5d5651c8..8ed347761c1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,10 @@ | |||
| 1 | 2010-08-07 Chong Yidong <cyd@stupidchicken.com> | 1 | 2010-08-07 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 2 | ||
| 3 | * keyboard.c (command_loop_1): | ||
| 4 | * insdel.c (prepare_to_modify_buffer): Don't call validate_region. | ||
| 5 | |||
| 6 | 2010-08-07 Chong Yidong <cyd@stupidchicken.com> | ||
| 7 | |||
| 3 | * insdel.c (prepare_to_modify_buffer): Save active region text to | 8 | * insdel.c (prepare_to_modify_buffer): Save active region text to |
| 4 | Vsaved_region_selection. | 9 | Vsaved_region_selection. |
| 5 | 10 | ||
diff --git a/src/insdel.c b/src/insdel.c index ac220d6b74b..00025808e37 100644 --- a/src/insdel.c +++ b/src/insdel.c | |||
| @@ -2055,13 +2055,12 @@ prepare_to_modify_buffer (EMACS_INT start, EMACS_INT end, | |||
| 2055 | && !NILP (Vtransient_mark_mode) | 2055 | && !NILP (Vtransient_mark_mode) |
| 2056 | && NILP (Vsaved_region_selection)) | 2056 | && NILP (Vsaved_region_selection)) |
| 2057 | { | 2057 | { |
| 2058 | Lisp_Object b = Fmarker_position (current_buffer->mark); | 2058 | int b = XINT (Fmarker_position (current_buffer->mark)); |
| 2059 | Lisp_Object e = make_number (PT); | 2059 | int e = XINT (make_number (PT)); |
| 2060 | if (NILP (Fequal (b, e))) | 2060 | if (b < e) |
| 2061 | { | 2061 | Vsaved_region_selection = make_buffer_string (b, e, 0); |
| 2062 | validate_region (&b, &e); | 2062 | else if (b > e) |
| 2063 | Vsaved_region_selection = make_buffer_string (XINT (b), XINT (e), 0); | 2063 | Vsaved_region_selection = make_buffer_string (e, b, 0); |
| 2064 | } | ||
| 2065 | } | 2064 | } |
| 2066 | 2065 | ||
| 2067 | signal_before_change (start, end, preserve_ptr); | 2066 | signal_before_change (start, end, preserve_ptr); |
diff --git a/src/keyboard.c b/src/keyboard.c index de793fccde1..f12395544b9 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -1797,11 +1797,14 @@ command_loop_1 (void) | |||
| 1797 | { | 1797 | { |
| 1798 | /* Set window selection. If `select-active-regions' is | 1798 | /* Set window selection. If `select-active-regions' is |
| 1799 | `lazy', only do it for temporarily active regions. */ | 1799 | `lazy', only do it for temporarily active regions. */ |
| 1800 | Lisp_Object beg = Fmarker_position (current_buffer->mark); | 1800 | int beg = XINT (Fmarker_position (current_buffer->mark)); |
| 1801 | Lisp_Object end = make_number (PT); | 1801 | int end = XINT (make_number (PT)); |
| 1802 | validate_region (&beg, &end); | 1802 | if (beg < end) |
| 1803 | call2 (Qx_set_selection, QPRIMARY, | 1803 | call2 (Qx_set_selection, QPRIMARY, |
| 1804 | make_buffer_string (XINT (beg), XINT (end), 0)); | 1804 | make_buffer_string (beg, end, 0)); |
| 1805 | else if (beg > end) | ||
| 1806 | call2 (Qx_set_selection, QPRIMARY, | ||
| 1807 | make_buffer_string (end, beg, 0)); | ||
| 1805 | } | 1808 | } |
| 1806 | 1809 | ||
| 1807 | if (!NILP (Vdeactivate_mark)) | 1810 | if (!NILP (Vdeactivate_mark)) |