GNU bug report logs - #71909
30.0.60; Can not use yank-media for pasting image from clipboad in org-mode on Windows platform

Previous Next

Package: emacs;

Reported by: Eason Huang <aqua0210 <at> foxmail.com>

Date: Wed, 3 Jul 2024 04:47:01 UTC

Severity: wishlist

Found in version 30.0.60

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #37 received at 71909 <at> debbugs.gnu.org (full text, mbox):

From: Visuwesh <visuweshm <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: cpardo <at> imayhem.com, 71909 <at> debbugs.gnu.org
Subject: Re: bug#71909: 30.0.60;
Date: Sun, 06 Oct 2024 17:45:51 +0530
[ஞாயிறு அக்டோபர் 06, 2024] Eli Zaretskii wrote:

>> From: Visuwesh <visuweshm <at> gmail.com>
>> Cc: Cecilio Pardo <cpardo <at> imayhem.com>,  71909 <at> debbugs.gnu.org
>> Date: Sun, 06 Oct 2024 16:12:03 +0530
>> 
>> What happens when you copy text from, say, MS Office with formatting
>> applied to it (bold, italic, whatever)?  The same with MS Office Excel.
>> I was thinking of eventually™ writing handlers for LibreOffice when
>> copying over table cells for org-mode.
>
> That requires Emacs to know about Rich Text, and to be able to convert
> that to Emacs faces.

Which I hope someone will eventually do something about.  When
yank-media was first mentioned among org-mode users, one of the first
question was "Can it paste text copied from the browser in org-mode
format?" (i.e., convert bold text to *bold text*)

>> When copying rich text from LibreOffice's MS Word equivalent,
>> yank-media-types reports:
>> 
>>     Possible completions are:
>>     primary:text/html
>>     clipboard:application/x-openoffice-link;windows_formatname="Link"
>>     clipboard:application/x-openoffice-embed-source-xml;windows_formatname="Star Embed Source (XML)"
>>     clipboard:TIMESTAMP
>>[...]
> It is similar with Word on Windows, but the names of the formats are
> different.
>
> Also, if "primary:" means this is available in the PRIMARY selection,
> then we are only talking about CLIPBOARD.  

Yes, it means the PRIMARY selection.  For some reason, yank-media also
seems to consider the PRIMARY selection?  When I did M-x yank-media RET
in a html-mode buffer, it pasted the above text/html data.

> Try
>
>   M-: (gui-get-selection 'CLIPBOARD 'TARGETS) RET
>
> instead.
>
>> where text/html is the most useful.
>
> no, the most useful is Rich Text, but Emacs cannot yet yank that.

Possibly.  But we could at least "hijack" shr to convert text/html to
string with text properties on it, or make it insert markup elements.
I've done the later as a personal hack and it works fairly well.

>> When I copy a few table cells from LibreOffice's MS Excel equivalent, it
>> reports:
>> 
>>     Possible completions are:
>> [...]
>> image/png is, well, an image of the copied cells, and text/html has a
>> (an?) HTML table.
>
> On Windows, I see CSV, which I think is more useful (maybe tsvc above
> is something similar).  

You are right.  It pasted a TSV formatted text.  I missed it in the long
list of items.

> You definitely do NOT want an image in this case.

Definitely not.  I simply found it amusing that LibreOffice offered it
as a potential candidate.




This bug report was last modified 260 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.