summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--eww-conf.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/eww-conf.el b/eww-conf.el
index 1b3f76b..dae5a7a 100644
--- a/eww-conf.el
+++ b/eww-conf.el
@@ -32,6 +32,21 @@ If ARG is nil, open in EWW. Otherwise, open in an external browser."
(arg (funcall browse-url-secondary-browser-function url))
((eww-browse-url url))))
+;;; Elpher integration
+
+(use-package "elpher" 'elpher)
+
+(defun eww-open-elpher (old url &rest args)
+ "Use Elpher to open the URL if needed."
+ (cond
+ ((member (url-type (url-generic-parse-url url))
+ (list "gemini" "gopher"))
+ (elpher-go url))
+ ((apply old (cons url args)))))
+
+(advice-add #'eww-browse-url :around #'eww-open-elpher)
+(advice-add #'eww :around #'eww-open-elpher)
+
;;; Use pdf-view to view PDF files if available.
(setq mailcap-prefer-mailcap-viewers nil)