unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: Jean Louis <bugs@gnu.support>, 47642@debbugs.gnu.org
Subject: bug#47642: 28.0.50; (error "Selection owner couldn't convert" UTF8_STRING)
Date: Tue, 13 Apr 2021 19:20:47 +0300	[thread overview]
Message-ID: <87lf9m88i8.fsf@mail.linkov.net> (raw)
In-Reply-To: <87a6q2tzcb.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 13 Apr 2021 09:31:32 +0200")

[-- Attachment #1: Type: text/plain, Size: 278 bytes --]

>> 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:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: selection_owner.patch --]
[-- Type: text/x-diff, Size: 1035 bytes --]

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)

  reply	other threads:[~2021-04-13 16:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-07 17:51 bug#47642: 28.0.50; (error "Selection owner couldn't convert" UTF8_STRING) Jean Louis
2021-04-07 19:37 ` Eli Zaretskii
2021-04-13  5:37   ` Jean Louis
2021-04-07 19:58 ` Juri Linkov
2021-04-12 10:11   ` Lars Ingebrigtsen
2021-04-12 16:03     ` Juri Linkov
2021-04-13  7:31       ` Lars Ingebrigtsen
2021-04-13 16:20         ` Juri Linkov [this message]
2021-04-14 18:23           ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lf9m88i8.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=47642@debbugs.gnu.org \
    --cc=bugs@gnu.support \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).