0

The default action when click on a html file link will open it in browser.

How to config the action of click to distinct web links and disk file link, so the web link starts with http or https will be open in browser and file link to disk will be open in emacs to edit?

5
  • The question is unclear: a link like [[http://localhost/foo.html]] will be opened in a browser; a link like [[file:/tmp/foo.html]] will be opened in Emacs. What exactly are you asking?
    – NickD
    Dec 2, 2023 at 1:39
  • @NickD My Emacs (-Q) opens it in edge.exe by default. I use v29.1_2 on MS-Windows.
    – shynur
    Dec 2, 2023 at 3:54
  • What is it? The https link or the file link, or something else - or maybe both? And what does edge.exe do with it (whatever it is)? I still don't understand what the OP wants and your comment did not clarify anything for me. Is the question Windows-specific?
    – NickD
    Dec 2, 2023 at 9:44
  • 1
    @NickD Click at [[file:a.html]] in org-mode will open a.html in edge.exe
    – shynur
    Dec 2, 2023 at 12:46
  • So it does (well, it opens it in Firefox for me, but I get your point). Thanks and sorry for being dense.
    – NickD
    Dec 2, 2023 at 13:02

1 Answer 1

2

C-h v org-file-apps:

Applications for opening file:path items in a document.

Its definition:

(defcustom org-file-apps
  '((auto-mode . emacs)
    (directory . emacs)
    ("\\.mm\\'" . default)
    ("\\.x?html?\\'" . default)
    ;; ...             ^^^^^^^

You can customize it to change default to emacs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.