When you have more than one browser installed, you must choose which
one's the default. The OS will then proceed to open all URLs in the
default browser, even if it happens to be closed while another one
happens to be running.
At least in Emacs we can fix that behavior. The following code
configures Emacs to use whatever browser happens to be open right now,
instead of always defaulting to the same one.
Here we configure our preferences through the endless/browser-list
variable. Its value is a list of cons cells, each representing a
browser. The car is a regexp to match the name of the browser's
process (used to determine whether the browser is running), and the cdr
is the name of the executable.
And this is the function responsible for checking the running
processes and finding a browser in there.
I've tested it on Windows and a couple of Linux distros. Could a Mac
user test it for me as well?
Intelligent browse-url
11 Oct 2014, by Artur Malabarba.When you have more than one browser installed, you must choose which one's the default. The OS will then proceed to open all URLs in the default browser, even if it happens to be closed while another one happens to be running.
At least in Emacs we can fix that behavior. The following code configures Emacs to use whatever browser happens to be open right now, instead of always defaulting to the same one.
Here we configure our preferences through the endless/browser-list variable. Its value is a list of cons cells, each representing a browser. The car is a regexp to match the name of the browser's process (used to determine whether the browser is running), and the cdr is the name of the executable.
And this is the function responsible for checking the running processes and finding a browser in there.
I've tested it on Windows and a couple of Linux distros. Could a Mac user test it for me as well?
Tags: browse-url, integration, init.el, emacs,
Sweet New Features in 24.4 »
« And the Beta goes Public
Content © 2019, All rights reserved. Icons under CC3.0.