Commit cd18e7e3 authored by Johan Bockgård's avatar Johan Bockgård
Browse files

Fix execution of x selection hooks.

* xselect.c (Qx_lost_selection_functions)
(Qx_sent_selection_functions): New vars.
(syms_of_xselect): DEFSYM them.
(x_handle_selection_request): Pass Qx_sent_selection_functions
rather than Vx_sent_selection_functions to Frun_hook_with_args.
(x_handle_selection_clear,x_clear_frame_selections):
Pass Qx_lost_selection_functions rather than
Vx_lost_selection_functions to Frun_hook_with_args.
parent 2941c447
2011-07-13 Johan Bockgård <bojohan@gnu.org>
Fix execution of x selection hooks.
* xselect.c (Qx_lost_selection_functions)
(Qx_sent_selection_functions): New vars.
(syms_of_xselect): DEFSYM them.
(x_handle_selection_request): Pass Qx_sent_selection_functions
rather than Vx_sent_selection_functions to Frun_hook_with_args.
(x_handle_selection_clear,x_clear_frame_selections):
Pass Qx_lost_selection_functions rather than
Vx_lost_selection_functions to Frun_hook_with_args.
2011-07-13 Paul Eggert <eggert@cs.ucla.edu> 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
* buffer.c (Fget_buffer_create): Initialized inhibit_shrinking. * buffer.c (Fget_buffer_create): Initialized inhibit_shrinking.
......
...@@ -112,6 +112,7 @@ static Lisp_Object QUTF8_STRING; /* This is a type of selection. */ ...@@ -112,6 +112,7 @@ static Lisp_Object QUTF8_STRING; /* This is a type of selection. */
static Lisp_Object Qcompound_text_with_extensions; static Lisp_Object Qcompound_text_with_extensions;
static Lisp_Object Qforeign_selection; static Lisp_Object Qforeign_selection;
static Lisp_Object Qx_lost_selection_functions, Qx_sent_selection_functions;
/* If this is a smaller number than the max-request-size of the display, /* If this is a smaller number than the max-request-size of the display,
emacs will use INCR selection transfer when the selection is larger emacs will use INCR selection transfer when the selection is larger
...@@ -855,7 +856,7 @@ x_handle_selection_request (struct input_event *event) ...@@ -855,7 +856,7 @@ x_handle_selection_request (struct input_event *event)
&& !EQ (Vx_sent_selection_functions, Qunbound)) && !EQ (Vx_sent_selection_functions, Qunbound))
{ {
Lisp_Object args[4]; Lisp_Object args[4];
args[0] = Vx_sent_selection_functions; args[0] = Qx_sent_selection_functions;
args[1] = selection_symbol; args[1] = selection_symbol;
args[2] = target_symbol; args[2] = target_symbol;
args[3] = success ? Qt : Qnil; args[3] = success ? Qt : Qnil;
...@@ -979,7 +980,7 @@ x_handle_selection_clear (struct input_event *event) ...@@ -979,7 +980,7 @@ x_handle_selection_clear (struct input_event *event)
/* Run the `x-lost-selection-functions' abnormal hook. */ /* Run the `x-lost-selection-functions' abnormal hook. */
{ {
Lisp_Object args[2]; Lisp_Object args[2];
args[0] = Vx_lost_selection_functions; args[0] = Qx_lost_selection_functions;
args[1] = selection_symbol; args[1] = selection_symbol;
Frun_hook_with_args (2, args); Frun_hook_with_args (2, args);
} }
...@@ -1020,7 +1021,7 @@ x_clear_frame_selections (FRAME_PTR f) ...@@ -1020,7 +1021,7 @@ x_clear_frame_selections (FRAME_PTR f)
{ {
/* Run the `x-lost-selection-functions' abnormal hook. */ /* Run the `x-lost-selection-functions' abnormal hook. */
Lisp_Object args[2]; Lisp_Object args[2];
args[0] = Vx_lost_selection_functions; args[0] = Qx_lost_selection_functions;
args[1] = Fcar (Fcar (t->Vselection_alist)); args[1] = Fcar (Fcar (t->Vselection_alist));
Frun_hook_with_args (2, args); Frun_hook_with_args (2, args);
...@@ -1033,7 +1034,7 @@ x_clear_frame_selections (FRAME_PTR f) ...@@ -1033,7 +1034,7 @@ x_clear_frame_selections (FRAME_PTR f)
&& EQ (frame, XCAR (XCDR (XCDR (XCDR (XCAR (XCDR (rest)))))))) && EQ (frame, XCAR (XCDR (XCDR (XCDR (XCAR (XCDR (rest))))))))
{ {
Lisp_Object args[2]; Lisp_Object args[2];
args[0] = Vx_lost_selection_functions; args[0] = Qx_lost_selection_functions;
args[1] = XCAR (XCAR (XCDR (rest))); args[1] = XCAR (XCAR (XCDR (rest)));
Frun_hook_with_args (2, args); Frun_hook_with_args (2, args);
XSETCDR (rest, XCDR (XCDR (rest))); XSETCDR (rest, XCDR (XCDR (rest)));
...@@ -2679,4 +2680,6 @@ A value of 0 means wait as long as necessary. This is initialized from the ...@@ -2679,4 +2680,6 @@ A value of 0 means wait as long as necessary. This is initialized from the
DEFSYM (QNULL, "NULL"); DEFSYM (QNULL, "NULL");
DEFSYM (Qcompound_text_with_extensions, "compound-text-with-extensions"); DEFSYM (Qcompound_text_with_extensions, "compound-text-with-extensions");
DEFSYM (Qforeign_selection, "foreign-selection"); DEFSYM (Qforeign_selection, "foreign-selection");
DEFSYM (Qx_lost_selection_functions, "x-lost-selection-functions");
DEFSYM (Qx_sent_selection_functions, "x-sent-selection-functions");
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment