diff options
| author | Richard M. Stallman | 1993-05-15 19:00:34 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-05-15 19:00:34 +0000 |
| commit | 356ba514a3cfc4a11c031fdce4c6bb81c4ed5ae3 (patch) | |
| tree | a6af11c4a7f3599cf1585b7adeb01ab55592eb9a /src | |
| parent | e23c2c217e05e88feb2e2c6da7d2387b34d0069b (diff) | |
| download | emacs-356ba514a3cfc4a11c031fdce4c6bb81c4ed5ae3.tar.gz emacs-356ba514a3cfc4a11c031fdce4c6bb81c4ed5ae3.zip | |
(Fx_selection_exists_p): Handle nil, t as SELECTION arg.
Don't die if SELECTION is not recognized.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xselect.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/xselect.c b/src/xselect.c index bb052ae1ccf..ca756646cd0 100644 --- a/src/xselect.c +++ b/src/xselect.c | |||
| @@ -1679,12 +1679,18 @@ and t is the same as `SECONDARY'.)") | |||
| 1679 | Lisp_Object selection; | 1679 | Lisp_Object selection; |
| 1680 | { | 1680 | { |
| 1681 | Window owner; | 1681 | Window owner; |
| 1682 | Atom atom; | ||
| 1682 | Display *dpy = x_current_display; | 1683 | Display *dpy = x_current_display; |
| 1683 | CHECK_SYMBOL (selection, 0); | 1684 | CHECK_SYMBOL (selection, 0); |
| 1684 | if (!NILP (Fx_selection_owner_p (selection))) | 1685 | if (!NILP (Fx_selection_owner_p (selection))) |
| 1685 | return Qt; | 1686 | return Qt; |
| 1687 | if (EQ (selection, Qnil)) selection = QPRIMARY; | ||
| 1688 | if (EQ (selection, Qt)) selection = QSECONDARY; | ||
| 1689 | atom = symbol_to_x_atom (dpy, selection); | ||
| 1690 | if (atom == 0) | ||
| 1691 | return Qnil; | ||
| 1686 | BLOCK_INPUT; | 1692 | BLOCK_INPUT; |
| 1687 | owner = XGetSelectionOwner (dpy, symbol_to_x_atom (dpy, selection)); | 1693 | owner = XGetSelectionOwner (dpy, atom); |
| 1688 | UNBLOCK_INPUT; | 1694 | UNBLOCK_INPUT; |
| 1689 | return (owner ? Qt : Qnil); | 1695 | return (owner ? Qt : Qnil); |
| 1690 | } | 1696 | } |