From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: Yanking as HTML Date: Sun, 30 Oct 2016 12:18:18 +0100 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1477826928 17217 195.159.176.226 (30 Oct 2016 11:28:48 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 30 Oct 2016 11:28:48 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: YAMAMOTO Mitsuharu , Emacs developers To: Yuri Khan Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 30 12:28:41 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c0oHz-0002xw-Aa for ged-emacs-devel@m.gmane.org; Sun, 30 Oct 2016 12:28:35 +0100 Original-Received: from localhost ([::1]:57933 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c0oI2-00063B-0j for ged-emacs-devel@m.gmane.org; Sun, 30 Oct 2016 07:28:38 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43044) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c0oAb-0008RZ-43 for emacs-devel@gnu.org; Sun, 30 Oct 2016 07:21:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c0oAX-0005yc-51 for emacs-devel@gnu.org; Sun, 30 Oct 2016 07:20:57 -0400 Original-Received: from hermes.netfonds.no ([80.91.224.195]:53598) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c0oAW-0005yQ-UE for emacs-devel@gnu.org; Sun, 30 Oct 2016 07:20:53 -0400 Original-Received: from cm-84.215.1.64.getinternet.no ([84.215.1.64] helo=stories) by hermes.netfonds.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1c0oAS-0001YT-8q; Sun, 30 Oct 2016 12:20:51 +0100 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAKlBMVEWtbDPCMoft+/zqhBL9 //65rJDgfhTmxODrgg76/v7DPYP80w7///+wmW6SZg6WAAACKElEQVQ4jZXUwWvTUBgA8EfBobaC OXjZSR8bkpGDEHADT4oXpYciPCMaQRSzXQQnhIJEKIzJuwgaegnkoseedul2KIKWhpLyFbZDh8P0 f/H73suaxLmDH+WRfr9+yfe+NGFwTrAP8/n8BOCQMXYFYK3X67lTXAL2ezAYvIThRSllpwk3DMP4 Nlk2vgasriDZQvgYKLg2wSVgAwVTSZEpWF4rwQ8FDfiCOeNpCd5K6Um5qaFXgidSMil34aeRh4Z1 +KWgA3f/ghS7nSNYiwpXwxi7FXh1twx3EBLcBEPMyoA7XNfdSnlpUoWD6zlsEhxp2MdhHTzO4RPB toY9guMcOg8xN9XwnWBpS74RLYT3mBtr6CP0l6SsqXnRmJpHCmrHnoc3iTVgiutlw7gabyuwwpvO O855DGmkgsOQvrKhcNpCWAneYZcWZ64iYH6bwp3iZDJaZhs7NobLnDMgNbQ1JAuwz4NShRBOBXZe MEbgA6xmlYoLQgDCIyHEzC9X2PYtBdSYKIAu8S+Q8gw0iq6qUPtcdEXgtHLYqxddBbQPrPCpKxXC VpHlO/fTus7vr9obZXDgmYZ+clqhpusHkGg4WYCvCwBalH8dJ69s+7bnZWzk4wybCOnzQzazYCxU BKz8CN8vP86nB8MuX+Hc5BTRCi/gHmVMk4dmGKp/CUBXAf065BanbBiGCE19Zh5GZkglXJm1OFX3 wShOzVEcRXGKn2alq8pL5r/hDwddQm+A1OUtAAAAAElFTkSuQmCC In-Reply-To: (Yuri Khan's message of "Sun, 30 Oct 2016 16:59:15 +0600") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 80.91.224.195 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:208980 Archived-At: Yuri Khan writes: > On Sun, Oct 30, 2016 at 5:43 PM, Lars Ingebrigtsen wrote: > >> (gui-get-selection 'CLIPBOARD 'TARGETS) >> =3D> [TIMESTAMP TARGETS MULTIPLE SAVE_TARGETS UTF8_STRING >> COMPOUND_TEXT TEXT STRING] >> >> Hm... so it lacks the "text/html" target that xclip -o -t TARGETS >> lists? > > Your xclip invocation targets the PRIMARY selection (by default) while > the elisp snippet examines CLIPBOARD. This might be a reason for the > difference you observe. (gui-get-selection 'PRIMARY 'TARGETS) =3D> [TIMESTAMP TARGETS MULTIPLE text/html text/_moz_htmlcontext text/_moz_= htmlinfo UTF8_STRING COMPOUND_TEXT TEXT STRING text/x-moz-url-priv] Oh, yeah, there it is. (x-get-selection-internal 'PRIMARY 'text/html) =3D> #("\377\376
BY Josse= lin Moneyron Oct 27, 2016 =
" 0 620 (foreign-selection STRING)) Fun! Apparently the support for doing this is in Emacs already, but it needs some tweaking (the selection is in utf-16 or something and needs decoding before usage?), so the main issue is really one of user interface and not the low-level support (that much). > Note that, in general, it is impossible to correctly copy-paste styled > HTML between documents: > > * If you paste only the HTML, half the users will complain that =E2=80=9C= what > you get=E2=80=9D in the target document differs from =E2=80=9Cwhat you se= e=E2=80=9D of the > source document. Well... People know that Emacs isn't a wysiwyg editor, so I don't think that is a complaint that will be common. The complaint will be 50% "why is it outputting all this HTML junk into my buffer?" and 50% "why isn't it outputting any HTML into my buffer?" :-) So creating a user interface that for this that annoys the least number of people is what's important. And it could even be a total opt-in thing, like a global minor mode like, er, `clever-yank-mode'. What about drag-and-drop? Is that basically the same as selections? If I were to drag an image from Firefox to this Message mode buffer, is it feasible to make that do something useful? --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no