Update browse-url configuration for Emacs-28.1

This commit is contained in:
Gerard Vermeulen 2022-04-01 12:17:26 +02:00
parent 7f323dd1a3
commit 55f7e6fcae

View File

@ -3275,13 +3275,21 @@ Listing [[lst:configure-browse-url]] configures =browse-url=.
(with-eval-after-load 'browse-url
(defun browse-url-mpv (url &optional _)
(start-process "mpv" nil "mpv" url))
(custom-set-variables
'(browse-url-browser-function
`((,(rx (or "https://www.youtube.com/" "https://youtu.be/")) . browse-url-mpv)
("https://soundcloud.com/" . browse-url-mpv)
("." . eww-browse-url)))
`(browse-url-generic-program ,(or (when (eq system-type 'darwin) "open")
(executable-find "firefox")))))
(if (version< emacs-version "28.0")
(custom-set-variables
'(browse-url-browser-function
`((,(rx (or "https://www.youtube.com/" "https://youtu.be/")) . browse-url-mpv)
("https://soundcloud.com/" . browse-url-mpv)
("." . eww-browse-url)))
`(browse-url-generic-program ,(or (when (eq system-type 'darwin) "open")
(executable-find "firefox"))))
(custom-set-variables
'(browse-url-handlers
`((,(rx (or "https://www.youtube.com/" "https://youtu.be/")) . browse-url-mpv)
("https://soundcloud.com/" . browse-url-mpv)
("." . eww-browse-url)))
`(browse-url-generic-program ,(or (when (eq system-type 'darwin) "open")
(executable-find "firefox"))))))
#+end_src
*** [[https://en.wikipedia.org/wiki/Eww_(web_browser)][Emacs Web Wowser]]