From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:44153) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igUoX-0006gg-1h for guix-patches@gnu.org; Sun, 15 Dec 2019 09:24:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igUoU-0008Rq-Jd for guix-patches@gnu.org; Sun, 15 Dec 2019 09:24:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:58312) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1igUoU-0008QU-Ew for guix-patches@gnu.org; Sun, 15 Dec 2019 09:24:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1igUoU-0001ja-8T for guix-patches@gnu.org; Sun, 15 Dec 2019 09:24:02 -0500 Subject: [bug#38616] emacs: fix odt export Resent-Message-ID: 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 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: =?UTF-8?Q?Nicol=C3=B2?= Balzarotti , 38616@debbugs.gnu.org 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