GNU bug report logs -
#38616
emacs: fix odt export
Previous Next
Full log
Message #14 received at 38616 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
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: #<killed buffer>'.
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ò
[Message part 2 (message/rfc822, inline)]
[Message part 3 (text/plain, inline)]
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: #<killed buffer>'.
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ò
[0001-gnu-packages-emascs.scm-emacs-patches-Fix-odt-export.patch (text/x-patch, attachment)]
This bug report was last modified 5 years and 155 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.