comparison src/insdel.c @ 109802:acc05fd0631b

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.
author Chong Yidong <cyd@stupidchicken.com>
date Sun, 15 Aug 2010 22:33:17 -0400
parents b6edc1ea12d7
children 5290c80fda43
comparison
equal deleted inserted replaced
109801:f4192807d8a6 109802:acc05fd0631b
72 /* Buffer which combine_after_change_list is about. */ 72 /* Buffer which combine_after_change_list is about. */
73 Lisp_Object combine_after_change_buffer; 73 Lisp_Object combine_after_change_buffer;
74 74
75 Lisp_Object Qinhibit_modification_hooks; 75 Lisp_Object Qinhibit_modification_hooks;
76 76
77 extern Lisp_Object Vselect_active_regions, Vsaved_region_selection; 77 extern Lisp_Object Vselect_active_regions, Vsaved_region_selection, Qonly;
78 78
79 79
80 /* Check all markers in the current buffer, looking for something invalid. */ 80 /* Check all markers in the current buffer, looking for something invalid. */
81 81
82 static int check_markers_debug_flag; 82 static int check_markers_debug_flag;
2048 call1 (intern ("ask-user-about-supersession-threat"), 2048 call1 (intern ("ask-user-about-supersession-threat"),
2049 base_buffer->filename); 2049 base_buffer->filename);
2050 #endif /* not CLASH_DETECTION */ 2050 #endif /* not CLASH_DETECTION */
2051 2051
2052 /* If `select-active-regions' is non-nil, save the region text. */ 2052 /* If `select-active-regions' is non-nil, save the region text. */
2053 if (!NILP (Vselect_active_regions) 2053 if (!NILP (current_buffer->mark_active)
2054 && !NILP (current_buffer->mark_active) 2054 && NILP (Vsaved_region_selection)
2055 && !NILP (Vtransient_mark_mode) 2055 && (EQ (Vselect_active_regions, Qonly)
2056 && NILP (Vsaved_region_selection)) 2056 ? EQ (CAR_SAFE (Vtransient_mark_mode), Qonly)
2057 : (!NILP (Vselect_active_regions)
2058 && !NILP (Vtransient_mark_mode))))
2057 { 2059 {
2058 int b = XINT (Fmarker_position (current_buffer->mark)); 2060 int b = XINT (Fmarker_position (current_buffer->mark));
2059 int e = XINT (make_number (PT)); 2061 int e = XINT (make_number (PT));
2060 if (b < e) 2062 if (b < e)
2061 Vsaved_region_selection = make_buffer_string (b, e, 0); 2063 Vsaved_region_selection = make_buffer_string (b, e, 0);