Re: [PATCH] Add yank-media handler for LibreOffice Calc tables

2024-12-24 Thread Ihor Radchenko
Visuwesh writes: > Updated patch attached below. Applied, onto main. https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=7a9a060fde -- Ihor Radchenko // yantar92, Org mode maintainer, Learn more about Org mode at . Support Org development at

Re: [PATCH] Add yank-media handler for LibreOffice Calc tables

2024-12-23 Thread Visuwesh
s. Updated patch attached below. >From 39aeafc4b748110562044e9488097bf0b8de3a64 Mon Sep 17 00:00:00 2001 From: Visuwesh Date: Mon, 14 Oct 2024 22:04:23 +0530 Subject: [PATCH] Add `yank-media' handler for LibreOffice Calc tables * lisp/org.el (org--libreoffice-table-handler): Add new `yank-

Re: [PATCH] Add yank-media handler for LibreOffice Calc tables

2024-12-23 Thread Ihor Radchenko
Visuwesh writes: > Sorry for the late reply. I was busy with uni. No worries. My reply is no less late. For similar reasons. > I have now done this in the attached patch. I use a temporary buffer to > convert the table, and also decode it as per buffer-file-coding-system > of the Org buffer a

Re: [PATCH] Add yank-media handler for LibreOffice Calc tables

2024-11-29 Thread Visuwesh
; Ah, something like what Calc does. Yes, I will go with this approach. > Thanks for the suggestion. I have now done this in the attached patch. I use a temporary buffer to convert the table, and also decode it as per buffer-file-coding-system of the Org buffer as I could not tell whether Li

Re: [PATCH] Add yank-media handler for LibreOffice Calc tables

2024-10-21 Thread Visuwesh
[திங்கள் அக்டோபர் 21, 2024] Rens Oliemans wrote: > Visuwesh writes: > >> If possible, could you please try LibreOffice 7.6.4? The version Ihor >> has installed in his system. There is an AppImage available for you to >> try. > > Yep, on 7.6.4 the problem occurs. > > $ ./LibreOffice-7.6.4.1.b

Re: [PATCH] Add yank-media handler for LibreOffice Calc tables

2024-10-21 Thread Rens Oliemans
Visuwesh writes: > If possible, could you please try LibreOffice 7.6.4? The version Ihor > has installed in his system. There is an AppImage available for you to > try. Yep, on 7.6.4 the problem occurs. $ ./LibreOffice-7.6.4.1.basic-x86_64.AppImage --version LibreOffice 7.6.4.1 e19e193

Re: [PATCH] Add yank-media handler for LibreOffice Calc tables

2024-10-19 Thread Visuwesh
[சனி அக்டோபர் 19, 2024] Rens Oliemans wrote: > Visuwesh writes: > >> I hope someone else can reproduce this issue on their end. I do not have >> another Linux system in which I could freely install Emacs and test this >> out. > > I'm not familiar with yank-media in any way, but here are the resul

Re: [PATCH] Add yank-media handler for LibreOffice Calc tables

2024-10-19 Thread Rens Oliemans
Visuwesh writes: > I hope someone else can reproduce this issue on their end. I do not have > another Linux system in which I could freely install Emacs and test this > out. I'm not familiar with yank-media in any way, but here are the results of the commands you sent in this thread. They're all

Re: [PATCH] Add yank-media handler for LibreOffice Calc tables

2024-10-19 Thread Visuwesh
[சனி அக்டோபர் 19, 2024] Ihor Radchenko wrote: > Visuwesh writes: > >>> Debugger entered--returning value: >>> #("1\0\11\0002\0\11\0003\0\n\0004\0\11\0005\0\11\0006\0\n\0" 0 24 >>> (foreign-selection application/x-libreoffice-tsvc)) >>> (gui-get-selection PRIMARY application/x-libreoffice-tsvc

Re: [PATCH] Add yank-media handler for LibreOffice Calc tables

2024-10-19 Thread Ihor Radchenko
Visuwesh writes: >> Debugger entered--returning value: >> #("1\0\11\0002\0\11\0003\0\n\0004\0\11\0005\0\11\0006\0\n\0" 0 24 >> (foreign-selection application/x-libreoffice-tsvc)) >> (gui-get-selection PRIMARY application/x-libreoffice-tsvc) >> (progn (debug) (gui-get-selection 'PRIMARY >>

Re: [PATCH] Add yank-media handler for LibreOffice Calc tables

2024-10-19 Thread Visuwesh
[சனி அக்டோபர் 19, 2024] Ihor Radchenko wrote: > Visuwesh writes: > >> My LibreOffice version is >> >> % libreoffice --version >> LibreOffice 24.2.5.2 420(Build:2) > > LibreOffice 7.6.7.2 60(Build:2) It might not be the version after all... I downloaded the AppImage from https://appimage

