From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 2AmaLjNwDWf3XgAA62LTzQ:P1 (envelope-from ) for ; Mon, 14 Oct 2024 19:25:39 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id 2AmaLjNwDWf3XgAA62LTzQ (envelope-from ) for ; Mon, 14 Oct 2024 21:25:39 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=K0vm88GX; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1728933939; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=InVUkjTTYy9hlrump6ZySXEoeHtHOlKiW2CbOG/Cwnw=; b=AfnrLcm2x0pQvgBUD4zDfISJLBpVxh2C9UfCJsgnJHYHto5a+0uYFrdYCwtKUK+ztQB4yf qlyHawxQOCbu3chkbA8q9vmp4a6hb4aUq2xet3yBNy36++TWJ+JaLyg8DIBG4mgo0ep5F7 gCMjYL5B7tenJjuixBfDXYzZcX71sqUenUhebW1Novs5+7qI29squJK18ahLK0fSjEh0YD RgnuklzNX0WQaN7QLWzniEcw4rQA+b6yY4AhCA9NHdIZGkHy+EnQKCntL3YzKEPaBrfx+C ystQSowqw0X5l0r7Fgwy8v/tbVJtn+jQWin5tzdT5pGALd2+7VAkZhVW4k+2WA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1728933939; a=rsa-sha256; cv=none; b=YY+OshTMyatekMqKzlPU7K79Wo4MYZhfGKOTEPtQqNPrKKBBFY1UIT4MUuAUoEopi8KLka 7PeQxbOz1qq65xgbwLgFP/Srfm1yP2YUgFDR491YXvZVVzbdX6b7QklyfYepHtefJuk/Xj pBKmgOy3t7/5Fm1rscdo4pIVKRxyGyipgjeOAl07RQPgwgUH6Sobk0NtTI7Vwkmx34A0jM 0OzjalSTQql1WkTofo0tW/cGq/6cZwHmPooorAw7FgA0/72hmF5n8ERhbuzZe+B6OuJPxJ 57GCcWH7dQN2IIYlX1hLUH0ImY9zEzUieros5y0BfYnM6RMwFJGSzBFN4GF1XQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=K0vm88GX; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 9C9E286AFF for ; Mon, 14 Oct 2024 21:25:39 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t0QEt-0005zM-7z; Mon, 14 Oct 2024 14:56:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t0QEq-0005yo-T9 for emacs-orgmode@gnu.org; Mon, 14 Oct 2024 14:56:16 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t0QEo-00024P-Lm for emacs-orgmode@gnu.org; Mon, 14 Oct 2024 14:56:16 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 9D640240027 for ; Mon, 14 Oct 2024 20:56:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1728932172; bh=suheTZvNW7TCsTFjp+9brxGH6HNrr4JadwdDLzS6Ui8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=K0vm88GXQfJuQrfADF7Q9ozwC2DV4dacvZcU/poTxVTKLpix7bJDcAR1aYxP0TFzj AnTAcIViauFTGc1a4URxCy7FCpezfBjMXmR2hnGGs57CM8pIIKWQd26f41Fc+oKDYG +sa79ojOLFXdi87aee7uTu2saKykIzoxNnj0bpdr+vycDDdQIxVndmN7wD6u+DEybL sqhURCrZs2+MJpiLecJHz6ZZjtNDHkKVuMHxdzDB45DfrQDVX+vSJfOXQ1ZSxwdO4S KZDdk96CyIghaHlQDKxT1yleDNd43IqUEy7ZGIZVodtUzEM+u+LDG4fQ0fNZcHbeqJ LklcM8TUagHkg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4XS5zb4TgKz6tvk; Mon, 14 Oct 2024 20:56:11 +0200 (CEST) From: Ihor Radchenko To: Visuwesh Cc: org-mode-email Subject: Re: [PATCH] Add yank-media handler for LibreOffice Calc tables In-Reply-To: <87r08i3alo.fsf@gmail.com> References: <87r08i3alo.fsf@gmail.com> Date: Mon, 14 Oct 2024 18:58:02 +0000 Message-ID: <871q0ise9x.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -4.52 X-Spam-Score: -4.52 X-Migadu-Queue-Id: 9C9E286AFF X-Migadu-Scanner: mx13.migadu.com X-TUID: 8zZAfnKF9lz9 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 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 . Support Org development at , or support my work at