emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Thien-Thi Nguyen <ttn@gnuvola.org>
To: emacs-orgmode@gnu.org
Subject: rfc: link type "html"
Date: Thu, 19 Jan 2012 10:27:47 +0100	[thread overview]
Message-ID: <87aa5kyrcc.fsf@gnuvola.org> (raw)

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	other threads:[~2012-01-19  9:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87aa5kyrcc.fsf@gnuvola.org \
    --to=ttn@gnuvola.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).