x_catch_errors (display);
XSetSelectionOwner (display, selection_atom, selecting_window, timestamp);
x_check_errors (display, "Can't set selection: %s");
- x_uncatch_errors ();
+ x_uncatch_errors_after_check ();
unblock_input ();
/* Now update the local cache */
CHECK_SYMBOL (target_type);
handler_fn = Fcdr (Fassq (target_type, Vselection_converter_alist));
- /* gcpro is not needed here since nothing but HANDLER_FN
- is live, and that ought to be a symbol. */
if (!NILP (handler_fn))
value = call3 (handler_fn,
static void
x_handle_selection_request (struct selection_input_event *event)
{
- struct gcpro gcpro1, gcpro2;
Time local_selection_time;
struct x_display_info *dpyinfo = SELECTION_EVENT_DPYINFO (event);
Lisp_Object local_selection_data;
bool success = false;
ptrdiff_t count = SPECPDL_INDEX ();
- GCPRO2 (local_selection_data, target_symbol);
if (!dpyinfo) goto DONE;
selection_symbol, target_symbol, success ? Qt : Qnil);
unbind_to (count, Qnil);
- UNGCPRO;
}
/* Perform the requested selection conversion, and write the data to
Lisp_Object target_symbol, Atom property,
bool for_multiple, struct x_display_info *dpyinfo)
{
- struct gcpro gcpro1;
Lisp_Object lisp_selection;
struct selection_data *cs;
- GCPRO1 (lisp_selection);
lisp_selection
= x_get_local_selection (selection_symbol, target_symbol,
converted_selections = cs;
}
- UNGCPRO;
return false;
}
cs->next = converted_selections;
converted_selections = cs;
lisp_data_to_selection_data (dpyinfo, lisp_selection, cs);
- UNGCPRO;
return true;
}
\f
XConvertSelection (display, selection_atom, type_atom, target_property,
requestor_window, requestor_time);
x_check_errors (display, "Can't convert selection: %s");
- x_uncatch_errors ();
+ x_uncatch_errors_after_check ();
/* Prepare to block until the reply has been read. */
reading_selection_window = requestor_window;
Sx_own_selection_internal, 2, 3, 0,
doc: /* Assert an X selection of type SELECTION and value VALUE.
SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'.
-\(Those are literal upper-case symbol names, since that's what X expects.)
+(Those are literal upper-case symbol names, since that's what X expects.)
VALUE is typically a string, or a cons of two markers, but may be
anything that the functions on `selection-converter-alist' know about.
Sx_get_selection_internal, 2, 4, 0,
doc: /* Return text selected from some X window.
SELECTION-SYMBOL is typically `PRIMARY', `SECONDARY', or `CLIPBOARD'.
-\(Those are literal upper-case symbol names, since that's what X expects.)
+(Those are literal upper-case symbol names, since that's what X expects.)
TARGET-TYPE is the type of data desired, typically `STRING'.
TIME-STAMP is the time to use in the XConvertSelection call for foreign
Lisp_Object time_stamp, Lisp_Object terminal)
{
Lisp_Object val = Qnil;
- struct gcpro gcpro1, gcpro2;
struct frame *f = frame_for_x_selection (terminal);
- GCPRO2 (target_type, val); /* we store newly consed data into these */
CHECK_SYMBOL (selection_symbol);
CHECK_SYMBOL (target_type);
{
Lisp_Object frame;
XSETFRAME (frame, f);
- RETURN_UNGCPRO (x_get_foreign_selection (selection_symbol, target_type,
- time_stamp, frame));
+ return x_get_foreign_selection (selection_symbol, target_type,
+ time_stamp, frame);
}
if (CONSP (val) && SYMBOLP (XCAR (val)))
if (CONSP (val) && NILP (XCDR (val)))
val = XCAR (val);
}
- RETURN_UNGCPRO (clean_local_selection_data (val));
+ return clean_local_selection_data (val);
}
DEFUN ("x-disown-selection-internal", Fx_disown_selection_internal,
doc: /* Whether the current Emacs process owns the given X Selection.
The arg should be the name of the selection in question, typically one of
the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'.
-\(Those are literal upper-case symbol names, since that's what X expects.)
+(Those are literal upper-case symbol names, since that's what X expects.)
For convenience, the symbol nil is the same as `PRIMARY',
and t is the same as `SECONDARY'.
x_clipboard_manager_error_1 (Lisp_Object err)
{
AUTO_STRING (format, "X clipboard manager error: %s\n\
-If the problem persists, set %qs to nil.");
+If the problem persists, set `%s' to nil.");
AUTO_STRING (varname, "x-select-enable-clipboard-manager");
CALLN (Fmessage, format, CAR (CDR (err)), varname);
return Qnil;
{
Lisp_Object o = XCAR (iter);
- if (INTEGERP (o) || FLOATP (o) || CONSP (o))
+ if (NUMBERP (o) || CONSP (o))
{
if (CONSP (o)
&& RANGED_INTEGERP (X_LONG_MIN >> 16, XCAR (o), X_LONG_MAX >> 16)
x_catch_errors (dpy);
name = atom ? XGetAtomName (dpy, atom) : empty;
had_errors_p = x_had_errors_p (dpy);
- x_uncatch_errors ();
+ x_uncatch_errors_after_check ();
if (!had_errors_p)
ret = build_string (name);
else
error ("DEST as a string must be one of PointerWindow or InputFocus");
}
- else if (INTEGERP (dest) || FLOATP (dest) || CONSP (dest))
+ else if (NUMBERP (dest) || CONSP (dest))
CONS_TO_INTEGER (dest, Window, wdest);
else
error ("DEST must be a frame, nil, string, number or cons");
`x-own-selection-internal').
The function should return the value to send to the X server
-\(typically a string). A return value of nil
+(typically a string). A return value of nil
means that the conversion could not be done.
A return value which is the symbol `NULL'
means that a side-effect was executed,
DEFVAR_LISP ("x-lost-selection-functions", Vx_lost_selection_functions,
doc: /* A list of functions to be called when Emacs loses an X selection.
-\(This happens when some other X client makes its own selection
+(This happens when some other X client makes its own selection
or when a Lisp program explicitly clears the selection.)
The functions are called with one argument, the selection type
-\(a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'). */);
+(a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'). */);
Vx_lost_selection_functions = Qnil;
DEFVAR_LISP ("x-sent-selection-functions", Vx_sent_selection_functions,