aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJuri Linkov2021-04-14 21:22:55 +0300
committerJuri Linkov2021-04-14 21:22:55 +0300
commit9b8a5070e5af506158e998e6125c3dab44fa8e5f (patch)
tree0abaf95e003d948543f6dc3019372d0211329af4 /src
parent94586ba26f8a50441349bf129362afa96b4cd5fe (diff)
downloademacs-9b8a5070e5af506158e998e6125c3dab44fa8e5f.tar.gz
emacs-9b8a5070e5af506158e998e6125c3dab44fa8e5f.zip
Don't error out when selection data is unavailable (bug#47642)
* src/xselect.c (x_get_window_property_as_lisp_data): Display a message and return nil when data is not available.
Diffstat (limited to 'src')
-rw-r--r--src/xselect.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/xselect.c b/src/xselect.c
index 030f6240712..cd6d86bdf4c 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -1482,14 +1482,21 @@ x_get_window_property_as_lisp_data (struct x_display_info *dpyinfo,
1482 = XGetSelectionOwner (display, selection_atom) != 0; 1482 = XGetSelectionOwner (display, selection_atom) != 0;
1483 unblock_input (); 1483 unblock_input ();
1484 if (there_is_a_selection_owner) 1484 if (there_is_a_selection_owner)
1485 signal_error ("Selection owner couldn't convert", 1485 {
1486 actual_type 1486 AUTO_STRING (format, "Selection owner couldn't convert: %s");
1487 ? list2 (target_type, 1487 CALLN (Fmessage, format,
1488 x_atom_to_symbol (dpyinfo, actual_type)) 1488 actual_type
1489 : target_type); 1489 ? list2 (target_type,
1490 x_atom_to_symbol (dpyinfo, actual_type))
1491 : target_type);
1492 return Qnil;
1493 }
1490 else 1494 else
1491 signal_error ("No selection", 1495 {
1492 x_atom_to_symbol (dpyinfo, selection_atom)); 1496 AUTO_STRING (format, "No selection: %s");
1497 CALLN (Fmessage, format, x_atom_to_symbol (dpyinfo, selection_atom));
1498 return Qnil;
1499 }
1493 } 1500 }
1494 1501
1495 if (actual_type == dpyinfo->Xatom_INCR) 1502 if (actual_type == dpyinfo->Xatom_INCR)