Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make Emacs Org-mode open links to sites in Google Chrome?

Google Chrome is set as the default browser. However, it opens links in Firefox, which is undesired.

How can I make Org-mode to open links in Google Chrome?

like image 649
tobeannounced Avatar asked Dec 22 '10 04:12

tobeannounced


People also ask

How do you add a link in Org mode?

Links in Org are plain text, and you can type or paste them straight into the buffer. By using this command, the links are automatically enclosed in double brackets, and you will be asked for the optional descriptive text.

How to browse URL?

On your computer, go to google.com. Search for the page. At the top of your browser, click the address bar to select the entire URL.


2 Answers

Emacs 23.2 doesn't directly support Google Chrome, but it does support a "generic" browser, and something like this should work:

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

You don't mention your OS, but if it's Windows or Mac, you can try:

(setq browse-url-browser-function 'browse-url-default-windows-browser) (setq browse-url-browser-function 'browse-url-default-macosx-browser) 

And, if that doesn't work, there are other folks who have implemented 'browse-url-chrome. Google turned up the following link:

  • http://code.ohloh.net/search?s=browse-url-chrome&browser=Default
like image 151
Trey Jackson Avatar answered Sep 28 '22 01:09

Trey Jackson


As Trey suggests, you can set it to a generic browser, but instead of "chromium-browser" use "google-chrome", like this:

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

That worked for me with Emacs 23.2 and Chrome 12.

like image 29
Alan Turing Avatar answered Sep 28 '22 00:09

Alan Turing