diff options
author | Chong Yidong <cyd@stupidchicken.com> | 2010-08-15 22:33:17 -0400 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2010-08-15 22:33:17 -0400 |
commit | 7c23dd4468eb42dbe7e3f40339c6fda9f9905d0e (patch) | |
tree | fc6daa2c1cf95788332e4216b8293dc5616ee73b /src/insdel.c | |
parent | 6d3e82d2d656d7ed27b374f62c320c7d58348248 (diff) | |
download | emacs-7c23dd4468eb42dbe7e3f40339c6fda9f9905d0e.tar.gz |
Let all active regions set the primary selection.
This includes both temporarily active regions (mouse drag and
shift-select) and those made with C-SPC and cursor motion.
* lisp/cus-start.el: Change defcustom for select-active-regions.
* lisp/simple.el (deactivate-mark): If select-active-regions is `only',
only set selection for temporarily active regions.
* src/insdel.c (prepare_to_modify_buffer): Handle `only' value of
select-active-regions.
* src/keyboard.c (command_loop_1): Avoid setting selection twice,
since it's done in deactivate-mark as well.
(Vselect_active_regions): Replace `lazy' value with `only',
meaning to only set PRIMARY for temporarily active regions.
Diffstat (limited to 'src/insdel.c')
-rw-r--r-- | src/insdel.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/insdel.c b/src/insdel.c index 00025808e37..2ccc0b8eaac 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -74,7 +74,7 @@ Lisp_Object combine_after_change_buffer; Lisp_Object Qinhibit_modification_hooks; -extern Lisp_Object Vselect_active_regions, Vsaved_region_selection; +extern Lisp_Object Vselect_active_regions, Vsaved_region_selection, Qonly; /* Check all markers in the current buffer, looking for something invalid. */ @@ -2050,10 +2050,12 @@ prepare_to_modify_buffer (EMACS_INT start, EMACS_INT end, #endif /* not CLASH_DETECTION */ /* If `select-active-regions' is non-nil, save the region text. */ - if (!NILP (Vselect_active_regions) - && !NILP (current_buffer->mark_active) - && !NILP (Vtransient_mark_mode) - && NILP (Vsaved_region_selection)) + if (!NILP (current_buffer->mark_active) + && NILP (Vsaved_region_selection) + && (EQ (Vselect_active_regions, Qonly) + ? EQ (CAR_SAFE (Vtransient_mark_mode), Qonly) + : (!NILP (Vselect_active_regions) + && !NILP (Vtransient_mark_mode)))) { int b = XINT (Fmarker_position (current_buffer->mark)); int e = XINT (make_number (PT)); |