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: Mon, 12 Apr 2021 19:03:48 +0300
>> 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?




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.