0

When using org export, if I expert to ODT and open, Emacs opens the file internally, as an archive.

I want it to open the ODT file in Libreoffice.

what do I need to change to do that?

Drew
  • 75,699
  • 9
  • 109
  • 225
Jason
  • 1
  • 1
    C-c C-e o O from an opened org file and the odt file is created and opened with LibreOffice. How did you proceed? – gigiair Jul 17 '23 at 18:12

1 Answers1

0

I am assuming that your are on Linux ...

Based on https://kjambunathan.github.io/org-mode-ox-odt/Getting-Started-with-ODT-export.html#Configuration, add the following to your init file

;; (setcdr (assq 'system org-file-apps-defaults-gnu) "xdg-open %s")
(setcdr (assq 'system org-file-apps-gnu) "xdg-open %s")

(advice-add 'org-open-file :around
            (lambda (orig-fun &rest args)
              ;; Work around a weird problem with xdg-open.
              (let ((process-connection-type nil))
                (apply orig-fun args))))

Then C-c C-e o O (small-o and capital-O) will open the file in LibreOffice.


The above snippet tells org that xdg-open is the system command for opening ODT or any other file (that org-mode doesn't know about)

gnu in org-file-apps-gnu tells you that you are configuring a Linux like system.

If you are on some other OSes, say Windows, find the configuration variable (=the counterpart of org-file-apps-gnu) that sets the system command for opening files, and change it to open (=or any other equivalent command)

In recent versions of Emacs browse-url-of-dired-file (=W in dired-mode) does the open in a system-specific way. IIRC, you can use a Elisp form (instead of a *shell* command for configuring the open command)

I have no experience with non-Linux systems ... so I cannot help much with those systems.


Start from M-x customize-variable org-file-apps or consult other related variables org-file-apps-macos, org-file-apps-windowsnt