diff options
| author | Johan Bockgård | 2011-07-13 03:48:43 +0200 |
|---|---|---|
| committer | Johan Bockgård | 2011-07-13 03:48:43 +0200 |
| commit | cd18e7e3f49c014b83ffa5f2e4391a58ded6a287 (patch) | |
| tree | 2e7c41b204b9a72e46f99b304759866d3a93bcc7 | |
| parent | 2941c447ebada8126c27065f78c31895f69c738e (diff) | |
| download | emacs-cd18e7e3f49c014b83ffa5f2e4391a58ded6a287.tar.gz emacs-cd18e7e3f49c014b83ffa5f2e4391a58ded6a287.zip | |
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.
| -rw-r--r-- | src/ChangeLog | 12 | ||||
| -rw-r--r-- | src/xselect.c | 11 |
2 files changed, 19 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index e8824f3a15f..5bdc940a6f3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,15 @@ | |||
| 1 | 2011-07-13 Johan Bockgård <bojohan@gnu.org> | ||
| 2 | |||
| 3 | Fix execution of x selection hooks. | ||
| 4 | * xselect.c (Qx_lost_selection_functions) | ||
| 5 | (Qx_sent_selection_functions): New vars. | ||
| 6 | (syms_of_xselect): DEFSYM them. | ||
| 7 | (x_handle_selection_request): Pass Qx_sent_selection_functions | ||
| 8 | rather than Vx_sent_selection_functions to Frun_hook_with_args. | ||
| 9 | (x_handle_selection_clear,x_clear_frame_selections): | ||
| 10 | Pass Qx_lost_selection_functions rather than | ||
| 11 | Vx_lost_selection_functions to Frun_hook_with_args. | ||
| 12 | |||
| 1 | 2011-07-13 Paul Eggert <eggert@cs.ucla.edu> | 13 | 2011-07-13 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 14 | ||
| 3 | * buffer.c (Fget_buffer_create): Initialized inhibit_shrinking. | 15 | * buffer.c (Fget_buffer_create): Initialized inhibit_shrinking. |
diff --git a/src/xselect.c b/src/xselect.c index 7f4e0b40f62..5e5bdb55eca 100644 --- a/src/xselect.c +++ b/src/xselect.c | |||
| @@ -112,6 +112,7 @@ static Lisp_Object QUTF8_STRING; /* This is a type of selection. */ | |||
| 112 | static Lisp_Object Qcompound_text_with_extensions; | 112 | static Lisp_Object Qcompound_text_with_extensions; |
| 113 | 113 | ||
| 114 | static Lisp_Object Qforeign_selection; | 114 | static Lisp_Object Qforeign_selection; |
| 115 | static Lisp_Object Qx_lost_selection_functions, Qx_sent_selection_functions; | ||
| 115 | 116 | ||
| 116 | /* If this is a smaller number than the max-request-size of the display, | 117 | /* If this is a smaller number than the max-request-size of the display, |
| 117 | emacs will use INCR selection transfer when the selection is larger | 118 | emacs will use INCR selection transfer when the selection is larger |
| @@ -855,7 +856,7 @@ x_handle_selection_request (struct input_event *event) | |||
| 855 | && !EQ (Vx_sent_selection_functions, Qunbound)) | 856 | && !EQ (Vx_sent_selection_functions, Qunbound)) |
| 856 | { | 857 | { |
| 857 | Lisp_Object args[4]; | 858 | Lisp_Object args[4]; |
| 858 | args[0] = Vx_sent_selection_functions; | 859 | args[0] = Qx_sent_selection_functions; |
| 859 | args[1] = selection_symbol; | 860 | args[1] = selection_symbol; |
| 860 | args[2] = target_symbol; | 861 | args[2] = target_symbol; |
| 861 | args[3] = success ? Qt : Qnil; | 862 | args[3] = success ? Qt : Qnil; |
| @@ -979,7 +980,7 @@ x_handle_selection_clear (struct input_event *event) | |||
| 979 | /* Run the `x-lost-selection-functions' abnormal hook. */ | 980 | /* Run the `x-lost-selection-functions' abnormal hook. */ |
| 980 | { | 981 | { |
| 981 | Lisp_Object args[2]; | 982 | Lisp_Object args[2]; |
| 982 | args[0] = Vx_lost_selection_functions; | 983 | args[0] = Qx_lost_selection_functions; |
| 983 | args[1] = selection_symbol; | 984 | args[1] = selection_symbol; |
| 984 | Frun_hook_with_args (2, args); | 985 | Frun_hook_with_args (2, args); |
| 985 | } | 986 | } |
| @@ -1020,7 +1021,7 @@ x_clear_frame_selections (FRAME_PTR f) | |||
| 1020 | { | 1021 | { |
| 1021 | /* Run the `x-lost-selection-functions' abnormal hook. */ | 1022 | /* Run the `x-lost-selection-functions' abnormal hook. */ |
| 1022 | Lisp_Object args[2]; | 1023 | Lisp_Object args[2]; |
| 1023 | args[0] = Vx_lost_selection_functions; | 1024 | args[0] = Qx_lost_selection_functions; |
| 1024 | args[1] = Fcar (Fcar (t->Vselection_alist)); | 1025 | args[1] = Fcar (Fcar (t->Vselection_alist)); |
| 1025 | Frun_hook_with_args (2, args); | 1026 | Frun_hook_with_args (2, args); |
| 1026 | 1027 | ||
| @@ -1033,7 +1034,7 @@ x_clear_frame_selections (FRAME_PTR f) | |||
| 1033 | && EQ (frame, XCAR (XCDR (XCDR (XCDR (XCAR (XCDR (rest)))))))) | 1034 | && EQ (frame, XCAR (XCDR (XCDR (XCDR (XCAR (XCDR (rest)))))))) |
| 1034 | { | 1035 | { |
| 1035 | Lisp_Object args[2]; | 1036 | Lisp_Object args[2]; |
| 1036 | args[0] = Vx_lost_selection_functions; | 1037 | args[0] = Qx_lost_selection_functions; |
| 1037 | args[1] = XCAR (XCAR (XCDR (rest))); | 1038 | args[1] = XCAR (XCAR (XCDR (rest))); |
| 1038 | Frun_hook_with_args (2, args); | 1039 | Frun_hook_with_args (2, args); |
| 1039 | XSETCDR (rest, XCDR (XCDR (rest))); | 1040 | 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 | DEFSYM (QNULL, "NULL"); | 2680 | DEFSYM (QNULL, "NULL"); |
| 2680 | DEFSYM (Qcompound_text_with_extensions, "compound-text-with-extensions"); | 2681 | DEFSYM (Qcompound_text_with_extensions, "compound-text-with-extensions"); |
| 2681 | DEFSYM (Qforeign_selection, "foreign-selection"); | 2682 | DEFSYM (Qforeign_selection, "foreign-selection"); |
| 2683 | DEFSYM (Qx_lost_selection_functions, "x-lost-selection-functions"); | ||
| 2684 | DEFSYM (Qx_sent_selection_functions, "x-sent-selection-functions"); | ||
| 2682 | } | 2685 | } |