From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: `M-x yank-media' Date: Sun, 07 Nov 2021 14:32:42 +0100 Message-ID: <87sfw8jdl1.fsf@gnus.org> References: <877ddlt2pp.fsf@gnus.org> <837ddk9tc8.fsf@gnu.org> <878ry0kt2h.fsf@gnus.org> <83r1bs85jr.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20628"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Alan Third , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 07 14:35:22 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 1mjiKQ-000586-FP for ged-emacs-devel@m.gmane-mx.org; Sun, 07 Nov 2021 14:35:22 +0100 Original-Received: from localhost ([::1]:55962 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjiKP-0007pR-IO for ged-emacs-devel@m.gmane-mx.org; Sun, 07 Nov 2021 08:35:21 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48900) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjiHz-0002FS-HJ for emacs-devel@gnu.org; Sun, 07 Nov 2021 08:32:51 -0500 Original-Received: from quimby.gnus.org ([2a01:4f9:2b:f0f::2]:52888) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjiHx-0001XA-FR; Sun, 07 Nov 2021 08:32:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=tct/U6cfM2g1WspYAKIw9zvYlE/+b8dKIO+10pyVShU=; b=Tz0dns+lcyLPt6ZCkfwvhNev0u DbIlusUuQo2Pbe6AY1rc8NfX6Aj1ttyHUA5Ko7NoSZ/cZW6T1yDHQvsmllFDucOmN5qXs3w44izQ4 11gyxDjo4AcPVTAzIvMtEKi3cS+2jAbASBcRaSaU5ASdqU3Fqje02paYOK0ixjb7YNsc=; Original-Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mjiHr-0000fP-80; Sun, 07 Nov 2021 14:32:46 +0100 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAFVBMVEVXTlJKO0SjoVHZ 1tSfSk8oJCj///8ZqJQYAAAAAWJLR0QGYWa4fQAAAAd0SU1FB+ULBw0DATSo2T8AAAGxSURBVDjL ddPNcuMgDAdwcMgdteaeEvfeifcBTEa92zur93+V/sWHBzJdDrHDb4SEwMb8b/j6JPsy08DY8man eHsNyuOyruutn7BE+bnq+CXlJcPjZR1mXstgNjRKhQVA/UrT414A9VNPl68JGWpElrIL1+BPhTw8 7LmWpQbQFac+eQ+uws30gMptWWl12wCg9zz/heBtFLq3XqENaYjB/IcvwEPIYXK2DkSOvg4F3vQ4 xioU2qkP8wDbXt2wV0a9JqM3qQso4JI34fBpti+ArmvQMqe2kgNYcrzNKC0sfELeh/FbAuCuVdA2 G4LYZAEpZKjXwtCsBYcTyqVxelB4PeSEOl9O0MsJuk92XIECIBFg87WgCtdjRiLBR+LNVWRnfpal LM1bOQlvBeNfjPlU9DcFyaDzQTL4iG9Iz2nXVuv0Vd4A7qkQgoifIn8D8P43mpkzIKVC/BSha5A9 IhrwYSwO3FRAxFEB+zrQgZghBNtgAWj3AN9y2EAFOC56a72upMnPHHqxUvukw1lVBjRviqZeOxEr U4FECrfaT4w9NqA3JKYzZKqAv5f1EVOTHXX8AJ7ugDtRRlTiAAAAJXRFWHRkYXRlOmNyZWF0ZQAy MDIxLTExLTA3VDEzOjAzOjAxKzAwOjAwOU18VgAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMS0xMS0w N1QxMzowMzowMSswMDowMEgQxOoAAAAASUVORK5CYII= X-Now-Playing: Moon-Drenched's _Moon-Drenched_: "Get Thee To The Rookery" In-Reply-To: <83r1bs85jr.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 07 Nov 2021 15:21:44 +0200") Received-SPF: pass client-ip=2a01:4f9:2b:f0f::2; envelope-from=larsi@gnus.org; helo=quimby.gnus.org X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:278946 Archived-At: Eli Zaretskii writes: > What does this require from the clipboard to work? What are the > assumptions? It's basically this on GNU/Linux: (gui-get-selection 'CLIPBOARD 'TARGETS) => [TIMESTAMP TARGETS MULTIPLE SAVE_TARGETS text/html text/_moz_htmlinfo text/_moz_htmlcontext image/png image/jpeg image/bmp image/x-bmp image/x-MS-bmp image/x-icon image/x-ico image/x-win-bitmap image/vnd\.microsoft\.icon application/ico image/ico image/icon text/ico image/tiff] This lists the available media types. I've just had a quick peek at what happens in Macos, and it's very different there. (gui-get-selection 'CLIPBOARD 'TARGETS) => "http" So gui-get-selection (or rather, ns-get-selection) has to grow support for this? I know absolutely nothing about the internals of the clipboard on Macos, so I've added Alan to the CCs -- perhaps he has some insights here. It basically just calls: static Lisp_Object ns_get_foreign_selection (Lisp_Object symbol, Lisp_Object target) { id pb; pb = ns_symbol_to_pb (symbol); return pb != nil ? ns_string_from_pasteboard (pb) : Qnil; } Which seems geared towards text/plain only? I haven't looked at Windows, but I'm guessing it has to grow a similar set of capabilities. > AFAIK, that's what "other applications" do: they paste the content > from the clipboard regardless of the type. Fine-tuned behavior, where > the user can select exactly what he/she wants to past and how, is then > available from a context menu. Yes, but it would just be too surprising in an Emacs context, in my opinion. Changing how something as fundamental as `C-y' works here would potentially be extremely annoying. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no