summaryrefslogtreecommitdiff
path: root/src/xselect.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1995-11-15 18:32:09 +0000
committerRichard M. Stallman <rms@gnu.org>1995-11-15 18:32:09 +0000
commit0d199f9c6baa84ed0831004a9c8947f9f6aed0e0 (patch)
tree21147dff5b039f324994cef4b9473388ff557dc8 /src/xselect.c
parent1df9cc40601b02fdc0f4131514ddc92863a2f264 (diff)
downloademacs-0d199f9c6baa84ed0831004a9c8947f9f6aed0e0.tar.gz
(x_clear_frame_selections): Get selection_symbol properly.
(x_clear_frame_selections): Undo previous change.
Diffstat (limited to 'src/xselect.c')
-rw-r--r--src/xselect.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/xselect.c b/src/xselect.c
index ad0cc265861..8c8f3e0a02e 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -818,6 +818,27 @@ x_clear_frame_selections (f)
/* Otherwise, we're really honest and truly being told to drop it.
Don't use Fdelq as that may QUIT;. */
+ /* Delete elements from the beginning of Vselection_alist. */
+ while (!NILP (Vselection_alist)
+ && EQ (frame, Fcar (Fcdr (Fcdr (Fcdr (Fcar (Vselection_alist)))))))
+ {
+ /* Let random Lisp code notice that the selection has been stolen. */
+ Lisp_Object hooks, selection_symbol;
+
+ hooks = Vx_lost_selection_hooks;
+ selection_symbol = Fcar (Fcar (Vselection_alist));
+
+ if (!EQ (hooks, Qunbound))
+ {
+ for (; CONSP (hooks); hooks = Fcdr (hooks))
+ call1 (Fcar (hooks), selection_symbol);
+ redisplay_preserve_echo_area ();
+ }
+
+ Vselection_alist = Fcdr (Vselection_alist);
+ }
+
+ /* Delete elements after the beginning of Vselection_alist. */
for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest))
if (EQ (frame, Fcar (Fcdr (Fcdr (Fcdr (Fcar (XCONS (rest)->cdr)))))))
{
@@ -825,7 +846,7 @@ x_clear_frame_selections (f)
Lisp_Object hooks, selection_symbol;
hooks = Vx_lost_selection_hooks;
- selection_symbol = Fcar (XCONS (rest)->cdr);
+ selection_symbol = Fcar (Fcar (XCONS (rest)->cdr));
if (!EQ (hooks, Qunbound))
{