GNU bug report logs - #47642
28.0.50; (error "Selection owner couldn't convert" UTF8_STRING)

Previous Next

Package: emacs;

Reported by: Jean Louis <bugs <at> gnu.support>

Date: Wed, 7 Apr 2021 17:57:01 UTC

Severity: minor

Tags: fixed

Fixed in version 28.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 47642 <at> debbugs.gnu.org, Jean Louis <bugs <at> gnu.support>
Subject: bug#47642: 28.0.50; (error "Selection owner couldn't convert" UTF8_STRING)
Date: Tue, 13 Apr 2021 19:20:47 +0300
[Message part 1 (text/plain, inline)]
>> I wonder why this error should be raised at all
>> instead of just returning nil?
>
> That's a really good point -- this low-level error surely can't be of
> interest to the Emacs user.  So you're right -- it should just return
> nil here.

Here's the patch that does this:

[selection_owner.patch (text/x-diff, inline)]
diff --git a/src/xselect.c b/src/xselect.c
index 030f624071..cd6d86bdf4 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,
 	= XGetSelectionOwner (display, selection_atom) != 0;
       unblock_input ();
       if (there_is_a_selection_owner)
-	signal_error ("Selection owner couldn't convert",
-		      actual_type
-		      ? list2 (target_type,
-			       x_atom_to_symbol (dpyinfo, actual_type))
-		      : target_type);
+	{
+	  AUTO_STRING (format, "Selection owner couldn't convert: %s");
+	  CALLN (Fmessage, format,
+		 actual_type
+		 ? list2 (target_type,
+			  x_atom_to_symbol (dpyinfo, actual_type))
+		 : target_type);
+	  return Qnil;
+	}
       else
-	signal_error ("No selection",
-		      x_atom_to_symbol (dpyinfo, selection_atom));
+	{
+	  AUTO_STRING (format, "No selection: %s");
+	  CALLN (Fmessage, format, x_atom_to_symbol (dpyinfo, selection_atom));
+	  return Qnil;
+	}
     }
 
   if (actual_type == dpyinfo->Xatom_INCR)

This bug report was last modified 4 years and 37 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.