In an Emacs org-mode file, when I click on a PDF the file opens in a PDF viewer. Similarly, when I click on a URL it opens in a web browser. But when I click on a path to an image file, the byte stream opens as text in the editor. How do I configure Emacs/org-mode to open images with a specified application, say an image editor or a browser?
Share
In org-mode, this is
org-file-appsthat control what to do when clicking on a URL-like text.It is configured by default to :
As said in org-file-apps help :
auto-modematches files that are matched by any entry inauto-mode-alist, so all files Emacs knows how to handle. Using this with commandemacswill open most files in Emacs.You may have image file extension configured in auto-mode-alist. You could override this alist by doing something like this in your .emacs (for example, for png files) :
With this code, when I click on a link like this :
It opens the file outside emacs, using the default OS program associated to this file extension.
You don’t have to change
org-file-apps-defaults-windowsnt,org-file-apps-defaults-gnuororg-file-apps-defaults-macosxto use the OS default program associated to the file extension.