# HG changeset patch # User Richard M. Stallman # Date 737492434 0 # Node ID ae18dabac4653ed7dfbd0fbcd5857930c4c94e35 # Parent e0a9c4815584565942588a5afcf42e74c148f658 (Fx_selection_exists_p): Handle nil, t as SELECTION arg. Don't die if SELECTION is not recognized. diff -r e0a9c4815584 -r ae18dabac465 src/xselect.c --- a/src/xselect.c Sat May 15 18:47:18 1993 +0000 +++ b/src/xselect.c Sat May 15 19:00:34 1993 +0000 @@ -1679,12 +1679,18 @@ Lisp_Object selection; { Window owner; + Atom atom; Display *dpy = x_current_display; CHECK_SYMBOL (selection, 0); if (!NILP (Fx_selection_owner_p (selection))) return Qt; + if (EQ (selection, Qnil)) selection = QPRIMARY; + if (EQ (selection, Qt)) selection = QSECONDARY; + atom = symbol_to_x_atom (dpy, selection); + if (atom == 0) + return Qnil; BLOCK_INPUT; - owner = XGetSelectionOwner (dpy, symbol_to_x_atom (dpy, selection)); + owner = XGetSelectionOwner (dpy, atom); UNBLOCK_INPUT; return (owner ? Qt : Qnil); }