Can't set org-open-file-at-point to open file externally

What happened?

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.

What did you expect to happen

See above

Steps to reproduce

System information

Loading data dump...

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).

Hope that helps!

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.”

Many apologies. Yes, I was able to do two universal arguments but got the same conversion process.