all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Visuwesh <visuweshm@gmail.com>
Cc: cpardo@imayhem.com, 71909@debbugs.gnu.org
Subject: bug#71909: 30.0.60;
Date: Sun, 06 Oct 2024 14:50:49 +0300	[thread overview]
Message-ID: <86bjzxv49y.fsf@gnu.org> (raw)
In-Reply-To: <87ldz1h5s4.fsf@gmail.com> (message from Visuwesh on Sun, 06 Oct 2024 16:12:03 +0530)

> From: Visuwesh <visuweshm@gmail.com>
> Cc: Cecilio Pardo <cpardo@imayhem.com>,  71909@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.

> 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
>     primary:STRING
>     primary:TEXT
>     primary:TIMESTAMP
>     primary:UTF8_STRING
>     primary:application/x-openoffice-embed-source-xml;windows_formatname="Star Embed Source (XML)"
>     primary:application/x-openoffice-objectdescriptor-xml;windows_formatname="Star Object Descriptor (XML)";classname="8BC6B165-B1B2-4EDD-aa47-dae2ee689dd6";typename="LibreOffice 24.2 Text Document";displayname="file:///home/viz/tmp/User_Manual.docx";viewaspect="1";width="17000";height="3000";posx="0";posy="0"
>     primary:text/plain
>     primary:text/plain;charset=utf-16
>     primary:text/plain;charset=utf-8
>     primary:text/richtext
>     primary:text/rtf

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.  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.

> When I copy a few table cells from LibreOffice's MS Excel equivalent, it
> reports:
> 
>     Possible completions are:
>     clipboard:application/x-openoffice-link;windows_formatname="Link"
>     clipboard:application/x-openoffice-embed-source-xml;windows_formatname="Star Embed Source (XML)"
>     clipboard:STRING
>     clipboard:TEXT
>     clipboard:TIMESTAMP
>     clipboard:UTF8_STRING
>     clipboard:application/x-libreoffice-tsvc
>     clipboard:application/x-openoffice-bitmap;windows_formatname="Bitmap"
>     clipboard:application/x-openoffice-dif;windows_formatname="DIF"
>     clipboard:application/x-openoffice-emf;windows_formatname="Image EMF"
>     clipboard:application/x-openoffice-gdimetafile;windows_formatname="GDIMetaFile"
>     clipboard:application/x-openoffice-objectdescriptor-xml;windows_formatname="Star Object Descriptor (XML)";classname="47BBB4CB-CE4C-4E80-a591-42d9ae74950f";typename="LibreOffice 24.2 Spreadsheet";displayname="file:///home/viz/doc/uni/pincer/convergence_for_Mn-1.ods";viewaspect="1";width="15846";height="4065";posx="0";posy="0"
>     clipboard:application/x-openoffice-sylk;windows_formatname="Sylk"
>     clipboard:application/x-openoffice-wmf;windows_formatname="Image WMF"
>     clipboard:image/bmp
>     clipboard:image/png
>     clipboard:text/html
>     clipboard:text/plain
>     clipboard:text/plain;charset=utf-16
>     clipboard:text/plain;charset=utf-8
>     clipboard:text/richtext
>     clipboard:text/rtf
>     primary:CLASS
>     primary:COMPOUND_TEXT
>     primary:HOST_NAME
>     primary:LENGTH
>     primary:NAME
>     primary:OWNER_OS
>     primary:STRING
>     primary:TEXT
>     primary:TIMESTAMP
>     primary:USER
>     primary:UTF8_STRING
>     primary:text/plain
>     primary:text/plain;charset=utf-8
> 
> 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 definitely do NOT want an image in this
case.





  parent reply	other threads:[~2024-10-06 11:50 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <865xtnhyn6.fsf@foxmail.com>
2024-10-05 12:28 ` bug#71909: 30.0.60; Cecilio Pardo
2024-10-05 12:33   ` Eli Zaretskii
2024-10-05 12:42     ` Eli Zaretskii
2024-10-05 17:14       ` Cecilio Pardo
2024-10-05 19:31         ` Eli Zaretskii
2024-10-05 21:24           ` Cecilio Pardo
2024-10-06  5:59             ` Eli Zaretskii
     [not found]               ` <87ldz1h5s4.fsf@gmail.com>
2024-10-06 11:50                 ` Eli Zaretskii [this message]
2024-10-06 12:15                   ` Visuwesh
2024-10-20 13:09                     ` Ihor Radchenko
2024-10-20 13:51                       ` Eli Zaretskii
2024-10-20 13:59                         ` Ihor Radchenko
2024-10-20 14:22                           ` Eli Zaretskii
2024-10-20 15:02                             ` Ihor Radchenko
2024-10-20 15:34                               ` Eli Zaretskii
2024-10-20 15:57                                 ` Ihor Radchenko
2024-10-20 17:50                                   ` Visuwesh
2024-10-20 17:59                                     ` Eli Zaretskii
2024-10-20 17:16                       ` Cecilio Pardo
2024-10-20 17:58                         ` Eli Zaretskii
2024-10-07 10:24               ` Cecilio Pardo
2024-10-07 11:58                 ` Eli Zaretskii
2024-10-09 12:52                   ` Cecilio Pardo
2024-10-09 13:40                     ` Eli Zaretskii
2024-10-23 23:13                       ` bug#71909: 30.0.60; yank-media on MS-Windows Cecilio Pardo
2024-10-24  7:18                         ` Eli Zaretskii
2024-10-24  8:39                           ` Cecilio Pardo
2024-10-24  9:38                             ` Eli Zaretskii
2024-10-24 10:43                               ` Cecilio Pardo
2024-10-10 10:04     ` bug#71909: 30.0.60; Cecilio Pardo
2024-10-10 10:49       ` Eli Zaretskii
2024-10-28 21:46   ` Cecilio Pardo
2024-10-29 14:25     ` Eli Zaretskii
2024-10-29 14:55       ` Eli Zaretskii
2024-10-30  9:05       ` Cecilio Pardo
2024-10-30 15:35         ` Eli Zaretskii
2024-10-30 15:49           ` Cecilio Pardo
2024-11-02  0:23           ` Cecilio Pardo
2024-11-02 10:44             ` Eli Zaretskii
2024-11-02 11:24               ` Cecilio Pardo
2024-11-02 12:09                 ` Eli Zaretskii
2024-11-02 20:30                   ` Cecilio Pardo
2024-11-03 13:14                     ` Eli Zaretskii
2024-11-04 22:19                       ` Cecilio Pardo
2024-11-05 12:30                         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86bjzxv49y.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=71909@debbugs.gnu.org \
    --cc=cpardo@imayhem.com \
    --cc=visuweshm@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.