From unknown Sun Jun 22 00:48:49 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#38616] emacs: fix odt export Resent-From: anothersms@gmail.com (=?UTF-8?Q?Nicol=C3=B2?= Balzarotti) Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 14 Dec 2019 23:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 38616 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 38616@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.157636712330340 (code B ref -1); Sat, 14 Dec 2019 23:46:01 +0000 Received: (at submit) by debbugs.gnu.org; 14 Dec 2019 23:45:23 +0000 Received: from localhost ([127.0.0.1]:35889 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1igH6A-0007tH-Tq for submit@debbugs.gnu.org; Sat, 14 Dec 2019 18:45:23 -0500 Received: from lists.gnu.org ([209.51.188.17]:56032) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1igH68-0007t9-HD for submit@debbugs.gnu.org; Sat, 14 Dec 2019 18:45:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39657) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igH66-00031f-8Z for guix-patches@gnu.org; Sat, 14 Dec 2019 18:45:20 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_20,FREEMAIL_FROM, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igH64-0005aP-6n for guix-patches@gnu.org; Sat, 14 Dec 2019 18:45:18 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:35885) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1igH62-0005YF-DW for guix-patches@gnu.org; Sat, 14 Dec 2019 18:45:15 -0500 Received: by mail-wr1-x42e.google.com with SMTP id z3so2872707wru.3 for ; Sat, 14 Dec 2019 15:45:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=TJq7Q7ZbA53y1YE6p4dVv6MVmqdFo/sarCKAYx/nvUY=; b=ub2WNYZQU4anOCLdoWok6tLgeE1XCxMguOkiDBqK6xSZ9dt+fHyLYDjMACDOzIGKK8 s5Jv11zqVKZgSkWg5E3mC4/LHVaMCCQMyPgkSUnCmQt/Tux8Wpk8ywB+KO9n9S3j8aQW rY3vN37p25u3j4F+yHZoEUAZSv0ufjHHvyYrsrgAqDHmXotn/PAZ98r5KlhoUXoxhW1r b7q4WQzS1JOzkBM4lYjLOUr8AnSgHZyoyHU7eY2xz9+BrCS0M6ayis2G0QKT1wst/Ipf 04lJUO675wHk5QsdpSyR9VAJRozYjAIRIuAhTLYgElR0cgYiKlMgSEPLYzsBY9K25sUK DhXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=TJq7Q7ZbA53y1YE6p4dVv6MVmqdFo/sarCKAYx/nvUY=; b=aWuZL8qLESXj/fFazCnzYApXHZ3y/Hxmai56D8NBQdkRrGRDrHiDE+EoQ+fwN40gFt Vr/AJsb5bSlYIpVEpfNQR99B5bBa+g0ODeCCdmRIPCLNUm54754rLgiH/eiM1r3ao/B+ Wya+bEdN790i7MKsVQValbXENwf7GiAy/jT5aRbxDyvZacYrdISwh0xX9bzffA5L5a0D CRpCoFFYQa/sHsN9SKgyBupJSHA0nVwVxDkBRhXMpsQHz8M1/R3OCm5DQXAKkTBiWgXQ ba5TNTywwgNOhwDKqsMDcmcm9EX5tgk0Mvtsk5mWPyvFI2Ys/78eCGYNbP4l1YqaUv7B +HeA== X-Gm-Message-State: APjAAAUhm0c/CHK1G+MrWwR5cIFlXeR7mq16VcCW32eY9AfaFpPtaFY0 Uty5Rdskg4qpnlY2ARMxEQBnCRm9Szo= X-Google-Smtp-Source: APXvYqylgDzat1aTWfPURpq1TAxyAB//gIe/bX5C8SMvFKgKKhj+cD5nIJNlUlZK9G+CG0LntBX3hw== X-Received: by 2002:adf:e40f:: with SMTP id g15mr22481803wrm.223.1576367112010; Sat, 14 Dec 2019 15:45:12 -0800 (PST) Received: from guixSD (host1-200-dynamic.5-87-r.retail.telecomitalia.it. [87.5.200.1]) by smtp.gmail.com with ESMTPSA id b17sm15749388wrp.49.2019.12.14.15.45.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Dec 2019 15:45:11 -0800 (PST) From: anothersms@gmail.com (=?UTF-8?Q?Nicol=C3=B2?= Balzarotti) Date: Sun, 15 Dec 2019 00:45:09 +0100 Message-ID: <87a77ueaka.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42e X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello Guix! Neither on NixOS or in guix I've ever been able to export an org file to otd. The error was 'OpenDocument export failed: Buffer is read-only: #'. I've seen some report of this error on the web, like: - https://lists.gnu.org/archive/html/emacs-orgmode/2018-05/msg00545.html - https://github.com/syl20bnr/spacemacs/issues/1482 but also on our IRC: - http://logs.guix.gnu.org/guix/2019-05-07.log - http://logs.guix.gnu.org/guix/2019-07-25.log but I was not able to find a fix for it. Today I checked the source and figured it out. The explanation, as written in the patch, is the following > Files inside the guix store are read only. "styles.xml" is copied from the > store (/share/emacs/26.3/etc/org/OrgOdtStyles.xml), so it's read only too. > ox-odt needs this file, so if it's not writable it will fail. This patch > adjust the permissions. So, this patches fixes the permissions on the file. I've two questions: 1. Is it fine to have a .patch, or should I add a phase where I fix the file? this seemed to be easier 2. If the same error happens for other programs, might it make sense to "fake" rw permissions in the store (by using a virtual fs or something) so that files are copied as rw, but files in the store are still ro? Thanks! Nicol=C3=B2 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-gnu-packages-emascs.scm-emacs-patches-Fix-odt-export.patch >From c1ad3fff9bda5935651f26e460907a77d1b3d003 Mon Sep 17 00:00:00 2001 From: nixo Date: Sat, 14 Dec 2019 15:17:11 +0100 Subject: [PATCH] * gnu/packages/emascs.scm (emacs)[patches]: Fix odt export. ox-odt copyes the file /share/emacs/26.3/etc/org/OrgOdtStyles.xml under /tmp/odt-*/styles.xml and tries to modify it. Since files in the guix store are read-only, it will fail. This patch fixes the export by adjusting permissions during the export. --- gnu/packages/emacs.scm | 1 + .../patches/emacs-fix-odt-export.patch | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 gnu/packages/patches/emacs-fix-odt-export.patch diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index eba7f88551..8183b69eb3 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -80,6 +80,7 @@ "119ldpk7sgn9jlpyngv5y4z3i7bb8q3xp4p0qqi7i5nq39syd42d")) (patches (search-patches "emacs-exec-path.patch" "emacs-fix-scheme-indent-function.patch" + "emacs-fix-odt-export.patch" "emacs-source-date-epoch.patch")) (modules '((guix build utils))) (snippet diff --git a/gnu/packages/patches/emacs-fix-odt-export.patch b/gnu/packages/patches/emacs-fix-odt-export.patch new file mode 100644 index 0000000000..0c3c44a2e3 --- /dev/null +++ b/gnu/packages/patches/emacs-fix-odt-export.patch @@ -0,0 +1,25 @@ +Files inside the guix store are read only. "styles.xml" is copied from the +store (/share/emacs/26.3/etc/org/OrgOdtStyles.xml), so it's read only too. +ox-odt needs this file, so if it's not writable it will fail. This patch +adjust the permissions. + +--- + lisp/org/ox-odt.el | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/lisp/org/ox-odt.el b/lisp/org/ox-odt.el +index f9c4a93cc8..61988ffcc4 100644 +--- a/lisp/org/ox-odt.el ++++ b/lisp/org/ox-odt.el +@@ -1384,6 +1384,8 @@ original parsed data. INFO is a plist holding export options." + ;; create a manifest entry for styles.xml + (org-odt-create-manifest-file-entry "text/xml" "styles.xml") + ++ ;; guix store files are ro. This file need to be modified, make it rw ++ (set-file-modes (concat org-odt-zip-dir "styles.xml") #o600) + ;; FIXME: Who is opening an empty styles.xml before this point? + (with-current-buffer + (find-file-noselect (concat org-odt-zip-dir "styles.xml") t) +-- +2.24.0 + -- 2.24.0 --=-=-=-- From unknown Sun Jun 22 00:48:49 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#38616] emacs: fix odt export Resent-From: Jelle Licht Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 15 Dec 2019 14:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38616 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: =?UTF-8?Q?Nicol=C3=B2?= Balzarotti , 38616@debbugs.gnu.org Received: via spool by 38616-submit@debbugs.gnu.org id=B38616.15764198376654 (code B ref 38616); Sun, 15 Dec 2019 14:24:02 +0000 Received: (at 38616) by debbugs.gnu.org; 15 Dec 2019 14:23:57 +0000 Received: from localhost ([127.0.0.1]:36052 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1igUoP-0001jG-8j for submit@debbugs.gnu.org; Sun, 15 Dec 2019 09:23:57 -0500 Received: from mail1.fsfe.org ([217.69.89.151]:46046) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1igUoK-0001ix-Sx for 38616@debbugs.gnu.org; Sun, 15 Dec 2019 09:23:56 -0500 From: Jelle Licht In-Reply-To: <87a77ueaka.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me> References: <87a77ueaka.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me> Date: Sun, 15 Dec 2019 15:23:48 +0100 Message-ID: <87a77thdl7.fsf@jlicht.xyz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) Hello Nichol=C3=B2, anothersms@gmail.com (Nicol=C3=B2 Balzarotti) writes: > Hello Guix! > > Neither on NixOS or in guix I've ever been able to export an org file to > otd. The error was > 'OpenDocument export failed: Buffer is read-only: #'. > > I've seen some report of this error on the web, like: > - https://lists.gnu.org/archive/html/emacs-orgmode/2018-05/msg00545.html > - https://github.com/syl20bnr/spacemacs/issues/1482 > > but also on our IRC: > - http://logs.guix.gnu.org/guix/2019-05-07.log > - http://logs.guix.gnu.org/guix/2019-07-25.log > but I was not able to find a fix for it. > > Today I checked the source and figured it out. The explanation, as > written in the patch, is the following > >> Files inside the guix store are read only. "styles.xml" is copied from t= he >> store (/share/emacs/26.3/etc/org/OrgOdtStyles.xml), so it's read only to= o. >> ox-odt needs this file, so if it's not writable it will fail. This patch >> adjust the permissions. Thanks for figuring this out! I've been using my local (terrible) workarounds for years to make this work. > > So, this patches fixes the permissions on the file. > > I've two questions: > 1. Is it fine to have a .patch, or should I add a phase where I fix the > file? this seemed to be easier I can't really advise on the best way forward here, but if you do decide to go with the .patch route, you should probably also add your .patch file to `dist_patch_DATA' in gnu/local.mk. > 2. If the same error happens for other programs, might it make sense to > "fake" rw permissions in the store (by using a virtual fs or > something) so that files are copied as rw, but files in the store are > still ro? IMHO, software shouldn't assume certain permissions are set, and instead check or make-it-so. Perhaps you could upstream your patch instead of embedding it into Guix? Furthermore, the same issue as the one your fixed here is also present in our `emacs-org' package. Do you think your approach would work there as well? If so, it might make sense to fix both emacs and emacs-org. Thanks! - Jelle From unknown Sun Jun 22 00:48:49 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#38616] emacs: fix odt export Resent-From: =?UTF-8?Q?Nicol=C3=B2?= Balzarotti Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 15 Dec 2019 14:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38616 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Jelle Licht , 38616@debbugs.gnu.org Received: via spool by 38616-submit@debbugs.gnu.org id=B38616.157642182410822 (code B ref 38616); Sun, 15 Dec 2019 14:58:02 +0000 Received: (at 38616) by debbugs.gnu.org; 15 Dec 2019 14:57:04 +0000 Received: from localhost ([127.0.0.1]:37011 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1igVKS-0002oS-7X for submit@debbugs.gnu.org; Sun, 15 Dec 2019 09:57:04 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:35607) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1igVKN-0002nt-As for 38616@debbugs.gnu.org; Sun, 15 Dec 2019 09:57:02 -0500 Received: by mail-wm1-f68.google.com with SMTP id p17so3885064wmb.0 for <38616@debbugs.gnu.org>; Sun, 15 Dec 2019 06:56:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:in-reply-to:references:date:message-id:mime-version :content-transfer-encoding; bh=H5gp9t64nK4WLlgCBZDvidPfChi9+PQbAswAaPu2S7w=; b=bl+Kf+JoU8A10Tg0gA8nJ8A73B1E4V4/qiBaILGL2irLxwER8xN9yp8sG8pHY2NmH2 5AxLuR0hC8ZqHAcNini1zS5Bd+60M9UDv2Zs5asJLhQIzf45k/x193hhDa+sJUaivE97 YPrCiPz3G3nQPjTJ2Oa72uh1IowQOyS3yTOLhhAtFnDTp6EpqDGjbG29X0cJqbiC5qSd hW/LHrZR3Jap7YsXmkmQ9uUXKRxIFsb0WAKV3UnnW14eXplyC8xABquXKDPYlIsr/tCs sF1Zh0aLgyAK7ehopOiJyTUx+BU+tEul9jz4jp/8lLN7+A/0RJhy+ipmBZsOEheO3kOL KoWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=H5gp9t64nK4WLlgCBZDvidPfChi9+PQbAswAaPu2S7w=; b=bccY83EQsljlrgv+1h98PZa2t8Y35YHGh6NZZFQD9hJ3DXarZF0fr0mfufotdE4DPs muZefvn/rkjBosLjfvHAgo9S5jNATGgg74Ziq8RY8saHsCkPtJHzmnOW904Zmdo2jnAj AJlULkEzEUx9kd0MWGlsv+QS1n4idX5MJmKDQXbHs+sspMiWCnzhL7Rr8CE7wnNdy/A6 mF8Mum+hfmVoC9LwaZBl6TjMcU8X7x7egio8kjImC0bDr2tkXDNjH1ohJUS1kv+9loVY Lzx//FIFhfNYnnTLwJW2lIHQKbVgTPtIwm9sfTC9eP8skYfpUSheL0/AMYilqbjLM0d4 hHDQ== X-Gm-Message-State: APjAAAWH7Ca4aHv31iWphftoKmm5jcPkQRgjaybPkZygNJRhk5phLWTi uFVatTKnAlAxP7zJmaeiffIBuPReylo= X-Google-Smtp-Source: APXvYqzp4h/hMmmneKOQ8UfeGSISyBHlvFrg9puqfYPy6RluRhtnn2STz7gIZ8XopgfJXfoCYdIEHg== X-Received: by 2002:a1c:f612:: with SMTP id w18mr25184150wmc.28.1576421812811; Sun, 15 Dec 2019 06:56:52 -0800 (PST) Received: from guixSD (host1-200-dynamic.5-87-r.retail.telecomitalia.it. [87.5.200.1]) by smtp.gmail.com with ESMTPSA id v62sm13194132wmg.3.2019.12.15.06.56.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Dec 2019 06:56:51 -0800 (PST) From: =?UTF-8?Q?Nicol=C3=B2?= Balzarotti In-Reply-To: <87a77thdl7.fsf@jlicht.xyz> References: <87a77ueaka.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me> <87a77thdl7.fsf@jlicht.xyz> Date: Sun, 15 Dec 2019 15:56:50 +0100 Message-ID: <87fthleix9.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Jelle Licht writes: > Hello Nichol=C3=B2, Nicol=C3=B2 :P > > anothersms@gmail.com (Nicol=C3=B2 Balzarotti) writes: > >> Hello Guix! >> >> Neither on NixOS or in guix I've ever been able to export an org file to >> otd. The error was >> 'OpenDocument export failed: Buffer is read-only: #'. >> >> I've seen some report of this error on the web, like: >> - https://lists.gnu.org/archive/html/emacs-orgmode/2018-05/msg00545.html >> - https://github.com/syl20bnr/spacemacs/issues/1482 >> >> but also on our IRC: >> - http://logs.guix.gnu.org/guix/2019-05-07.log >> - http://logs.guix.gnu.org/guix/2019-07-25.log >> but I was not able to find a fix for it. >> >> Today I checked the source and figured it out. The explanation, as >> written in the patch, is the following >> >>> Files inside the guix store are read only. "styles.xml" is copied from = the >>> store (/share/emacs/26.3/etc/org/OrgOdtStyles.xml), so it's read only t= oo. >>> ox-odt needs this file, so if it's not writable it will fail. This patch >>> adjust the permissions. > Thanks for figuring this out! I've been using my local (terrible) > workarounds for years to make this work. I tried org -> pandoc (docx), org -> pandoc (odt), org -> html -> pandoc (docx) ... and so on but nothing was good enough, so my last resort was to try to fix it :D > >> >> So, this patches fixes the permissions on the file. >> >> I've two questions: >> 1. Is it fine to have a .patch, or should I add a phase where I fix the >> file? this seemed to be easier > > I can't really advise on the best way forward here, but if you do decide > to go with the .patch route, you should probably also add your .patch > file to `dist_patch_DATA' in gnu/local.mk. Ops thanks, I missed that bit. > >> 2. If the same error happens for other programs, might it make sense to >> "fake" rw permissions in the store (by using a virtual fs or >> something) so that files are copied as rw, but files in the store are >> still ro? > > IMHO, software shouldn't assume certain permissions are set, and instead > check or make-it-so. Perhaps you could upstream your patch instead of > embedding it into Guix? I'll write a mail to emacs-orgmode@gnu.org right now. I've never submitted bug reports to emacs or org (tried writing them on the IRC channel but I've never received answers). > > Furthermore, the same issue as the one your fixed here is also present > in our `emacs-org' package. Do you think your approach would work there > as well? If so, it might make sense to fix both emacs and emacs-org. > With a quick look, I see no differences between the two files, (and I assume no differences between file permissions, too). But if we can get this patched upstream it would be better (I believe it will helps nixos users too) > Thanks! > - Jelle Thanks! From unknown Sun Jun 22 00:48:49 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#38616] =?UTF-8?Q?[Nicol=C3=B2?= Balzarotti] [bug#38616] emacs: fix odt export In-Reply-To: <87a77ueaka.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me> Resent-From: anothersms@gmail.com (=?UTF-8?Q?Nicol=C3=B2?= Balzarotti) Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 15 Dec 2019 15:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38616 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: emacs-orgmode@gnu.org Cc: 38616@debbugs.gnu.org Received: via spool by 38616-submit@debbugs.gnu.org id=B38616.157642247212258 (code B ref 38616); Sun, 15 Dec 2019 15:08:02 +0000 Received: (at 38616) by debbugs.gnu.org; 15 Dec 2019 15:07:52 +0000 Received: from localhost ([127.0.0.1]:37015 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1igVUu-0003Bd-BJ for submit@debbugs.gnu.org; Sun, 15 Dec 2019 10:07:52 -0500 Received: from mail-wr1-f47.google.com ([209.85.221.47]:33668) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1igVUs-0003B5-6z for 38616@debbugs.gnu.org; Sun, 15 Dec 2019 10:07:50 -0500 Received: by mail-wr1-f47.google.com with SMTP id b6so4179715wrq.0 for <38616@debbugs.gnu.org>; Sun, 15 Dec 2019 07:07:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:message-id:mime-version; bh=bgFO5maNS1ypCC0C6rQbHgF+1qPt27Q7QHXXlf9sg7Y=; b=K6iVY4IZwQmztgxhE/eTN0A84hSEouEawk0RBWaSaI9hkkvtrRrVmVHj9FBrMCqH2+ 3Ex3sCIwoDeFYgLwJFTwgIawjV3nEuwLPyDhkLUI7z2TfS/+Q0mTtIMdqOiT/LsAvi7u 2OMrV4RYrZlvlDDYk+UKu+gLh3yZvtHB1qqae5mNoJIfGOHtpbQIRgUU565t979r95Vy x+TyyloyA14gtlO5Cau/xXEUbx4UQKrAS9UcQRpPZE+DJlnwbj3fe0PIw+3o/3jEqtl5 4rh32G9N0ExY9okhfDPde77tTnZX4u80CL2ca8wTMivvVZq+X6h6QJYfz32rliYExI7H dOhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:message-id :mime-version; bh=bgFO5maNS1ypCC0C6rQbHgF+1qPt27Q7QHXXlf9sg7Y=; b=cnKvjscljJkZvI0w4EM+fKOEQIpi5IQ5Sav8DSeoehQltLGEno7d+0UImNFo5ma3YI na43e5JSjgqSCGcxkmQKovjBXisvEgHNr5ZLecIW8kAOAdtAonkm9yXtGUApmLusisRt HG7xf9xLq/rh5u7bjNKKf1i3iyS1vPghcPgQVL2CKvD7kIoLwS9c5tM1uKI6nyECsrba 7ls9MeSZ3yWT2XSBX8ldb+BUwiNuh+GUDlIMjTqgk5/KoLD8oz0XzKtjJ3G4XumA6yly hn3gcns6ZlYaH7tDWN4owXd4qzWML1EdNdJYdj9q5vsWjxwnSTrLL5NJF9W5CXOXhNmY 835Q== X-Gm-Message-State: APjAAAUi/u67ZkKT0G4GAziQ1GCPY8VO85wJ7AruaBNF3FHQKaYybXRt z37o2xntT30qkprj/W54w5Agpv4td4Y= X-Google-Smtp-Source: APXvYqxmwfvQ/sLakja+FfV2THGq6I6y1oXncA3NsoTnp/VLlbb4w5g4JkhImivFdACXB6nq4+2msw== X-Received: by 2002:a5d:4045:: with SMTP id w5mr23529367wrp.59.1576422463834; Sun, 15 Dec 2019 07:07:43 -0800 (PST) Received: from guixSD (host1-200-dynamic.5-87-r.retail.telecomitalia.it. [87.5.200.1]) by smtp.gmail.com with ESMTPSA id w22sm16957264wmk.34.2019.12.15.07.07.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Dec 2019 07:07:42 -0800 (PST) From: anothersms@gmail.com (=?UTF-8?Q?Nicol=C3=B2?= Balzarotti) References: <87a77ueaka.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me> Date: Sun, 15 Dec 2019 16:07:41 +0100 Message-ID: <87bls9eif6.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello Org Mode people! This is my first bug-report :) I found a problem on org-odt-export-to-odt function. The export fails with 'OpenDocument export failed: Buffer is read-only: #'. The problem happens on ox-odt, when the file OrgOdtStyles.xml permissions are read-only (this is true especially for Guix and Nix where all the "store" is readonly). The file gets copied to /tmp/ob-*/ directory, and is then modified. However, the file is assumed to be read/write. When the file is not, the export fails. I've sent a one-line patch (simply change permissions to the newly-copied file): > (set-file-modes (concat org-odt-zip-dir "styles.xml") #o600) to guix-patches (here in CC, I'm also forwarding my original patch submission here), but I've been suggested to send the patch upstream. What do you think? I can submit a proper patch if needed (but feel free to patch it yourself) I want to thank everybody for how wonderful Org Mode is :) Nicol=C3=B2 --=-=-= Content-Type: message/rfc822 Content-Disposition: inline Return-Path: Delivered-To: nicolo@nixo.xyz Received: from mail.nixo.xyz by nixo.xyz with LMTP id NmYMBkV09V3udgAAcNA2gQ (envelope-from ) for ; Sun, 15 Dec 2019 00:46:13 +0100 Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=guix-patches-bounces+nicolo=nixo.xyz@gnu.org; receiver= Authentication-Results: mail.nixo.xyz; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ub2WNYZQ Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mail.nixo.xyz (Postfix) with ESMTPS id B213C6EEBAE for ; Sun, 15 Dec 2019 00:46:12 +0100 (CET) Received: from localhost ([::1]:34728 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igH6w-0003At-Vl for nicolo@nixo.xyz; Sat, 14 Dec 2019 18:46:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45739) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igH6s-0003AJ-5F for guix-patches@gnu.org; Sat, 14 Dec 2019 18:46:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igH6q-0006ob-4S for guix-patches@gnu.org; Sat, 14 Dec 2019 18:46:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:58149) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1igH6o-0006nl-Rv for guix-patches@gnu.org; Sat, 14 Dec 2019 18:46:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1igH6n-0007uI-Pw for guix-patches@gnu.org; Sat, 14 Dec 2019 18:46:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#38616] emacs: fix odt export Resent-From: anothersms@gmail.com (=?utf-8?Q?Nicol=C3=B2?= Balzarotti) Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 14 Dec 2019 23:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 38616 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 38616@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.157636712330340 (code B ref -1); Sat, 14 Dec 2019 23:46:01 +0000 Received: (at submit) by debbugs.gnu.org; 14 Dec 2019 23:45:23 +0000 Received: from localhost ([127.0.0.1]:35889 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1igH6A-0007tH-Tq for submit@debbugs.gnu.org; Sat, 14 Dec 2019 18:45:23 -0500 Received: from lists.gnu.org ([209.51.188.17]:56032) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1igH68-0007t9-HD for submit@debbugs.gnu.org; Sat, 14 Dec 2019 18:45:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39657) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igH66-00031f-8Z for guix-patches@gnu.org; Sat, 14 Dec 2019 18:45:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igH64-0005aP-6n for guix-patches@gnu.org; Sat, 14 Dec 2019 18:45:18 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:35885) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1igH62-0005YF-DW for guix-patches@gnu.org; Sat, 14 Dec 2019 18:45:15 -0500 Received: by mail-wr1-x42e.google.com with SMTP id z3so2872707wru.3 for ; Sat, 14 Dec 2019 15:45:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=TJq7Q7ZbA53y1YE6p4dVv6MVmqdFo/sarCKAYx/nvUY=; b=ub2WNYZQU4anOCLdoWok6tLgeE1XCxMguOkiDBqK6xSZ9dt+fHyLYDjMACDOzIGKK8 s5Jv11zqVKZgSkWg5E3mC4/LHVaMCCQMyPgkSUnCmQt/Tux8Wpk8ywB+KO9n9S3j8aQW rY3vN37p25u3j4F+yHZoEUAZSv0ufjHHvyYrsrgAqDHmXotn/PAZ98r5KlhoUXoxhW1r b7q4WQzS1JOzkBM4lYjLOUr8AnSgHZyoyHU7eY2xz9+BrCS0M6ayis2G0QKT1wst/Ipf 04lJUO675wHk5QsdpSyR9VAJRozYjAIRIuAhTLYgElR0cgYiKlMgSEPLYzsBY9K25sUK DhXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=TJq7Q7ZbA53y1YE6p4dVv6MVmqdFo/sarCKAYx/nvUY=; b=aWuZL8qLESXj/fFazCnzYApXHZ3y/Hxmai56D8NBQdkRrGRDrHiDE+EoQ+fwN40gFt Vr/AJsb5bSlYIpVEpfNQR99B5bBa+g0ODeCCdmRIPCLNUm54754rLgiH/eiM1r3ao/B+ Wya+bEdN790i7MKsVQValbXENwf7GiAy/jT5aRbxDyvZacYrdISwh0xX9bzffA5L5a0D CRpCoFFYQa/sHsN9SKgyBupJSHA0nVwVxDkBRhXMpsQHz8M1/R3OCm5DQXAKkTBiWgXQ ba5TNTywwgNOhwDKqsMDcmcm9EX5tgk0Mvtsk5mWPyvFI2Ys/78eCGYNbP4l1YqaUv7B +HeA== X-Gm-Message-State: APjAAAUhm0c/CHK1G+MrWwR5cIFlXeR7mq16VcCW32eY9AfaFpPtaFY0 Uty5Rdskg4qpnlY2ARMxEQBnCRm9Szo= X-Google-Smtp-Source: APXvYqylgDzat1aTWfPURpq1TAxyAB//gIe/bX5C8SMvFKgKKhj+cD5nIJNlUlZK9G+CG0LntBX3hw== X-Received: by 2002:adf:e40f:: with SMTP id g15mr22481803wrm.223.1576367112010; Sat, 14 Dec 2019 15:45:12 -0800 (PST) Received: from guixSD (host1-200-dynamic.5-87-r.retail.telecomitalia.it. [87.5.200.1]) by smtp.gmail.com with ESMTPSA id b17sm15749388wrp.49.2019.12.14.15.45.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Dec 2019 15:45:11 -0800 (PST) From: anothersms@gmail.com (=?utf-8?Q?Nicol=C3=B2?= Balzarotti) Date: Sun, 15 Dec 2019 00:45:09 +0100 Message-ID: <87a77ueaka.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+nicolo=nixo.xyz@gnu.org Sender: "Guix-patches" X-Rspamd-Queue-Id: B213C6EEBAE X-Spamd-Result: default: False [-0.31 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FORGED_SENDER_MAILLIST(0.00)[]; R_SPF_DNSFAIL(0.00)[(SPF): spf DNS fail]; FREEMAIL_FROM(0.00)[gmail.com]; HAS_ATTACHMENT(0.00)[]; MIME_GOOD(-0.10)[multipart/mixed,text/plain]; TO_DN_NONE(0.00)[]; HAS_LIST_UNSUB(-0.01)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_TWELVE(0.00)[13]; FROM_NO_DN(0.00)[]; MAILLIST(-0.20)[mailman]; FORGED_SENDER(0.00)[anothersms@gmail.com,guix-patches-bounces@gnu.org]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_TLS_LAST(0.00)[]; FORGED_RECIPIENTS(0.00)[38616@debbugs.gnu.org,nicolo@nixo.xyz]; TAGGED_FROM(0.00)[nicolo=nixo.xyz]; FROM_NEQ_ENVFROM(0.00)[anothersms@gmail.com,guix-patches-bounces@gnu.org] X-Rspamd-Server: nixo.xyz X-TUID: fs6h6jl6o9Js MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="====-=-=" --====-=-= Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello Guix! Neither on NixOS or in guix I've ever been able to export an org file to otd. The error was 'OpenDocument export failed: Buffer is read-only: #'. I've seen some report of this error on the web, like: - https://lists.gnu.org/archive/html/emacs-orgmode/2018-05/msg00545.html - https://github.com/syl20bnr/spacemacs/issues/1482 but also on our IRC: - http://logs.guix.gnu.org/guix/2019-05-07.log - http://logs.guix.gnu.org/guix/2019-07-25.log but I was not able to find a fix for it. Today I checked the source and figured it out. The explanation, as written in the patch, is the following > Files inside the guix store are read only. "styles.xml" is copied from the > store (/share/emacs/26.3/etc/org/OrgOdtStyles.xml), so it's read only too. > ox-odt needs this file, so if it's not writable it will fail. This patch > adjust the permissions. So, this patches fixes the permissions on the file. I've two questions: 1. Is it fine to have a .patch, or should I add a phase where I fix the file? this seemed to be easier 2. If the same error happens for other programs, might it make sense to "fake" rw permissions in the store (by using a virtual fs or something) so that files are copied as rw, but files in the store are still ro? Thanks! Nicol=C3=B2 --====-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-gnu-packages-emascs.scm-emacs-patches-Fix-odt-export.patch >From c1ad3fff9bda5935651f26e460907a77d1b3d003 Mon Sep 17 00:00:00 2001 From: nixo Date: Sat, 14 Dec 2019 15:17:11 +0100 Subject: [PATCH] * gnu/packages/emascs.scm (emacs)[patches]: Fix odt export. ox-odt copyes the file /share/emacs/26.3/etc/org/OrgOdtStyles.xml under /tmp/odt-*/styles.xml and tries to modify it. Since files in the guix store are read-only, it will fail. This patch fixes the export by adjusting permissions during the export. --- gnu/packages/emacs.scm | 1 + .../patches/emacs-fix-odt-export.patch | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 gnu/packages/patches/emacs-fix-odt-export.patch diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index eba7f88551..8183b69eb3 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -80,6 +80,7 @@ "119ldpk7sgn9jlpyngv5y4z3i7bb8q3xp4p0qqi7i5nq39syd42d")) (patches (search-patches "emacs-exec-path.patch" "emacs-fix-scheme-indent-function.patch" + "emacs-fix-odt-export.patch" "emacs-source-date-epoch.patch")) (modules '((guix build utils))) (snippet diff --git a/gnu/packages/patches/emacs-fix-odt-export.patch b/gnu/packages/patches/emacs-fix-odt-export.patch new file mode 100644 index 0000000000..0c3c44a2e3 --- /dev/null +++ b/gnu/packages/patches/emacs-fix-odt-export.patch @@ -0,0 +1,25 @@ +Files inside the guix store are read only. "styles.xml" is copied from the +store (/share/emacs/26.3/etc/org/OrgOdtStyles.xml), so it's read only too. +ox-odt needs this file, so if it's not writable it will fail. This patch +adjust the permissions. + +--- + lisp/org/ox-odt.el | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/lisp/org/ox-odt.el b/lisp/org/ox-odt.el +index f9c4a93cc8..61988ffcc4 100644 +--- a/lisp/org/ox-odt.el ++++ b/lisp/org/ox-odt.el +@@ -1384,6 +1384,8 @@ original parsed data. INFO is a plist holding export options." + ;; create a manifest entry for styles.xml + (org-odt-create-manifest-file-entry "text/xml" "styles.xml") + ++ ;; guix store files are ro. This file need to be modified, make it rw ++ (set-file-modes (concat org-odt-zip-dir "styles.xml") #o600) + ;; FIXME: Who is opening an empty styles.xml before this point? + (with-current-buffer + (find-file-noselect (concat org-odt-zip-dir "styles.xml") t) +-- +2.24.0 + -- 2.24.0 --====-=-=-- --=-=-=-- From unknown Sun Jun 22 00:48:49 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#38616] =?UTF-8?Q?[Nicol=C3=B2?= Balzarotti] [bug#38616] emacs: fix odt export Resent-From: Nicolas Goaziou Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 17 Dec 2019 09:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38616 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: anothersms@gmail.com (=?UTF-8?Q?Nicol=C3=B2?= Balzarotti) Cc: 38616@debbugs.gnu.org, emacs-orgmode@gnu.org Received: via spool by 38616-submit@debbugs.gnu.org id=B38616.15765754164520 (code B ref 38616); Tue, 17 Dec 2019 09:37:02 +0000 Received: (at 38616) by debbugs.gnu.org; 17 Dec 2019 09:36:56 +0000 Received: from localhost ([127.0.0.1]:40724 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ih9Hk-0001Ap-7y for submit@debbugs.gnu.org; Tue, 17 Dec 2019 04:36:56 -0500 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:43749) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ih9Hi-0001Ag-Gs for 38616@debbugs.gnu.org; Tue, 17 Dec 2019 04:36:55 -0500 X-Originating-IP: 185.131.40.67 Received: from localhost (40-67.ipv4.commingeshautdebit.fr [185.131.40.67]) (Authenticated sender: admin@nicolasgoaziou.fr) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 6CB0DC0011; Tue, 17 Dec 2019 09:36:52 +0000 (UTC) From: Nicolas Goaziou References: <87a77ueaka.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me> <87bls9eif6.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me> Mail-Followup-To: anothersms@gmail.com (=?UTF-8?Q?Nicol=C3=B2?= Balzarotti), emacs-orgmode@gnu.org, 38616@debbugs.gnu.org Date: Tue, 17 Dec 2019 10:36:51 +0100 In-Reply-To: <87bls9eif6.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me> ("=?UTF-8?Q?Nicol=C3=B2?= Balzarotti"'s message of "Sun, 15 Dec 2019 16:07:41 +0100") Message-ID: <874kxz9tu4.fsf@nicolasgoaziou.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hello, anothersms@gmail.com (Nicol=C3=B2 Balzarotti) writes: > The problem happens on ox-odt, when the file OrgOdtStyles.xml > permissions are read-only (this is true especially for Guix and Nix > where all the "store" is readonly). The file gets copied to /tmp/ob-*/ > directory, and is then modified. However, the file is assumed to be > read/write. When the file is not, the export fails. I've sent a one-line > patch (simply change permissions to the newly-copied file): > >> (set-file-modes (concat org-odt-zip-dir "styles.xml") #o600) > > to guix-patches (here in CC, I'm also forwarding my original patch > submission here), but I've been suggested to send the patch upstream. > > What do you think? I can submit a proper patch if needed (but feel free > to patch it yourself) It sounds good. Could you send a patch against "maint" branch? Thank you. Regards, --=20 Nicolas Goaziou From unknown Sun Jun 22 00:48:49 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: anothersms@gmail.com (=?UTF-8?Q?Nicol=C3=B2?= Balzarotti) Subject: bug#38616: closed (Re: [bug#38616] emacs: fix odt export) Message-ID: References: <87h81swvoq.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me> <87a77ueaka.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me> X-Gnu-PR-Message: they-closed 38616 X-Gnu-PR-Package: guix-patches Reply-To: 38616@debbugs.gnu.org Date: Sun, 22 Dec 2019 09:35:01 +0000 Content-Type: multipart/mixed; boundary="----------=_1577007301-18336-1" This is a multi-part message in MIME format... ------------=_1577007301-18336-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #38616: emacs: fix odt export which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 38616@debbugs.gnu.org. --=20 38616: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D38616 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1577007301-18336-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 38616-done) by debbugs.gnu.org; 22 Dec 2019 09:34:27 +0000 Received: from localhost ([127.0.0.1]:49066 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iixd4-0004kr-Kk for submit@debbugs.gnu.org; Sun, 22 Dec 2019 04:34:26 -0500 Received: from mail-ed1-f67.google.com ([209.85.208.67]:35895) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iixd0-0004kb-0K for 38616-done@debbugs.gnu.org; Sun, 22 Dec 2019 04:34:25 -0500 Received: by mail-ed1-f67.google.com with SMTP id j17so12780698edp.3 for <38616-done@debbugs.gnu.org>; Sun, 22 Dec 2019 01:34:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:in-reply-to:references:date:message-id:mime-version :content-transfer-encoding; bh=SwRm3zFDl1u3rAsimCJ1GsbGXaBcoghtVA9SPY43cM0=; b=BsZ8Puw3YoQ0j44bqNXdSv6iW1cEuVpmglg+dXU+XOxySDPq0+Oma0WmKKa4vLFUSU s97AuO4AXMsEIwjj/MvbapOAUk8s9rtls2vN7RrBcq+7CRDdil79vzVMgA1bX5wAPY/V DydtCcdt6w2np2q/gCjd5PhvbiYx+ZBeX0PAXaBhshcnOdZ5aEjFC8ISJ5p+oCQ8N5/j ZSMOMCjVpUQ9Dofn0DCx8QM5lEFxIoRpronezO1nIIVcJrYemgBVwXty2hCNpPmFLlji ha6qFCf/hgcwDDUrjZd9BjnGdFpQSsO4yGwvJaFgfCeJdF+WraZapcvXR5cc65JIXAEm UxBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=SwRm3zFDl1u3rAsimCJ1GsbGXaBcoghtVA9SPY43cM0=; b=ntCWTOFIJBNHOcCmzGvmLgQglpdHYVbRNcWWy2xuZJevZLBEUglUnAs/S3IdcxsEQh 7Sm0IX/wuOtQpdAZcDYFKn+Ty8+NMeG1JDxlZbneOF5r2ivAjkm6fEUZl5ZUjQ0deC7j +RHQrWoLz1Vb53oBepmVDS5U/JFXHxiVvqc7+JkKuiQgKP+ZFzpFoW46AGtm9MEj0SNT GO9EW+HHu1Dzhyo63oN/Wv0rfWifrP4xFAOxabpERCyClXqLEV/Dqc6iU+99oqHzUjy1 Kt3cOaGFzHBqUP3Bt0S86r9cn8F4bqrZPRqV4vXTBDnNj9MGhRhjGzDseeV4UL9JBhka CfUw== X-Gm-Message-State: APjAAAVXnx+xOdMrGlFCJU1Z1HQiLdWn5Vkxs+/vTM/QPfHmd8YnM6qL v0KPJ7G3MavCJrHIFo0E5N0MkaHab8w= X-Google-Smtp-Source: APXvYqzXsvHRrHpUPPz9cRv7wxtm9iVngiQrSIuwzAb+ZNwVVuNm5CTsVDpMKElewq3BITOAtgPZrA== X-Received: by 2002:aa7:cf81:: with SMTP id z1mr27018248edx.157.1577007255645; Sun, 22 Dec 2019 01:34:15 -0800 (PST) Received: from guixSD (host1-200-dynamic.5-87-r.retail.telecomitalia.it. [87.5.200.1]) by smtp.gmail.com with ESMTPSA id m6sm1822530ejb.51.2019.12.22.01.34.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2019 01:34:14 -0800 (PST) From: =?utf-8?Q?Nicol=C3=B2?= Balzarotti To: Jelle Licht , 38616-done@debbugs.gnu.org Subject: Re: [bug#38616] emacs: fix odt export In-Reply-To: <87a77thdl7.fsf@jlicht.xyz> References: <87a77ueaka.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me> <87a77thdl7.fsf@jlicht.xyz> Date: Sun, 22 Dec 2019 10:34:13 +0100 Message-ID: <87h81swvoq.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38616-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Closing this since my commit has been merged upstream! [1] (I read on debbugs that to close the issue I need to add -done after the bug #, let's try) [1] https://code.orgmode.org/bzg/org-mode/commit/6315e1e76087a013198bfc33f0= ec6a444cf5e662 Jelle Licht writes: > Hello Nichol=C3=B2, > > anothersms@gmail.com (Nicol=C3=B2 Balzarotti) writes: > >> Hello Guix! >> >> Neither on NixOS or in guix I've ever been able to export an org file to >> otd. The error was >> 'OpenDocument export failed: Buffer is read-only: #'. >> >> I've seen some report of this error on the web, like: >> - https://lists.gnu.org/archive/html/emacs-orgmode/2018-05/msg00545.html >> - https://github.com/syl20bnr/spacemacs/issues/1482 >> >> but also on our IRC: >> - http://logs.guix.gnu.org/guix/2019-05-07.log >> - http://logs.guix.gnu.org/guix/2019-07-25.log >> but I was not able to find a fix for it. >> >> Today I checked the source and figured it out. The explanation, as >> written in the patch, is the following >> >>> Files inside the guix store are read only. "styles.xml" is copied from = the >>> store (/share/emacs/26.3/etc/org/OrgOdtStyles.xml), so it's read only t= oo. >>> ox-odt needs this file, so if it's not writable it will fail. This patch >>> adjust the permissions. > Thanks for figuring this out! I've been using my local (terrible) > workarounds for years to make this work. > >> >> So, this patches fixes the permissions on the file. >> >> I've two questions: >> 1. Is it fine to have a .patch, or should I add a phase where I fix the >> file? this seemed to be easier > > I can't really advise on the best way forward here, but if you do decide > to go with the .patch route, you should probably also add your .patch > file to `dist_patch_DATA' in gnu/local.mk. > >> 2. If the same error happens for other programs, might it make sense to >> "fake" rw permissions in the store (by using a virtual fs or >> something) so that files are copied as rw, but files in the store are >> still ro? > > IMHO, software shouldn't assume certain permissions are set, and instead > check or make-it-so. Perhaps you could upstream your patch instead of > embedding it into Guix? > > Furthermore, the same issue as the one your fixed here is also present > in our `emacs-org' package. Do you think your approach would work there > as well? If so, it might make sense to fix both emacs and emacs-org. > > Thanks! > - Jelle ------------=_1577007301-18336-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 14 Dec 2019 23:45:23 +0000 Received: from localhost ([127.0.0.1]:35889 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1igH6A-0007tH-Tq for submit@debbugs.gnu.org; Sat, 14 Dec 2019 18:45:23 -0500 Received: from lists.gnu.org ([209.51.188.17]:56032) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1igH68-0007t9-HD for submit@debbugs.gnu.org; Sat, 14 Dec 2019 18:45:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39657) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igH66-00031f-8Z for guix-patches@gnu.org; Sat, 14 Dec 2019 18:45:20 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_20,FREEMAIL_FROM, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igH64-0005aP-6n for guix-patches@gnu.org; Sat, 14 Dec 2019 18:45:18 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:35885) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1igH62-0005YF-DW for guix-patches@gnu.org; Sat, 14 Dec 2019 18:45:15 -0500 Received: by mail-wr1-x42e.google.com with SMTP id z3so2872707wru.3 for ; Sat, 14 Dec 2019 15:45:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=TJq7Q7ZbA53y1YE6p4dVv6MVmqdFo/sarCKAYx/nvUY=; b=ub2WNYZQU4anOCLdoWok6tLgeE1XCxMguOkiDBqK6xSZ9dt+fHyLYDjMACDOzIGKK8 s5Jv11zqVKZgSkWg5E3mC4/LHVaMCCQMyPgkSUnCmQt/Tux8Wpk8ywB+KO9n9S3j8aQW rY3vN37p25u3j4F+yHZoEUAZSv0ufjHHvyYrsrgAqDHmXotn/PAZ98r5KlhoUXoxhW1r b7q4WQzS1JOzkBM4lYjLOUr8AnSgHZyoyHU7eY2xz9+BrCS0M6ayis2G0QKT1wst/Ipf 04lJUO675wHk5QsdpSyR9VAJRozYjAIRIuAhTLYgElR0cgYiKlMgSEPLYzsBY9K25sUK DhXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=TJq7Q7ZbA53y1YE6p4dVv6MVmqdFo/sarCKAYx/nvUY=; b=aWuZL8qLESXj/fFazCnzYApXHZ3y/Hxmai56D8NBQdkRrGRDrHiDE+EoQ+fwN40gFt Vr/AJsb5bSlYIpVEpfNQR99B5bBa+g0ODeCCdmRIPCLNUm54754rLgiH/eiM1r3ao/B+ Wya+bEdN790i7MKsVQValbXENwf7GiAy/jT5aRbxDyvZacYrdISwh0xX9bzffA5L5a0D CRpCoFFYQa/sHsN9SKgyBupJSHA0nVwVxDkBRhXMpsQHz8M1/R3OCm5DQXAKkTBiWgXQ ba5TNTywwgNOhwDKqsMDcmcm9EX5tgk0Mvtsk5mWPyvFI2Ys/78eCGYNbP4l1YqaUv7B +HeA== X-Gm-Message-State: APjAAAUhm0c/CHK1G+MrWwR5cIFlXeR7mq16VcCW32eY9AfaFpPtaFY0 Uty5Rdskg4qpnlY2ARMxEQBnCRm9Szo= X-Google-Smtp-Source: APXvYqylgDzat1aTWfPURpq1TAxyAB//gIe/bX5C8SMvFKgKKhj+cD5nIJNlUlZK9G+CG0LntBX3hw== X-Received: by 2002:adf:e40f:: with SMTP id g15mr22481803wrm.223.1576367112010; Sat, 14 Dec 2019 15:45:12 -0800 (PST) Received: from guixSD (host1-200-dynamic.5-87-r.retail.telecomitalia.it. [87.5.200.1]) by smtp.gmail.com with ESMTPSA id b17sm15749388wrp.49.2019.12.14.15.45.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Dec 2019 15:45:11 -0800 (PST) From: anothersms@gmail.com (=?utf-8?Q?Nicol=C3=B2?= Balzarotti) To: guix-patches@gnu.org Subject: emacs: fix odt export Date: Sun, 15 Dec 2019 00:45:09 +0100 Message-ID: <87a77ueaka.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42e X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello Guix! Neither on NixOS or in guix I've ever been able to export an org file to otd. The error was 'OpenDocument export failed: Buffer is read-only: #'. I've seen some report of this error on the web, like: - https://lists.gnu.org/archive/html/emacs-orgmode/2018-05/msg00545.html - https://github.com/syl20bnr/spacemacs/issues/1482 but also on our IRC: - http://logs.guix.gnu.org/guix/2019-05-07.log - http://logs.guix.gnu.org/guix/2019-07-25.log but I was not able to find a fix for it. Today I checked the source and figured it out. The explanation, as written in the patch, is the following > Files inside the guix store are read only. "styles.xml" is copied from the > store (/share/emacs/26.3/etc/org/OrgOdtStyles.xml), so it's read only too. > ox-odt needs this file, so if it's not writable it will fail. This patch > adjust the permissions. So, this patches fixes the permissions on the file. I've two questions: 1. Is it fine to have a .patch, or should I add a phase where I fix the file? this seemed to be easier 2. If the same error happens for other programs, might it make sense to "fake" rw permissions in the store (by using a virtual fs or something) so that files are copied as rw, but files in the store are still ro? Thanks! Nicol=C3=B2 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-gnu-packages-emascs.scm-emacs-patches-Fix-odt-export.patch >From c1ad3fff9bda5935651f26e460907a77d1b3d003 Mon Sep 17 00:00:00 2001 From: nixo Date: Sat, 14 Dec 2019 15:17:11 +0100 Subject: [PATCH] * gnu/packages/emascs.scm (emacs)[patches]: Fix odt export. ox-odt copyes the file /share/emacs/26.3/etc/org/OrgOdtStyles.xml under /tmp/odt-*/styles.xml and tries to modify it. Since files in the guix store are read-only, it will fail. This patch fixes the export by adjusting permissions during the export. --- gnu/packages/emacs.scm | 1 + .../patches/emacs-fix-odt-export.patch | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 gnu/packages/patches/emacs-fix-odt-export.patch diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index eba7f88551..8183b69eb3 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -80,6 +80,7 @@ "119ldpk7sgn9jlpyngv5y4z3i7bb8q3xp4p0qqi7i5nq39syd42d")) (patches (search-patches "emacs-exec-path.patch" "emacs-fix-scheme-indent-function.patch" + "emacs-fix-odt-export.patch" "emacs-source-date-epoch.patch")) (modules '((guix build utils))) (snippet diff --git a/gnu/packages/patches/emacs-fix-odt-export.patch b/gnu/packages/patches/emacs-fix-odt-export.patch new file mode 100644 index 0000000000..0c3c44a2e3 --- /dev/null +++ b/gnu/packages/patches/emacs-fix-odt-export.patch @@ -0,0 +1,25 @@ +Files inside the guix store are read only. "styles.xml" is copied from the +store (/share/emacs/26.3/etc/org/OrgOdtStyles.xml), so it's read only too. +ox-odt needs this file, so if it's not writable it will fail. This patch +adjust the permissions. + +--- + lisp/org/ox-odt.el | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/lisp/org/ox-odt.el b/lisp/org/ox-odt.el +index f9c4a93cc8..61988ffcc4 100644 +--- a/lisp/org/ox-odt.el ++++ b/lisp/org/ox-odt.el +@@ -1384,6 +1384,8 @@ original parsed data. INFO is a plist holding export options." + ;; create a manifest entry for styles.xml + (org-odt-create-manifest-file-entry "text/xml" "styles.xml") + ++ ;; guix store files are ro. This file need to be modified, make it rw ++ (set-file-modes (concat org-odt-zip-dir "styles.xml") #o600) + ;; FIXME: Who is opening an empty styles.xml before this point? + (with-current-buffer + (find-file-noselect (concat org-odt-zip-dir "styles.xml") t) +-- +2.24.0 + -- 2.24.0 --=-=-=-- ------------=_1577007301-18336-1--