diff options
| author | Richard M. Stallman | 1997-05-01 01:58:47 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-05-01 01:58:47 +0000 |
| commit | 5a499696295db0e45cdbbd369deb1bb34148eb04 (patch) | |
| tree | f6e0bcc6c126220337fe788545c1a274db4e9be1 /src | |
| parent | e99db5a15cc84acda9f2a94285115bd68c11f507 (diff) | |
| download | emacs-5a499696295db0e45cdbbd369deb1bb34148eb04.tar.gz emacs-5a499696295db0e45cdbbd369deb1bb34148eb04.zip | |
(x_own_selection, x_reply_selection_request)
(x_get_foreign_selection):
Save value of x_catch_errors and pass to x_uncatch_errors.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xselect.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/xselect.c b/src/xselect.c index 09e14841599..2a94e2a7cde 100644 --- a/src/xselect.c +++ b/src/xselect.c | |||
| @@ -236,15 +236,16 @@ x_own_selection (selection_name, selection_value) | |||
| 236 | Time time = last_event_timestamp; | 236 | Time time = last_event_timestamp; |
| 237 | Atom selection_atom; | 237 | Atom selection_atom; |
| 238 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (selected_frame); | 238 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (selected_frame); |
| 239 | int count; | ||
| 239 | 240 | ||
| 240 | CHECK_SYMBOL (selection_name, 0); | 241 | CHECK_SYMBOL (selection_name, 0); |
| 241 | selection_atom = symbol_to_x_atom (dpyinfo, display, selection_name); | 242 | selection_atom = symbol_to_x_atom (dpyinfo, display, selection_name); |
| 242 | 243 | ||
| 243 | BLOCK_INPUT; | 244 | BLOCK_INPUT; |
| 244 | x_catch_errors (display); | 245 | count = x_catch_errors (display); |
| 245 | XSetSelectionOwner (display, selection_atom, selecting_window, time); | 246 | XSetSelectionOwner (display, selection_atom, selecting_window, time); |
| 246 | x_check_errors (display, "Can't set selection: %s"); | 247 | x_check_errors (display, "Can't set selection: %s"); |
| 247 | x_uncatch_errors (display); | 248 | x_uncatch_errors (display, count); |
| 248 | UNBLOCK_INPUT; | 249 | UNBLOCK_INPUT; |
| 249 | 250 | ||
| 250 | /* Now update the local cache */ | 251 | /* Now update the local cache */ |
| @@ -511,6 +512,7 @@ x_reply_selection_request (event, format, data, size, type) | |||
| 511 | int format_bytes = format/8; | 512 | int format_bytes = format/8; |
| 512 | int max_bytes = SELECTION_QUANTUM (display); | 513 | int max_bytes = SELECTION_QUANTUM (display); |
| 513 | struct x_display_info *dpyinfo = x_display_info_for_display (display); | 514 | struct x_display_info *dpyinfo = x_display_info_for_display (display); |
| 515 | int count; | ||
| 514 | 516 | ||
| 515 | if (max_bytes > MAX_SELECTION_QUANTUM) | 517 | if (max_bytes > MAX_SELECTION_QUANTUM) |
| 516 | max_bytes = MAX_SELECTION_QUANTUM; | 518 | max_bytes = MAX_SELECTION_QUANTUM; |
| @@ -527,7 +529,7 @@ x_reply_selection_request (event, format, data, size, type) | |||
| 527 | 529 | ||
| 528 | /* #### XChangeProperty can generate BadAlloc, and we must handle it! */ | 530 | /* #### XChangeProperty can generate BadAlloc, and we must handle it! */ |
| 529 | BLOCK_INPUT; | 531 | BLOCK_INPUT; |
| 530 | x_catch_errors (display); | 532 | x_catch_errors (display, count); |
| 531 | 533 | ||
| 532 | /* Store the data on the requested property. | 534 | /* Store the data on the requested property. |
| 533 | If the selection is large, only store the first N bytes of it. | 535 | If the selection is large, only store the first N bytes of it. |
| @@ -636,7 +638,7 @@ x_reply_selection_request (event, format, data, size, type) | |||
| 636 | } | 638 | } |
| 637 | 639 | ||
| 638 | XFlush (display); | 640 | XFlush (display); |
| 639 | x_uncatch_errors (display); | 641 | x_uncatch_errors (display, count); |
| 640 | UNBLOCK_INPUT; | 642 | UNBLOCK_INPUT; |
| 641 | } | 643 | } |
| 642 | 644 | ||
| @@ -1109,7 +1111,7 @@ x_get_foreign_selection (selection_symbol, target_type) | |||
| 1109 | Atom selection_atom = symbol_to_x_atom (dpyinfo, display, selection_symbol); | 1111 | Atom selection_atom = symbol_to_x_atom (dpyinfo, display, selection_symbol); |
| 1110 | Atom type_atom; | 1112 | Atom type_atom; |
| 1111 | int secs, usecs; | 1113 | int secs, usecs; |
| 1112 | int count = specpdl_ptr - specpdl; | 1114 | int count; |
| 1113 | Lisp_Object frame; | 1115 | Lisp_Object frame; |
| 1114 | 1116 | ||
| 1115 | if (CONSP (target_type)) | 1117 | if (CONSP (target_type)) |
| @@ -1118,7 +1120,7 @@ x_get_foreign_selection (selection_symbol, target_type) | |||
| 1118 | type_atom = symbol_to_x_atom (dpyinfo, display, target_type); | 1120 | type_atom = symbol_to_x_atom (dpyinfo, display, target_type); |
| 1119 | 1121 | ||
| 1120 | BLOCK_INPUT; | 1122 | BLOCK_INPUT; |
| 1121 | x_catch_errors (display); | 1123 | count = x_catch_errors (display); |
| 1122 | XConvertSelection (display, selection_atom, type_atom, target_property, | 1124 | XConvertSelection (display, selection_atom, type_atom, target_property, |
| 1123 | requestor_window, requestor_time); | 1125 | requestor_window, requestor_time); |
| 1124 | XFlush (display); | 1126 | XFlush (display); |
| @@ -1149,8 +1151,7 @@ x_get_foreign_selection (selection_symbol, target_type) | |||
| 1149 | 1151 | ||
| 1150 | BLOCK_INPUT; | 1152 | BLOCK_INPUT; |
| 1151 | x_check_errors (display, "Cannot get selection: %s"); | 1153 | x_check_errors (display, "Cannot get selection: %s"); |
| 1152 | x_uncatch_errors (display); | 1154 | x_uncatch_errors (display, count); |
| 1153 | unbind_to (count, Qnil); | ||
| 1154 | UNBLOCK_INPUT; | 1155 | UNBLOCK_INPUT; |
| 1155 | 1156 | ||
| 1156 | if (NILP (XCONS (reading_selection_reply)->car)) | 1157 | if (NILP (XCONS (reading_selection_reply)->car)) |
| @@ -1375,20 +1376,19 @@ x_get_window_property_as_lisp_data (display, window, property, target_type, | |||
| 1375 | there_is_a_selection_owner | 1376 | there_is_a_selection_owner |
| 1376 | = XGetSelectionOwner (display, selection_atom); | 1377 | = XGetSelectionOwner (display, selection_atom); |
| 1377 | UNBLOCK_INPUT; | 1378 | UNBLOCK_INPUT; |
| 1378 | while (1) /* Note debugger can no longer return, so this is obsolete */ | 1379 | Fsignal (Qerror, |
| 1379 | Fsignal (Qerror, | 1380 | there_is_a_selection_owner |
| 1380 | there_is_a_selection_owner ? | 1381 | ? Fcons (build_string ("selection owner couldn't convert"), |
| 1381 | Fcons (build_string ("selection owner couldn't convert"), | ||
| 1382 | actual_type | 1382 | actual_type |
| 1383 | ? Fcons (target_type, | 1383 | ? Fcons (target_type, |
| 1384 | Fcons (x_atom_to_symbol (dpyinfo, display, | 1384 | Fcons (x_atom_to_symbol (dpyinfo, display, |
| 1385 | actual_type), | 1385 | actual_type), |
| 1386 | Qnil)) | 1386 | Qnil)) |
| 1387 | : Fcons (target_type, Qnil)) | 1387 | : Fcons (target_type, Qnil)) |
| 1388 | : Fcons (build_string ("no selection"), | 1388 | : Fcons (build_string ("no selection"), |
| 1389 | Fcons (x_atom_to_symbol (dpyinfo, display, | 1389 | Fcons (x_atom_to_symbol (dpyinfo, display, |
| 1390 | selection_atom), | 1390 | selection_atom), |
| 1391 | Qnil))); | 1391 | Qnil))); |
| 1392 | } | 1392 | } |
| 1393 | 1393 | ||
| 1394 | if (actual_type == dpyinfo->Xatom_INCR) | 1394 | if (actual_type == dpyinfo->Xatom_INCR) |