8

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)?

11

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.

  • 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 4: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).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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