I’m a non-programmer who uses doom emacs for academic papers. The default behavior of doom seems to be to render .docx files and then load them. First, the conversion fails for me with .docx files, although it works for pdfs. Second, I would prefer to open both kinds of files with my default programs externally.
I would tell you what I tried, but I really have no idea how to change the default behavior of org-open-file-at-point.
This can be customized by changing the org-file-apps variable.
;; add to $DOOMDIR/config.el
(after! org
(add-to-list 'org-file-apps '("\\.docx$" . default)))
;; Adjust the `"\\.docx$"` regex to apply to more files
In this case, default essentially tells Emacs to open links with your system’s default application. system will work better if you override default with earlier modifications to org-file-apps.
You can see documentation about this variable by typing C-h v org-file-apps (it must be done after the Org library is loaded; which has happened if you’ve opened an org file/buffer).
As an alternative: invoking org-open-at-point with two universal arguments will forcibly open that link in your system default app. I.e. SPC u u then M-x org-open-file-at-point (either on RET or C-c C-o).
Thanks so much for your response. But even after adding that code, org-open-file-at-point still goes to a conversion process. In treemacs, I can open files externally with "o x" and it opens with my default app for docx files.
I was unable to preface the command with two universal arguments, as SPC u is mapped to “undo.”
On GNU Linux, default application refer to mailcap default. Mailcap refers to your settings either in ~/.mailcap or /etc/mailcap. If those settings configure emacs to open docx files, the suggested configuration will indeed change nothing.
You may consider changing your mailcap setting or, alternatively, use
;; add to $DOOMDIR/config.el
(after! org
(add-to-list 'org-file-apps '("\\.docx$" . "lowriter %s")))
;; Adjust the `"\\.docx$"` regex to apply to more files
In the above, I assume that you want to open the document in LibreOffice Writer (lowriter) app. You may change it to your application of choice if needed.