comparison src/select.c @ 458:c33ae14dd6d0 r21-2-44

Import from CVS: tag r21-2-44
author cvs
date Mon, 13 Aug 2007 11:42:25 +0200
parents e7ef97881643
children 183866b06e0b
comparison
equal deleted inserted replaced
457:4b9290a33024 458:c33ae14dd6d0
149 { 149 {
150 Lisp_Object selection_time, selection_data, prev_value = Qnil, 150 Lisp_Object selection_time, selection_data, prev_value = Qnil,
151 value_list = Qnil; 151 value_list = Qnil;
152 Lisp_Object prev_real_value = Qnil; 152 Lisp_Object prev_real_value = Qnil;
153 struct gcpro gcpro1; 153 struct gcpro gcpro1;
154 int owned_p = 0;
154 155
155 CHECK_SYMBOL (selection_name); 156 CHECK_SYMBOL (selection_name);
156 if (NILP (selection_value)) error ("selection-value may not be nil."); 157 if (NILP (selection_value)) error ("selection-value may not be nil.");
157 158
158 if (NILP (device)) 159 if (NILP (device))
178 Lisp_Object local_selection_data = assq_no_quit (selection_name, 179 Lisp_Object local_selection_data = assq_no_quit (selection_name,
179 Vselection_alist); 180 Vselection_alist);
180 181
181 if (!NILP (local_selection_data)) 182 if (!NILP (local_selection_data))
182 { 183 {
184 owned_p = 1;
183 /* Don't use Fdelq() as that may QUIT;. */ 185 /* Don't use Fdelq() as that may QUIT;. */
184 if (EQ (local_selection_data, Fcar (Vselection_alist))) 186 if (EQ (local_selection_data, Fcar (Vselection_alist)))
185 Vselection_alist = Fcdr (Vselection_alist); 187 Vselection_alist = Fcdr (Vselection_alist);
186 else 188 else
187 { 189 {
199 { 201 {
200 /* Look for a previous value */ 202 /* Look for a previous value */
201 prev_value = assq_no_quit (selection_name, Vselection_alist); 203 prev_value = assq_no_quit (selection_name, Vselection_alist);
202 204
203 if (!NILP (prev_value)) 205 if (!NILP (prev_value))
204 value_list = XCAR (XCDR (prev_value)); 206 {
207 owned_p = 1;
208 value_list = XCAR (XCDR (prev_value));
209 }
205 210
206 if (!NILP (value_list)) 211 if (!NILP (value_list))
207 prev_real_value = assq_no_quit (data_type, value_list); 212 prev_real_value = assq_no_quit (data_type, value_list);
208 } 213 }
209 214
278 /* have to do device specific stuff last so that methods can access the 283 /* have to do device specific stuff last so that methods can access the
279 selection_alist */ 284 selection_alist */
280 if (HAS_DEVMETH_P (XDEVICE (device), own_selection)) 285 if (HAS_DEVMETH_P (XDEVICE (device), own_selection))
281 selection_time = DEVMETH (XDEVICE (device), own_selection, 286 selection_time = DEVMETH (XDEVICE (device), own_selection,
282 (selection_name, selection_value, 287 (selection_name, selection_value,
283 how_to_add, data_type, !NILP (prev_value))); 288 how_to_add, data_type, owned_p));
284 else 289 else
285 selection_time = Qnil; 290 selection_time = Qnil;
286 291
287 Fsetcar (XCDR (XCDR (selection_data)), selection_time); 292 Fsetcar (XCDR (XCDR (selection_data)), selection_time);
288 293