From: Alex Schroeder Date: Sun, 27 Jun 2021 19:44:02 +0000 (+0200) Subject: Merge remote-tracking branch 'upstream/patch_integrate_with_browse_url' into main X-Git-Tag: bookmarks~36 X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=elpher.git;a=commitdiff_plain;h=251033288819389440383a5d823ea3fb9d2f2d97;hp=1a8d4300dc8a781d193183caab15a4ad5e0c8297 Merge remote-tracking branch 'upstream/patch_integrate_with_browse_url' into main --- diff --git a/elpher.el b/elpher.el index e9fa4cd..da4d11d 100644 --- a/elpher.el +++ b/elpher.el @@ -1732,6 +1732,18 @@ If ADDRESS is already bookmarked, update the label only." (org-add-link-type "mu4e" 'elpher-org-link-follow) (add-hook 'org-store-link-functions 'elpher-org-link-store))) +(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 ;;