let elpher handle gemini, gopher links in eww buffer
authorAbhiseck Paira <abhiseckpaira@disroot.org>
Thu, 29 Jul 2021 07:08:46 +0000 (12:38 +0530)
committerAbhiseck Paira <abhiseckpaira@disroot.org>
Thu, 29 Jul 2021 07:08:46 +0000 (12:38 +0530)
In a eww buffer, clicking on gemini, gopher, finger links will give
error "Unknown url scheme" as eww would try to open it itself.

Eww calls browse-url if a link matches regexp as defined in
`eww-use-browse-url' variable. Elpher has already defined
`elpher-browse-url-elpher' handler to handle gemini links, so browse-url
would open those links in elpher appropriately.

elpher.el

index ef20de0..cfa13b9 100644 (file)
--- a/elpher.el
+++ b/elpher.el
@@ -1978,6 +1978,12 @@ supports the old protocol elpher, where the link is self-contained."
 (setq mu4e~view-beginning-of-url-regexp
       "\\(?:https?\\|gopher\\|finger\\|gemini\\)://\\|mailto:")
 
+;;; eww:
+
+;; Let elpher handle gemini, gopher links in eww buffer.
+(setq eww-use-browse-url
+      "\\`mailto:\\|\\(\\`gemini\\|\\`gopher\\|\\`finger\\)://")
+
 ;;; Interactive procedures
 ;;