I'm working under org-mode.

When I click on a [http://example.com] link, it opens a tab in Firefox as expected. The .emacs config is: '(browse-url-browser-function (quote browse-url-firefox))

However, for links in the form file:///localdir/myfile.html it depicts the message running /usr/bin/sensible-browser and starts Opera.

Why would emacs do that? Why does it not use Firefox or defaults to my system default browser?

3 Answers 3


Well, in a sense sensible-browser is a system default browser:-)

I believe that you need to use the update-alternatives system to set that system default.

As to why Org mode is using sensible-browser instead of the browse-URL functionality, I suspect it's because for file URLs it tries to be clever.


/usr/bin/sensible-browser is a shell script. /usr/bin/gnome-www-browser has a high priority.

File sensible-browser:

if test -n "$DISPLAY"; then
    if test -n "$GNOME_DESKTOP_SESSION_ID"; then
        if test -x /usr/bin/gnome-www-browser; then
        elif test -x /usr/bin/x-www-browser; then
        elif test -x /usr/bin/gnome-terminal && test -x /usr/bin/www-browser; 

So you can use

sudo update-alternatives --config gnome-www-browser 


sudo update-alternatives --config x-www-browser 

to select the default browser that org mode uses.


There are lots of good reasons why it might not be useful to open a given file: URL in a web browser, so org has a distinct mechanism for handling them and deciding what to do with them.

M-x customize-option RET org-file-apps RET

But in practice, Bob Uhl's answer is probably what you want? If Firefox is your preferred browser, then you should probably have it set as your system default, rather than customizing multiple independent Emacs settings to override the system default in the same way. (Caveat: I don't know how sensible-browser makes its decision, so the situation might not be as simplistic as I've assumed.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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