Mercurial > emacs
diff src/xselect.c @ 2797:ae18dabac465
(Fx_selection_exists_p): Handle nil, t as SELECTION arg.
Don't die if SELECTION is not recognized.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 15 May 1993 19:00:34 +0000 |
parents | c0cdd6a80391 |
children | e94a593c3952 |
line wrap: on
line diff
--- 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); }