(not (equal (elpher-bookmark-url bookmark) url)))
(elpher-load-bookmarks)))))
+;;; Integrations
+;;
+
+(defun browse-url-elpher (url &rest _args)
+ "Browse URL. This function is used by `browse-url'."
+ (interactive (browse-url-interactive-arg "Elpher URL: "))
+ (elpher-go url))
+
+(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))
+ ;; Register "gemini://" as a URI scheme so `browse-url' does the right thing
+ (add-to-list 'thing-at-point-uri-schemes "gemini://"))
+
;;; Interactive procedures
;;