Subject: #18986 Design bug in browse-url.el: browse-url-can-use-xdg-open's logic uses overly strict assumption

From: Pierre Neidhardt <[email-masked]>
Date: Mon, 12 Feb 2018 17:23:26 +0100

Sorry for digging out this old issue, but it seemed that Florian's
suggestion (which was pretty good in my opinion) was never answered.

I've been battling with browse-url for longer than necessary, it seems
to me that there are just too many rough edges around xdg-open,
xdg-mime, ~/.config/mimeapps.list, `mailcap-mime-extensions'...

Having `browse-url-can-use-xdg-open' _and_ a customizable list of
default browser in `browse-url-default-browser' would help tremendously.

I'd like to add one more feature which could relieve non-DE users even further:

	(defun browse-url-default-browser (url &rest args)
	...
	  (apply
	   (cond
	   ...
	+   ((getenv "BROWSER") (executable-find (getenv "BROWSER")))
	    ((memq system-type '(windows-nt ms-dos cygwin))
	     'browse-url-default-windows-browser)

The "BROWSER" environment variable is relativement common and if it is
set, it most probably means that the users did that themselves.