Up until yesterday, clicking a link in emacs would open the corresponding page in my browser (Firefox). Sometime yesterday this changed to always open a new window in the browser, on the home page. Any idea what changed - and how to fix it?

GNU Emacs: 24.4.1 Firefox: 36.0 Ubuntu: 14.04

Appears related to reported Ubuntu Firefox bug here.

  • See also emacs.stackexchange.com/q/9636/2064 – artscan Mar 10 '15 at 3:52
  • Opening the link in EWW works for me. Then typing & inside EWW opens the link in Firefox. It is interesting that this works and (setq browse-url-generic-program "firefox") apparently does not. – Peter Becich Apr 2 '18 at 1:14

Summary: Firefox version 36 has removed the -remote option (see here). The emacs-lisp function browse-url-firefox uses this option on non-Windows systems. Changing the function to never use remote option solves the problem.

What specifically you can do: browse-url-firefox is defined in the emacs-lisp associated with your version of emacs - for me: /usr/local/share/emacs/24.4/lisp/net/browse-url.el. You can either edit browse-url.el, or redefine the function browse-url-firefox elsewhere. The specific change in the function browse-url-firefox is to change:

      (not (memq system-type '(windows-nt ms-dos))))


(use-remote nil)
| improve this answer | |

Add the following bits to your ~/.emacs file to fix this issue:

;; work around the bogus "-remote" flag specified by browse-url-firefox
(setq browse-url-browser-function 'browse-url-generic)
(setq browse-url-generic-program "firefox")

The "generic" browser doesn't try to be smart about "-remote"; it just calls whatever program is configured. Incidentally, Firefox does the right thing when called like that anyway, so the whole "-remote" business is pointless anyway.

| improve this answer | |

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.