What did you expect to happen?
Exporting an org-mode document to ODT should produce a file which opens with LibreOffice Writer.
What actually happened?
The produced ODT file does not open with LibreOffice Writer, which displays an error stating the file is corrupt. The specific issue is the same as detailed in the closed issue #1682 where manifest.xml contains a duplicate XML declaration block.
Additional details:
Export commands: SPC m e o o or SPC m e o O
Steps to reproduce:
System information:
emacs version 26.3
features XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS GLIB NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM THREADS LIBSYSTEMD LCMS2
build Sep 23, 2019
buildopts (--build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --enable-libsystemd --with-pop=yes --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/26.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.3/site-lisp:/usr/share/emacs/site-lisp --with-sound=alsa --without-gconf --with-mailutils --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --enable-libsystemd --with-pop=yes --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/26.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.3/site-lisp:/usr/share/emacs/site-lisp --with-sound=alsa --without-gconf --with-mailutils --with-x=yes --with-x-toolkit=gtk3 --with-toolkit-scroll-bars 'CFLAGS=-g -O2 -fdebug-prefix-map=/build/emacs-wvqver/emacs-26.3+1=. -fstack-protector-strong -Wformat -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro')
windowsys x
daemonp server-running
doom version 2.0.9
build HEAD -> develop 92e8521e9 2020-02-16 02:50:52 -0500
dir ~/.doom.d/
system type gnu/linux
config x86_64-pc-linux-gnu
shell /bin/zsh
uname Linux 5.3.0-40-generic #32-Ubuntu SMP Fri Jan 31 20:24:34 UTC 2020 x86_64
path (~/.local/bin ~/.cargo/bin ~/.yarn/bin ~/.config/yarn/global/node_modules/.bin /usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin /usr/games /usr/local/games /snap/bin /usr/lib/jvm/java-8-oracle/bin /usr/lib/jvm/java-8-oracle/db/bin /usr/lib/jvm/java-8-oracle/jre/bin /storage/SDKs/Android/Sdk/build-tools /storage/SDKs/Android/Sdk/emulator /storage/SDKs/Android/Sdk/platform-tools /storage/SDKs/Android/Sdk/tools/bin /storage/Software/android-studio/bin /usr/lib/emacs/26.3/x86_64-linux-gnu)
config envfile nil
elc-files 0
modules (:completion company ivy :ui doom doom-dashboard doom-quit hl-todo modeline nav-flash ophints (popup +all +defaults) treemacs vc-gutter vi-tilde-fringe window-select workspaces :editor (evil +everywhere) file-templates fold multiple-cursors rotate-text snippets :emacs dired electric ibuffer vc :term eshell :checkers syntax spell grammar :tools debugger (eval +overlay) (lookup +docsets) lsp magit rgb :lang data emacs-lisp (javascript +lsp) latex lua markdown (org +dragndrop +present) (php +lsp) (python +lsp) (rust +lsp) sh web :config (default +bindings +smartparens))
packages ((ox-twbs))
elpa (ox-twbs evil-numbers)
unpin (n/a)
Seems this issue is related to the file-templates module in init.el, disabling it fixes export for me...
Using (set-file-template! 'nxml-mode :ignore t) in config.el fixes it without disabling the whole file-templates module.
Yes, the linked issue was marked as resolved after commit fb619bdb0f419e4f19f917041504ec19c4c50d51 which modifies file-templates-check-h in that file, so it seems there was a regression in later commits.
Using
(set-file-template! 'nxml-mode :ignore t)in config.el fixes it without disabling the wholefile-templatesmodule.
Thanks for the fix, I'll try it as soon as I can as a temporary measure
File-template expansion seems to cause quite a few problems, so as of 037bcf3 I'm trying a new strategy of expanding them, which should resolve this issue. Let me know if that isn't the case and I'll reopen the issue. Thanks for bringing it to my attention!
Excellent, that commit has fixed the issue for me. Thanks so much for the fast response time and all your work on doom-emacs!