Browse-url: Comment on BROWSER variable

master
Pierre Neidhardt 2019-03-03 15:39:09 +01:00
parent 00ff4895f7
commit 1181912ace
1 changed files with 2 additions and 1 deletions

View File

@ -144,9 +144,10 @@
;; REVIEW: If xdg-open is not found, set Emacs URL browser to the environment browser,
;; or w3m if BROWSER is not set.
;; See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=18986.
;; In Emacs 26, the BROWSER variable is still not checked.
(require 'browse-url)
(setq browse-url-generic-program (or
(executable-find (or (getenv "BROWSER") "")) ; TODO: Still need this in Emacs 26?
(executable-find (or (getenv "BROWSER") ""))
(when (executable-find "xdg-mime")
(let ((desktop-browser (ambrevar/call-process-to-string "xdg-mime" "query" "default" "text/html")))
(substring desktop-browser 0 (string-match "\\.desktop" desktop-browser))))