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: Mon, 12 Apr 2021 19:03:48 +0300	[thread overview]
Message-ID: <87k0p73e1n.fsf@mail.linkov.net> (raw)
In-Reply-To: <87im4ryfqn.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 12 Apr 2021 12:11:28 +0200")

>> after copying an image in Gimp, then exiting Gimp, and trying to paste
>> in Emacs.
>
> I was unable to reproduce that (on Debian/bullseye) -- I just get nil
> back from
>
> (x-get-selection-internal 'CLIPBOARD 'UTF8_STRING nil nil)
>
> no matter whether Gimp is running or not (after choosing Edit -> Copy).

Here is a complete test case with 100% reproducibility:

1. In GIMP 2.10.18 on Ubuntu create a new image
2. Select a rectangle
3. Copy with Ctrl+C or Edit -> Copy

4. in 'emacs -Q' version 28, GTK+ version 3.24.20
5. evaluating (x-get-selection-internal 'CLIPBOARD 'UTF8_STRING nil nil)
   returns nil

6. quit Gimp
7. evaluate the same (x-get-selection-internal 'CLIPBOARD 'UTF8_STRING nil nil)
8. it fails with

Debugger entered--Lisp error: (error "Selection owner couldn't convert" UTF8_STRING)
  x-get-selection-internal(CLIPBOARD UTF8_STRING nil nil)
  (progn (x-get-selection-internal 'CLIPBOARD 'UTF8_STRING nil nil))
  eval((progn (x-get-selection-internal 'CLIPBOARD 'UTF8_STRING nil nil)) t)
  elisp--eval-last-sexp(nil)
  eval-last-sexp(nil)
  funcall-interactively(eval-last-sexp nil)
  call-interactively(eval-last-sexp nil nil)
  command-execute(eval-last-sexp)

This is strange since there is no owner anymore, the selection owner was closed.

It's a big problem for me because I customized
save-interprogram-paste-before-kill to t, and I can't
use copy/paste in Emacs anymore after this error,
because I raises the same error on trying to copy a new text,
so even can't overwrite the old unavailable selection
with a new one in Emacs.  Then I need to switch to
some other app, copy some text from it to the clipboard,
that fixes the broken state of copy/paste in Emacs.

> In any case -- I'm not sure there's anything we can do on the Emacs
> side...  except perhaps change the error message?  "Couldn't convert"
> isn't really informative.  "Couldn't get selection from selection
> owner", perhaps?

I wonder why this error should be raised at all
instead of just returning nil?





  reply	other threads:[~2021-04-12 16:03 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 [this message]
2021-04-13  7:31       ` Lars Ingebrigtsen
2021-04-13 16:20         ` Juri Linkov
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=87k0p73e1n.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).