comparison src/select.c @ 843:f46864126a0d

[xemacs-hg @ 2002-05-15 15:27:40 by stephent] fix yank-pop bug correctly <87adr1zbdd.fsf@tleepslib.sk.tsukuba.ac.jp>
author stephent
date Wed, 15 May 2002 15:27:58 +0000
parents 42a86787d173
children 79c6ff3eef26
comparison
equal deleted inserted replaced
842:dc12269565c9 843:f46864126a0d
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' and 142 with any existing selection(s) - see `own-selection' for more
143 `interprogram-cut-function' for more information. 143 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 return Qnil. If we are not the owner, this will block until all of 512 simply return our selection value. If we are not the owner, this
513 the data has arrived. 513 will block until all of 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.
523 */ 521 */
524 (selection, target_type, device)) 522 (selection, target_type, device))
525 { 523 {
526 /* This function can GC */ 524 /* This function can GC */
527 Lisp_Object val = Qnil; 525 Lisp_Object val = Qnil;
559 557
560 if (!NILP (val)) 558 if (!NILP (val))
561 { 559 {
562 /* If we get something from the local cache, we may need to convert 560 /* If we get something from the local cache, we may need to convert
563 it slightly - to do this, we call select-coerce */ 561 it slightly - to do this, we call select-coerce */
564 Lisp_Object val2 = call3 (Qselect_coerce, selection, target_type, val); 562 val = call3 (Qselect_coerce, selection, target_type, val);
565 return (EQ (val, val2)) ? Qnil : val2;
566 } 563 }
567 else if (HAS_DEVMETH_P (XDEVICE (device), get_foreign_selection)) 564 else if (HAS_DEVMETH_P (XDEVICE (device), get_foreign_selection))
568 { 565 {
569 /* Nothing in the local cache; try the window system */ 566 /* Nothing in the local cache; try the window system */
570 val = DEVMETH (XDEVICE (device), get_foreign_selection, 567 val = DEVMETH (XDEVICE (device), get_foreign_selection,