IIUC, "opening" the link type "http" triggers ‘browse-url’
which eventually wants to talk to a server using URL that
begins with "http://";, and opening the link type "file"
basically triggers ‘find-file’.

What if i want to ‘browse-url’ with scheme "file://"?
That is, i don't want to bother going through a server.

This is what i was able to cook up:

 (defun ttn-view-html-file-in-browser (path)
   (browse-url (browse-url-file-url path)))
  
 (org-add-link-type "html" 'ttn-view-html-file-in-browser)

This allows me to write in ~/build/GNU/rcs/.ttn.org, e.g.:

 [[html:.,lcov/rcs/src/index.html][lcov output]]

and see in the browser's location box:

 file:///home/ttn/build/GNU/rcs/.%2clcov/rcs/src/index.html

My questions:
- Is this already builtin somewhere?
- If so, where?
- If not, is the above code the recommended way?

Reply via email to