Visuwesh <visuwe...@gmail.com> writes:

> Attached patch adds support for yanking LibreOffice Calc tables as Org
> tables.  Tables from docx files (or LO's equivalent) cannot be yanked
> though since the mimetype for them are richtext or HTML.

Thanks!

I just tried your patch (make repro) with a simple table

foo     bar     
1       2       3

I got

* This is test
| f\0o\0o\0 | \0b\0a\0r\0 | \0    |
| \01\0     | \02\0       | \03\0 |
| \0        |             |       |

Something is off with encoding.

> +(defun org--libreoffice-table-handler (_mimetype data)
> +  "Insert LibreOffice Calc table DATA as an Org table.
> +DATA is in the TSV format."
> +  (let ((beg (point)))
> +    (insert data)
> +    ;; LibreOffice source code defines
> +    ;; 'application/x-libreoffice-tsvc' as Text TSV-Calc so it should
> +    ;; be safe to handle this as TSV always.
> +    (org-table-convert-region beg (point) '(16))))

What if the point is in the middle of something else?
For example, in the middle of another table.
Then, conversion may yield wild outcomes.
Maybe it is safer to convert region in a temporary buffer and
insert the final result into the Org document being edited.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

Reply via email to