From 1b8e0b62d4ba6a9aa505fc52f520608c7682fd46 Mon Sep 17 00:00:00 2001 From: JSDurand Date: Mon, 29 Aug 2022 21:45:51 +0800 Subject: eww: integrate with elpher * eww-conf.el: ("elpher", eww-open-elpher, #'eww-browse-url, #'eww): Add integration with Elpher. So far it seems nice. --- eww-conf.el | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'eww-conf.el') 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) -- cgit v1.2.3-18-g5258