Re: [PATCH] Add yank-media handler for LibreOffice Calc tables

2024-10-19 Thread Visuwesh
[சனி அக்டோபர் 19, 2024] Ihor Radchenko wrote: > Visuwesh writes: > >>> Also, do note that any text exceeding >>> `org-table-convert-region-max-lines' will lead to >>> `org-table-convert-region' throwing an error. >> >> Catching that and messaging the user should be sufficient? > > Maybe. Or we ma

Re: [PATCH] Add yank-media handler for LibreOffice Calc tables

2024-10-19 Thread Visuwesh
[சனி அக்டோபர் 19, 2024] Ihor Radchenko wrote: > Visuwesh writes: > >>> Here is the recipe >>> 1. make repro (I tried with the latest Emacs master and with Emacs 29) >>> 2. Open test.odt (attached) >>> 3. M-x org-mode >>> 4. Copy the non-empty cell area >>> 5. M-x yank-media app >>> 6. Observe e

Re: [PATCH] Add yank-media handler for LibreOffice Calc tables

2024-10-19 Thread Ihor Radchenko
Visuwesh writes: > My LibreOffice version is > > % libreoffice --version > LibreOffice 24.2.5.2 420(Build:2) LibreOffice 7.6.7.2 60(Build:2) >> As you can see, the data contains \0 characters. > > Just to be sure that yank-media is not in the middle of encoding > problem, can you say wh

Re: [PATCH] Add yank-media handler for LibreOffice Calc tables

2024-10-19 Thread Ihor Radchenko
Visuwesh writes: >> Also, do note that any text exceeding >> `org-table-convert-region-max-lines' will lead to >> `org-table-convert-region' throwing an error. > > Catching that and messaging the user should be sufficient? Maybe. Or we may catch and ask user to lift the restriction temporarily.

Re: [PATCH] Add yank-media handler for LibreOffice Calc tables

2024-10-19 Thread Ihor Radchenko
Visuwesh writes: >> Here is the recipe >> 1. make repro (I tried with the latest Emacs master and with Emacs 29) >> 2. Open test.odt (attached) >> 3. M-x org-mode >> 4. Copy the non-empty cell area >> 5. M-x yank-media app >> 6. Observe encoding problems > > Thanks for the reproducer. I think

Re: [PATCH] Add yank-media handler for LibreOffice Calc tables

2024-10-18 Thread Visuwesh
[வியாழன் அக்டோபர் 17, 2024] Ihor Radchenko wrote: > Visuwesh writes: > >>> Consider the following example: >>> >>> * Heading >>> >>> M-x yank-media ... will slurp the heading >>> >>> | * Heading a | b | c | >>> >>> In contrast, the existing handlers will only insert some text at point, >>> never

Re: [PATCH] Add yank-media handler for LibreOffice Calc tables

2024-10-17 Thread Ihor Radchenko
Visuwesh writes: >> Consider the following example: >> >> * Heading >> >> M-x yank-media ... will slurp the heading >> >> | * Heading a | b | c | >> >> In contrast, the existing handlers will only insert some text at point, >> never touching the text around. > > Would it be sufficient to uncondi

Re: [PATCH] Add yank-media handler for LibreOffice Calc tables

2024-10-17 Thread Visuwesh
[செவ்வாய் அக்டோபர் 15, 2024] Ihor Radchenko wrote: > Visuwesh writes: > >>> Something is off with encoding. >> >> I cannot reproduce it on my end. I tried with different documents and >> document types (Excel and LO format). Would it be possible to send the >> faulty file? > > Here is the recip

Re: [PATCH] Add yank-media handler for LibreOffice Calc tables

2024-10-15 Thread Ihor Radchenko
Visuwesh writes: >> Something is off with encoding. > > I cannot reproduce it on my end. I tried with different documents and > document types (Excel and LO format). Would it be possible to send the > faulty file? Here is the recipe 1. make repro (I tried with the latest Emacs master and with

Re: [PATCH] Add yank-media handler for LibreOffice Calc tables

2024-10-14 Thread Visuwesh
[திங்கள் அக்டோபர் 14, 2024] Ihor Radchenko wrote: > Visuwesh 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 j

Re: [PATCH] Add yank-media handler for LibreOffice Calc tables

2024-10-14 Thread Ihor Radchenko
Visuwesh 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

[PATCH] Add yank-media handler for LibreOffice Calc tables

2024-10-14 Thread Visuwesh
ate: Mon, 14 Oct 2024 22:04:23 +0530 Subject: [PATCH] Add `yank-media' handler for LibreOffice Calc tables * lisp/org.el (org--libreoffice-table-handler): Add new `yank-media' handler for tables copied from LibreOffice Calc documents. (org-setup-yank-dnd-handlers): Register it. * doc/org