comparison src/select.c @ 829:42a86787d173

[xemacs-hg @ 2002-05-07 15:58:46 by stephent] fix kill-ring bug <87elgoufss.fsf_-_@tleepslib.sk.tsukuba.ac.jp>
author stephent
date Tue, 07 May 2002 15:59:03 +0000
parents 183866b06e0b
children f46864126a0d
comparison
equal deleted inserted replaced
828:4ead1e0842f0 829:42a86787d173
137 Give the selection SELECTION-NAME the value SELECTION-VALUE. 137 Give the selection SELECTION-NAME the value SELECTION-VALUE.
138 SELECTION-NAME is a symbol, typically PRIMARY, SECONDARY, or CLIPBOARD. 138 SELECTION-NAME is a symbol, typically PRIMARY, SECONDARY, or CLIPBOARD.
139 SELECTION-VALUE is typically a string, or a cons of two markers, but may be 139 SELECTION-VALUE is typically a string, or a cons of two markers, but may be
140 anything that the functions on selection-converter-out-alist know about. 140 anything that the functions on selection-converter-out-alist know about.
141 Optional arg HOW-TO-ADD specifies how the selection will be combined 141 Optional arg HOW-TO-ADD specifies how the selection will be combined
142 with any existing selection(s) - see `own-selection' for more 142 with any existing selection(s) - see `own-selection' and
143 information. 143 `interprogram-cut-function' for more information.
144 Optional arg DATA-TYPE is a window-system-specific type. 144 Optional arg DATA-TYPE is a window-system-specific type.
145 Optional arg DEVICE specifies the device on which to assert the selection. 145 Optional arg DEVICE specifies the device on which to assert the selection.
146 It defaults to the selected device. 146 It defaults to the selected device.
147 */ 147 */
148 (selection_name, selection_value, how_to_add, data_type, device)) 148 (selection_name, selection_value, how_to_add, data_type, device))
507 507
508 return Qnil; 508 return Qnil;
509 } 509 }
510 510
511 /* Request the selection value from the owner. If we are the owner, 511 /* Request the selection value from the owner. If we are the owner,
512 simply return our selection value. If we are not the owner, this 512 return Qnil. If we are not the owner, this will block until all of
513 will block until all of the data has arrived. 513 the data has arrived.
514 */ 514 */
515 DEFUN ("get-selection-internal", Fget_selection_internal, 2, 3, 0, /* 515 DEFUN ("get-selection-internal", Fget_selection_internal, 2, 3, 0, /*
516 Return text selected from some window-system window. 516 Return text selected from some window-system window.
517 SELECTION is a symbol, typically PRIMARY, SECONDARY, or CLIPBOARD. 517 SELECTION is a symbol, typically PRIMARY, SECONDARY, or CLIPBOARD.
518 TARGET-TYPE is the type of data desired, typically STRING or COMPOUND_TEXT. 518 TARGET-TYPE is the type of data desired, typically STRING or COMPOUND_TEXT.
519 Under Mule, if the resultant data comes back as 8-bit data in type 519 Under Mule, if the resultant data comes back as 8-bit data in type
520 TEXT or COMPOUND_TEXT, it will be decoded as Compound Text. 520 TEXT or COMPOUND_TEXT, it will be decoded as Compound Text.
521 If XEmacs already owns the selection, return nil. See
522 `interprogram-paste-function' for more information.
521 */ 523 */
522 (selection, target_type, device)) 524 (selection, target_type, device))
523 { 525 {
524 /* This function can GC */ 526 /* This function can GC */
525 Lisp_Object val = Qnil; 527 Lisp_Object val = Qnil;
557 559
558 if (!NILP (val)) 560 if (!NILP (val))
559 { 561 {
560 /* If we get something from the local cache, we may need to convert 562 /* If we get something from the local cache, we may need to convert
561 it slightly - to do this, we call select-coerce */ 563 it slightly - to do this, we call select-coerce */
562 val = call3 (Qselect_coerce, selection, target_type, val); 564 Lisp_Object val2 = call3 (Qselect_coerce, selection, target_type, val);
565 return (EQ (val, val2)) ? Qnil : val2;
563 } 566 }
564 else if (HAS_DEVMETH_P (XDEVICE (device), get_foreign_selection)) 567 else if (HAS_DEVMETH_P (XDEVICE (device), get_foreign_selection))
565 { 568 {
566 /* Nothing in the local cache; try the window system */ 569 /* Nothing in the local cache; try the window system */
567 val = DEVMETH (XDEVICE (device), get_foreign_selection, 570 val = DEVMETH (XDEVICE (device), get_foreign_selection,