11

When I click on links in my org-mode buffer it opens up my external browser. How can I make Emacs default to eww (and let me open up an external browser from there if I wish)?

wdkrnls
  • 3,657
  • 2
  • 27
  • 46

2 Answers2

16

As noted in the EWW info manual node you can use EWW as a target for browse-url, which is what Org uses if a URI starts with "http", "https", etc. You can of course customize browse-url behaviour with M-x customize-group browse-url

Alternatively, add the following to ~/.emacs.d/init.el: (setq browse-url-browser-function 'eww-browse-url)

If you're visiting a webpage in EWW you can hit & (eww-browse-with-external-browser) to open the page in an external browser.

cydparser
  • 103
  • 4
p_wiersig
  • 1,051
  • 9
  • 15
  • Can you give me some more information how to manipulate `browse-url`? `browse-url-browser-function` is set to `browse-url-default-browser` which itself appears to just be a symbol, not a variable. How do I actually set eww as the default browser? Following the info documentation you linked to doesn't actually describe how to do this afaic. – wdkrnls Jan 13 '15 at 22:03
  • If you use the "customize" interface to edit `browse-url-browser-function`, you'll find a convenient drop-down menu of values, including "eww" which results in it setting `eww-browse-url` as the function. – phils Jan 14 '15 at 04:01
-1

I set firefox as my default browser with

(setq browse-url-browser-function 'browse-url-generic
      browse-url-generic-program "firefox")

I can't test it with eww because I'm on Emacs 24.3.1 -- but this might work (perhaps with a modification -- since eww seems to be an emacs package, instead of an external program).

Adobe
  • 1,859
  • 13
  • 27