aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/xselect.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/xselect.c b/src/xselect.c
index cdc70d3e247..76a2f9f5075 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -386,6 +386,9 @@ x_get_local_selection (Lisp_Object selection_symbol, Lisp_Object target_type,
386 CHECK_SYMBOL (target_type); 386 CHECK_SYMBOL (target_type);
387 handler_fn = Fcdr (Fassq (target_type, Vselection_converter_alist)); 387 handler_fn = Fcdr (Fassq (target_type, Vselection_converter_alist));
388 388
389 if (CONSP (handler_fn))
390 handler_fn = XCDR (handler_fn);
391
389 if (!NILP (handler_fn)) 392 if (!NILP (handler_fn))
390 value = call3 (handler_fn, 393 value = call3 (handler_fn,
391 selection_symbol, (local_request ? Qnil : target_type), 394 selection_symbol, (local_request ? Qnil : target_type),
@@ -2690,11 +2693,18 @@ syms_of_xselect (void)
2690 DEFVAR_LISP ("selection-converter-alist", Vselection_converter_alist, 2693 DEFVAR_LISP ("selection-converter-alist", Vselection_converter_alist,
2691 doc: /* An alist associating X Windows selection-types with functions. 2694 doc: /* An alist associating X Windows selection-types with functions.
2692These functions are called to convert the selection, with three args: 2695These functions are called to convert the selection, with three args:
2693the name of the selection (typically `PRIMARY', `SECONDARY', or `CLIPBOARD'); 2696the name of the selection (typically `PRIMARY', `SECONDARY', or
2694a desired type to which the selection should be converted; 2697`CLIPBOARD'); a desired type to which the selection should be
2695and the local selection value (whatever was given to 2698converted; and the local selection value (whatever was given to
2696`x-own-selection-internal'). 2699`x-own-selection-internal').
2697 2700
2701On X Windows, the function can also be a cons of (PREDICATE
2702. FUNCTION), where PREDICATE determines whether or not the selection
2703type will appear in the list of selection types available to other
2704programs, and FUNCTION is the function which is actually called.
2705PREDICATE is called with the same arguments as FUNCTION, and should
2706return a non-nil value if the data type is to appear in that list.
2707
2698The function should return the value to send to the X server 2708The function should return the value to send to the X server
2699\(typically a string). A return value of nil 2709\(typically a string). A return value of nil
2700means that the conversion could not be done. 2710means that the conversion could not be done.