Only add to browse-url-default-handlers if defined
authorAlex Schroeder <alex@gnu.org>
Sun, 27 Jun 2021 20:01:43 +0000 (22:01 +0200)
committerAlex Schroeder <alex@gnu.org>
Sun, 27 Jun 2021 20:01:43 +0000 (22:01 +0200)
On some systems, browse-url does not define
browse-url-default-handlers.

elpher.el

index da4d11d..555f80c 100644 (file)
--- 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://"))