From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: `M-x yank-media' Date: Sun, 07 Nov 2021 15:57:11 +0200 Message-ID: <83k0hk83wo.fsf@gnu.org> References: <877ddlt2pp.fsf@gnus.org> <837ddk9tc8.fsf@gnu.org> <878ry0kt2h.fsf@gnus.org> <83r1bs85jr.fsf@gnu.org> <87sfw8jdl1.fsf@gnus.org> <83mtmg84kk.fsf@gnu.org> <875yt4jctz.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9627"; mail-complaints-to="usenet@ciao.gmane.io" Cc: alan@idiocy.org, emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 07 14:59:10 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mjihR-0002JC-VL for ged-emacs-devel@m.gmane-mx.org; Sun, 07 Nov 2021 14:59:10 +0100 Original-Received: from localhost ([::1]:48094 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjihQ-00028U-EJ for ged-emacs-devel@m.gmane-mx.org; Sun, 07 Nov 2021 08:59:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53302) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjifm-0000gA-3J for emacs-devel@gnu.org; Sun, 07 Nov 2021 08:57:26 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:45256) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjifk-00069R-Sh; Sun, 07 Nov 2021 08:57:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=254Febk7FOn0tIub53wAlbXIrC8I8/iTtjGLneo+JfM=; b=OznT2uKu2+5B EXdXYTbulKJePb+3qM27syVhUzY+YS5QWQAHD7RS7aObwIMokDluYkQDez3wVUHkrnI0ZAdjZu0OB IlxBD5qqygvHW2k5bkZFYK5mbmxl8Nnu8UxYx3st5aaergAaKt7tMZ3Aa3rT+8mxYRXopgn3yT/Fb PD3oeqFy8/SdarPOwIiZnzf3OEEMSnuMyadHBSsUe2HDUobE/V1k2mGJ4R6Coykg24ZAGqeCxzDeN 1SnGKzguroyu6iZy+5HIwlbZzxEqrjWPxNn4dXbWwG7RIAhCMgbvAt+PU2o03gPWO2nHXygRFv2ZT DIS4Qm7vXI8UP9o4glB4Gw==; Original-Received: from [87.69.77.57] (port=2000 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjifk-00016J-B8; Sun, 07 Nov 2021 08:57:24 -0500 In-Reply-To: <875yt4jctz.fsf@gnus.org> (message from Lars Ingebrigtsen on Sun, 07 Nov 2021 14:48:56 +0100) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:278951 Archived-At: > From: Lars Ingebrigtsen > Cc: emacs-devel@gnu.org, alan@idiocy.org > Date: Sun, 07 Nov 2021 14:48:56 +0100 > > Eli Zaretskii writes: > > > But those are just the types. How do we fetch the stuff afterwards? > > With > > (gui-get-selection 'CLIPBOARD 'image/png) > > and then some slight massaging; see yank-media--get-selection. I cannot figure out from that code what kind of "data" is expected from the above call. For example, if the data in the clipboard is an image? > > (gui-get-selection 'CLIPBOARD 'TARGETS) > > => > > [DataObject text/html HTML\ Format text/_moz_htmlinfo text/_moz_htmlcontext application/x-moz-file-promise-url application/x-moz-file-promise-dest-filename FILE_NAMES Preferred\ DropEffect application/x-moz-nativeimage DIB Ole\ Private\ Data BITMAP nil] > > > > (This is after "Copy Image" in Firefox.) But I suspect that's not all > > of the story. > > So that's why `yank-media' saying it can't find any matches, because > it's looking for "image/.*" (in Message buffers). Then that's non-portable, because this stuff is not standardized enough, AFAIK. We need more layers to hide platforms-specifics, I think. > It sounds like application/x-moz-file-promise-dest-filename (or one of > the other ones) might hold the file name where the image is? Does > > (gui-get-selection 'CLIPBOARD 'application/x-moz-file-promise-dest-filename) > > return anything? I don't expect it to, because I don't see any implementation for anything but text.