From: Alex Schroeder Date: Sun, 27 Jun 2021 20:01:43 +0000 (+0200) Subject: Only add to browse-url-default-handlers if defined X-Git-Tag: v3.0.0~22^2~37 X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=commitdiff_plain;h=2c636ea3e5ea7d2cb9f8d0e2062f067b68fdaaf0;p=elpher.git Only add to browse-url-default-handlers if defined On some systems, browse-url does not define browse-url-default-handlers. --- diff --git a/elpher.el b/elpher.el index da4d11d..555f80c 100644 --- a/elpher.el +++ b/elpher.el @@ -1739,8 +1739,9 @@ If ADDRESS is already bookmarked, update the label only." (with-eval-after-load "browse-url" ;; Use elpher to open gopher, finger and gemini links - (add-to-list 'browse-url-default-handlers - '("^\\(gopher\\|finger\\|gemini\\)://" . browse-url-elpher)) + (when (boundp 'browse-url-default-handlers) + (add-to-list 'browse-url-default-handlers + '("^\\(gopher\\|finger\\|gemini\\)://" . browse-url-elpher))) ;; Register "gemini://" as a URI scheme so `browse-url' does the right thing (add-to-list 'thing-at-point-uri-schemes "gemini://"))