Mercurial > emacs
changeset 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 | e0a9c4815584 |
children | e2f296263868 |
files | src/xselect.c |
diffstat | 1 files changed, 7 insertions(+), 1 deletions(-) [+] |
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); }