Mercurial > hg > xemacs-beta
comparison src/select.c @ 440:8de8e3f6228a r21-2-28
Import from CVS: tag r21-2-28
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:33:38 +0200 |
parents | da8ed4261e83 |
children | abe6d1db359e |
comparison
equal
deleted
inserted
replaced
439:357dd071b03c | 440:8de8e3f6228a |
---|---|
201 anything that the functions on selection-converter-alist know about. | 201 anything that the functions on selection-converter-alist know about. |
202 */ | 202 */ |
203 (selection_name, selection_value, device)) | 203 (selection_name, selection_value, device)) |
204 { | 204 { |
205 Lisp_Object selection_time, selection_data, prev_value; | 205 Lisp_Object selection_time, selection_data, prev_value; |
206 struct gcpro gcpro1; | |
206 | 207 |
207 CHECK_SYMBOL (selection_name); | 208 CHECK_SYMBOL (selection_name); |
208 if (NILP (selection_value)) error ("selection-value may not be nil."); | 209 if (NILP (selection_value)) error ("selection-value may not be nil."); |
209 | 210 |
210 if (NILP (device)) | 211 if (NILP (device)) |
212 | 213 |
213 /* Now update the local cache */ | 214 /* Now update the local cache */ |
214 selection_data = list3 (selection_name, | 215 selection_data = list3 (selection_name, |
215 selection_value, | 216 selection_value, |
216 Qnil); | 217 Qnil); |
218 GCPRO1 (selection_data); | |
219 | |
217 prev_value = assq_no_quit (selection_name, Vselection_alist); | 220 prev_value = assq_no_quit (selection_name, Vselection_alist); |
218 Vselection_alist = Fcons (selection_data, Vselection_alist); | 221 Vselection_alist = Fcons (selection_data, Vselection_alist); |
219 | 222 |
220 /* If we already owned the selection, remove the old selection data. | 223 /* If we already owned the selection, remove the old selection data. |
221 Perhaps we should destructively modify it instead. | 224 Perhaps we should destructively modify it instead. |
239 (selection_name, selection_value)); | 242 (selection_name, selection_value)); |
240 else | 243 else |
241 selection_time = Qnil; | 244 selection_time = Qnil; |
242 | 245 |
243 Fsetcar (XCDR (XCDR (selection_data)), selection_time); | 246 Fsetcar (XCDR (XCDR (selection_data)), selection_time); |
247 | |
248 UNGCPRO; | |
244 | 249 |
245 return selection_value; | 250 return selection_value; |
246 } | 251 } |
247 | 252 |
248 /* remove a selection from our local copy | 253 /* remove a selection from our local copy |